resetting manifest requested domain to floor
[platform/upstream/inputproto.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
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
12 # PARTICULAR PURPOSE.
13
14 m4_ifndef([AC_AUTOCONF_VERSION],
15   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17 [m4_warning([this file was generated for autoconf 2.68.
18 You have another version of autoconf.  It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
23 # serial 1 (pkg-config-0.24)
24
25 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26 #
27 # This program is free software; you can redistribute it and/or modify
28 # it under the terms of the GNU General Public License as published by
29 # the Free Software Foundation; either version 2 of the License, or
30 # (at your option) any later version.
31 #
32 # This program is distributed in the hope that it will be useful, but
33 # WITHOUT ANY WARRANTY; without even the implied warranty of
34 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
35 # General Public License for more details.
36 #
37 # You should have received a copy of the GNU General Public License
38 # along with this program; if not, write to the Free Software
39 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 #
41 # As a special exception to the GNU General Public License, if you
42 # distribute this file as part of a program that contains a
43 # configuration script generated by Autoconf, you may include it under
44 # the same distribution terms that you use for the rest of that program.
45
46 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
47 # ----------------------------------
48 AC_DEFUN([PKG_PROG_PKG_CONFIG],
49 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
50 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
51 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
52 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
53 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
54
55 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
56         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
57 fi
58 if test -n "$PKG_CONFIG"; then
59         _pkg_min_version=m4_default([$1], [0.9.0])
60         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
61         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
62                 AC_MSG_RESULT([yes])
63         else
64                 AC_MSG_RESULT([no])
65                 PKG_CONFIG=""
66         fi
67 fi[]dnl
68 ])# PKG_PROG_PKG_CONFIG
69
70 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
71 #
72 # Check to see whether a particular set of modules exists.  Similar
73 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
74 #
75 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
76 # only at the first occurence in configure.ac, so if the first place
77 # it's called might be skipped (such as if it is within an "if", you
78 # have to call PKG_CHECK_EXISTS manually
79 # --------------------------------------------------------------
80 AC_DEFUN([PKG_CHECK_EXISTS],
81 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
82 if test -n "$PKG_CONFIG" && \
83     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
84   m4_default([$2], [:])
85 m4_ifvaln([$3], [else
86   $3])dnl
87 fi])
88
89 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
90 # ---------------------------------------------
91 m4_define([_PKG_CONFIG],
92 [if test -n "$$1"; then
93     pkg_cv_[]$1="$$1"
94  elif test -n "$PKG_CONFIG"; then
95     PKG_CHECK_EXISTS([$3],
96                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
97                      [pkg_failed=yes])
98  else
99     pkg_failed=untried
100 fi[]dnl
101 ])# _PKG_CONFIG
102
103 # _PKG_SHORT_ERRORS_SUPPORTED
104 # -----------------------------
105 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108         _pkg_short_errors_supported=yes
109 else
110         _pkg_short_errors_supported=no
111 fi[]dnl
112 ])# _PKG_SHORT_ERRORS_SUPPORTED
113
114
115 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116 # [ACTION-IF-NOT-FOUND])
117 #
118 #
119 # Note that if there is a possibility the first call to
120 # PKG_CHECK_MODULES might not happen, you should be sure to include an
121 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
122 #
123 #
124 # --------------------------------------------------------------
125 AC_DEFUN([PKG_CHECK_MODULES],
126 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
129
130 pkg_failed=no
131 AC_MSG_CHECKING([for $1])
132
133 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
135
136 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137 and $1[]_LIBS to avoid the need to call pkg-config.
138 See the pkg-config man page for more details.])
139
140 if test $pkg_failed = yes; then
141         AC_MSG_RESULT([no])
142         _PKG_SHORT_ERRORS_SUPPORTED
143         if test $_pkg_short_errors_supported = yes; then
144                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
145         else 
146                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
147         fi
148         # Put the nasty error message in config.log where it belongs
149         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150
151         m4_default([$4], [AC_MSG_ERROR(
152 [Package requirements ($2) were not met:
153
154 $$1_PKG_ERRORS
155
156 Consider adjusting the PKG_CONFIG_PATH environment variable if you
157 installed software in a non-standard prefix.
158
159 _PKG_TEXT])
160         ])
161 elif test $pkg_failed = untried; then
162         AC_MSG_RESULT([no])
163         m4_default([$4], [AC_MSG_FAILURE(
164 [The pkg-config script could not be found or is too old.  Make sure it
165 is in your PATH or set the PKG_CONFIG environment variable to the full
166 path to pkg-config.
167
168 _PKG_TEXT
169
170 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
171         ])
172 else
173         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175         AC_MSG_RESULT([yes])
176         $3
177 fi[]dnl
178 ])# PKG_CHECK_MODULES
179
180 dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
181 dnl
182 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
183 dnl 
184 dnl Permission is hereby granted, free of charge, to any person obtaining a
185 dnl copy of this software and associated documentation files (the "Software"),
186 dnl to deal in the Software without restriction, including without limitation
187 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
188 dnl and/or sell copies of the Software, and to permit persons to whom the
189 dnl Software is furnished to do so, subject to the following conditions:
190 dnl
191 dnl The above copyright notice and this permission notice (including the next
192 dnl paragraph) shall be included in all copies or substantial portions of the
193 dnl Software.
194 dnl
195 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
196 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
198 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
200 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
201 dnl DEALINGS IN THE SOFTWARE.
202
203 # XORG_MACROS_VERSION(required-version)
204 # -------------------------------------
205 # Minimum version: 1.1.0
206 #
207 # If you're using a macro added in Version 1.1 or newer, include this in
208 # your configure.ac with the minimum required version, such as:
209 # XORG_MACROS_VERSION(1.1)
210 #
211 # To ensure that this macro is defined, also add:
212 # m4_ifndef([XORG_MACROS_VERSION],
213 #     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
214 #
215 #
216 # See the "minimum version" comment for each macro you use to see what 
217 # version you require.
218 m4_defun([XORG_MACROS_VERSION],[
219 m4_define([vers_have], [1.15.0])
220 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
221 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
222 m4_if(m4_cmp(maj_have, maj_needed), 0,,
223     [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
224 m4_if(m4_version_compare(vers_have, [$1]), -1,
225     [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
226 m4_undefine([vers_have])
227 m4_undefine([maj_have])
228 m4_undefine([maj_needed])
229 ]) # XORG_MACROS_VERSION
230
231 # XORG_PROG_RAWCPP()
232 # ------------------
233 # Minimum version: 1.0.0
234 #
235 # Find cpp program and necessary flags for use in pre-processing text files
236 # such as man pages and config files
237 AC_DEFUN([XORG_PROG_RAWCPP],[
238 AC_REQUIRE([AC_PROG_CPP])
239 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
240    [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
241
242 # Check for flag to avoid builtin definitions - assumes unix is predefined,
243 # which is not the best choice for supporting other OS'es, but covers most
244 # of the ones we need for now.
245 AC_MSG_CHECKING([if $RAWCPP requires -undef])
246 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
247 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
248         AC_MSG_RESULT([no])
249 else
250         if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
251                 RAWCPPFLAGS=-undef
252                 AC_MSG_RESULT([yes])
253         # under Cygwin unix is still defined even with -undef
254         elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
255                 RAWCPPFLAGS="-undef -ansi"
256                 AC_MSG_RESULT([yes, with -ansi])
257         else
258                 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
259         fi
260 fi
261 rm -f conftest.$ac_ext
262
263 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
264 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
265 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
266         AC_MSG_RESULT([no])
267 else
268         if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
269                 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
270                 AC_MSG_RESULT([yes])
271         else
272                 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
273         fi
274 fi
275 rm -f conftest.$ac_ext
276 AC_SUBST(RAWCPPFLAGS)
277 ]) # XORG_PROG_RAWCPP
278
279 # XORG_MANPAGE_SECTIONS()
280 # -----------------------
281 # Minimum version: 1.0.0
282 #
283 # Determine which sections man pages go in for the different man page types
284 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
285 # Not sure if there's any better way than just hardcoding by OS name.
286 # Override default settings by setting environment variables
287 # Added MAN_SUBSTS in version 1.8
288 # Added AC_PROG_SED in version 1.8
289
290 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
291 AC_REQUIRE([AC_CANONICAL_HOST])
292 AC_REQUIRE([AC_PROG_SED])
293
294 if test x$APP_MAN_SUFFIX = x    ; then
295     APP_MAN_SUFFIX=1
296 fi
297 if test x$APP_MAN_DIR = x    ; then
298     APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
299 fi
300
301 if test x$LIB_MAN_SUFFIX = x    ; then
302     LIB_MAN_SUFFIX=3
303 fi
304 if test x$LIB_MAN_DIR = x    ; then
305     LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
306 fi
307
308 if test x$FILE_MAN_SUFFIX = x    ; then
309     case $host_os in
310         solaris*)       FILE_MAN_SUFFIX=4  ;;
311         *)              FILE_MAN_SUFFIX=5  ;;
312     esac
313 fi
314 if test x$FILE_MAN_DIR = x    ; then
315     FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
316 fi
317
318 if test x$MISC_MAN_SUFFIX = x    ; then
319     case $host_os in
320         solaris*)       MISC_MAN_SUFFIX=5  ;;
321         *)              MISC_MAN_SUFFIX=7  ;;
322     esac
323 fi
324 if test x$MISC_MAN_DIR = x    ; then
325     MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
326 fi
327
328 if test x$DRIVER_MAN_SUFFIX = x    ; then
329     case $host_os in
330         solaris*)       DRIVER_MAN_SUFFIX=7  ;;
331         *)              DRIVER_MAN_SUFFIX=4  ;;
332     esac
333 fi
334 if test x$DRIVER_MAN_DIR = x    ; then
335     DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
336 fi
337
338 if test x$ADMIN_MAN_SUFFIX = x    ; then
339     case $host_os in
340         solaris*)       ADMIN_MAN_SUFFIX=1m ;;
341         *)              ADMIN_MAN_SUFFIX=8  ;;
342     esac
343 fi
344 if test x$ADMIN_MAN_DIR = x    ; then
345     ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
346 fi
347
348
349 AC_SUBST([APP_MAN_SUFFIX])
350 AC_SUBST([LIB_MAN_SUFFIX])
351 AC_SUBST([FILE_MAN_SUFFIX])
352 AC_SUBST([MISC_MAN_SUFFIX])
353 AC_SUBST([DRIVER_MAN_SUFFIX])
354 AC_SUBST([ADMIN_MAN_SUFFIX])
355 AC_SUBST([APP_MAN_DIR])
356 AC_SUBST([LIB_MAN_DIR])
357 AC_SUBST([FILE_MAN_DIR])
358 AC_SUBST([MISC_MAN_DIR])
359 AC_SUBST([DRIVER_MAN_DIR])
360 AC_SUBST([ADMIN_MAN_DIR])
361
362 XORG_MAN_PAGE="X Version 11"
363 AC_SUBST([XORG_MAN_PAGE])
364 MAN_SUBSTS="\
365         -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
366         -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
367         -e 's|__xservername__|Xorg|g' \
368         -e 's|__xconfigfile__|xorg.conf|g' \
369         -e 's|__projectroot__|\$(prefix)|g' \
370         -e 's|__apploaddir__|\$(appdefaultdir)|g' \
371         -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
372         -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
373         -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
374         -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
375         -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
376         -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
377 AC_SUBST([MAN_SUBSTS])
378
379 ]) # XORG_MANPAGE_SECTIONS
380
381 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
382 # ------------------------
383 # Minimum version: 1.7.0
384 #
385 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
386 # provided by xorg-sgml-doctools, if installed.
387 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
388 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
389 XORG_SGML_PATH=
390 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
391     [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
392     [m4_ifval([$1],[:],
393         [if test x"$cross_compiling" != x"yes" ; then
394             AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
395                           [XORG_SGML_PATH=$prefix/share/sgml])
396          fi])
397     ])
398
399 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
400 # the path and the name of the doc stylesheet
401 if test "x$XORG_SGML_PATH" != "x" ; then
402    AC_MSG_RESULT([$XORG_SGML_PATH])
403    STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
404    XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
405 else
406    AC_MSG_RESULT([no])
407 fi
408
409 AC_SUBST(XORG_SGML_PATH)
410 AC_SUBST(STYLESHEET_SRCDIR)
411 AC_SUBST(XSL_STYLESHEET)
412 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
413 ]) # XORG_CHECK_SGML_DOCTOOLS
414
415 # XORG_CHECK_LINUXDOC
416 # -------------------
417 # Minimum version: 1.0.0
418 #
419 # Defines the variable MAKE_TEXT if the necessary tools and
420 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
421 # Whether or not the necessary tools and files are found can be checked
422 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
423 AC_DEFUN([XORG_CHECK_LINUXDOC],[
424 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
425 AC_REQUIRE([XORG_WITH_PS2PDF])
426
427 AC_PATH_PROG(LINUXDOC, linuxdoc)
428
429 AC_MSG_CHECKING([whether to build documentation])
430
431 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
432    BUILDDOC=yes
433 else
434    BUILDDOC=no
435 fi
436
437 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
438
439 AC_MSG_RESULT([$BUILDDOC])
440
441 AC_MSG_CHECKING([whether to build pdf documentation])
442
443 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
444    BUILDPDFDOC=yes
445 else
446    BUILDPDFDOC=no
447 fi
448
449 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
450
451 AC_MSG_RESULT([$BUILDPDFDOC])
452
453 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
454 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
455 MAKE_PDF="$PS2PDF"
456 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
457
458 AC_SUBST(MAKE_TEXT)
459 AC_SUBST(MAKE_PS)
460 AC_SUBST(MAKE_PDF)
461 AC_SUBST(MAKE_HTML)
462 ]) # XORG_CHECK_LINUXDOC
463
464 # XORG_CHECK_DOCBOOK
465 # -------------------
466 # Minimum version: 1.0.0
467 #
468 # Checks for the ability to build output formats from SGML DocBook source.
469 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
470 # indicates whether the necessary tools and files are found and, if set,
471 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
472 AC_DEFUN([XORG_CHECK_DOCBOOK],[
473 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
474
475 BUILDTXTDOC=no
476 BUILDPDFDOC=no
477 BUILDPSDOC=no
478 BUILDHTMLDOC=no
479
480 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
481 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
482 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
483 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
484
485 AC_MSG_CHECKING([whether to build text documentation])
486 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
487    test x$BUILD_TXTDOC != xno; then
488         BUILDTXTDOC=yes
489 fi
490 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
491 AC_MSG_RESULT([$BUILDTXTDOC])
492
493 AC_MSG_CHECKING([whether to build PDF documentation])
494 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
495    test x$BUILD_PDFDOC != xno; then
496         BUILDPDFDOC=yes
497 fi
498 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
499 AC_MSG_RESULT([$BUILDPDFDOC])
500
501 AC_MSG_CHECKING([whether to build PostScript documentation])
502 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
503    test x$BUILD_PSDOC != xno; then
504         BUILDPSDOC=yes
505 fi
506 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
507 AC_MSG_RESULT([$BUILDPSDOC])
508
509 AC_MSG_CHECKING([whether to build HTML documentation])
510 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
511    test x$BUILD_HTMLDOC != xno; then
512         BUILDHTMLDOC=yes
513 fi
514 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
515 AC_MSG_RESULT([$BUILDHTMLDOC])
516
517 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
518 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
519 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
520 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
521
522 AC_SUBST(MAKE_TEXT)
523 AC_SUBST(MAKE_PS)
524 AC_SUBST(MAKE_PDF)
525 AC_SUBST(MAKE_HTML)
526 ]) # XORG_CHECK_DOCBOOK
527
528 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
529 # ----------------
530 # Minimum version: 1.5.0
531 # Minimum version for optional DEFAULT argument: 1.11.0
532 #
533 # Documentation tools are not always available on all platforms and sometimes
534 # not at the appropriate level. This macro enables a module to test for the
535 # presence of the tool and obtain it's path in separate variables. Coupled with
536 # the --with-xmlto option, it allows maximum flexibilty in making decisions
537 # as whether or not to use the xmlto package. When DEFAULT is not specified,
538 # --with-xmlto assumes 'auto'.
539 #
540 # Interface to module:
541 # HAVE_XMLTO:   used in makefiles to conditionally generate documentation
542 # XMLTO:        returns the path of the xmlto program found
543 #               returns the path set by the user in the environment
544 # --with-xmlto: 'yes' user instructs the module to use xmlto
545 #               'no' user instructs the module not to use xmlto
546 #
547 # Added in version 1.10.0
548 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
549 #                  xmlto for text output requires either lynx, links, or w3m browsers
550 #
551 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
552 #
553 AC_DEFUN([XORG_WITH_XMLTO],[
554 AC_ARG_VAR([XMLTO], [Path to xmlto command])
555 m4_define([_defopt], m4_default([$2], [auto]))
556 AC_ARG_WITH(xmlto,
557         AS_HELP_STRING([--with-xmlto],
558            [Use xmlto to regenerate documentation (default: ]_defopt[)]),
559            [use_xmlto=$withval], [use_xmlto=]_defopt)
560 m4_undefine([_defopt])
561
562 if test "x$use_xmlto" = x"auto"; then
563    AC_PATH_PROG([XMLTO], [xmlto])
564    if test "x$XMLTO" = "x"; then
565         AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
566         have_xmlto=no
567    else
568         have_xmlto=yes
569    fi
570 elif test "x$use_xmlto" = x"yes" ; then
571    AC_PATH_PROG([XMLTO], [xmlto])
572    if test "x$XMLTO" = "x"; then
573         AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
574    fi
575    have_xmlto=yes
576 elif test "x$use_xmlto" = x"no" ; then
577    if test "x$XMLTO" != "x"; then
578       AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
579    fi
580    have_xmlto=no
581 else
582    AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
583 fi
584
585 # Test for a minimum version of xmlto, if provided.
586 m4_ifval([$1],
587 [if test "$have_xmlto" = yes; then
588     # scrape the xmlto version
589     AC_MSG_CHECKING([the xmlto version])
590     xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
591     AC_MSG_RESULT([$xmlto_version])
592     AS_VERSION_COMPARE([$xmlto_version], [$1],
593         [if test "x$use_xmlto" = xauto; then
594             AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
595             have_xmlto=no
596         else
597             AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
598         fi])
599 fi])
600
601 # Test for the ability of xmlto to generate a text target
602 have_xmlto_text=no
603 cat > conftest.xml << "EOF"
604 EOF
605 AS_IF([test "$have_xmlto" = yes],
606       [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
607              [have_xmlto_text=yes],
608              [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
609 rm -f conftest.xml
610 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
611 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
612 ]) # XORG_WITH_XMLTO
613
614 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
615 # --------------------------------------------
616 # Minimum version: 1.12.0
617 # Minimum version for optional DEFAULT argument: 1.12.0
618 #
619 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
620 # XML-based language used for the transformation of XML documents.
621 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
622 # It is used under the cover by xmlto to generate html files from DocBook/XML.
623 # The XSLT processor is often used as a standalone tool for transformations.
624 # It should not be assumed that this tool is used only to work with documnetation.
625 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
626 #
627 # Interface to module:
628 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
629 # XSLTPROC:      returns the path of the xsltproc program found
630 #                returns the path set by the user in the environment
631 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
632 #                 'no' user instructs the module not to use xsltproc
633 # have_xsltproc: returns yes if xsltproc found in PATH or no
634 #
635 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
636 #
637 AC_DEFUN([XORG_WITH_XSLTPROC],[
638 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
639 # Preserves the interface, should it be implemented later
640 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
641 m4_define([_defopt], m4_default([$2], [auto]))
642 AC_ARG_WITH(xsltproc,
643         AS_HELP_STRING([--with-xsltproc],
644            [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
645            [use_xsltproc=$withval], [use_xsltproc=]_defopt)
646 m4_undefine([_defopt])
647
648 if test "x$use_xsltproc" = x"auto"; then
649    AC_PATH_PROG([XSLTPROC], [xsltproc])
650    if test "x$XSLTPROC" = "x"; then
651         AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
652         have_xsltproc=no
653    else
654         have_xsltproc=yes
655    fi
656 elif test "x$use_xsltproc" = x"yes" ; then
657    AC_PATH_PROG([XSLTPROC], [xsltproc])
658    if test "x$XSLTPROC" = "x"; then
659         AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
660    fi
661    have_xsltproc=yes
662 elif test "x$use_xsltproc" = x"no" ; then
663    if test "x$XSLTPROC" != "x"; then
664       AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
665    fi
666    have_xsltproc=no
667 else
668    AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
669 fi
670
671 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
672 ]) # XORG_WITH_XSLTPROC
673
674 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
675 # ----------------------------------------
676 # Minimum version: 1.15.0
677 #
678 # PERL (Practical Extraction and Report Language) is a language optimized for
679 # scanning arbitrary text files, extracting information from those text files,
680 # and printing reports based on that information.
681 #
682 # When DEFAULT is not specified, --with-perl assumes 'auto'.
683 #
684 # Interface to module:
685 # HAVE_PERL: used in makefiles to conditionally scan text files
686 # PERL:      returns the path of the perl program found
687 #            returns the path set by the user in the environment
688 # --with-perl: 'yes' user instructs the module to use perl
689 #              'no' user instructs the module not to use perl
690 # have_perl: returns yes if perl found in PATH or no
691 #
692 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
693 #
694 AC_DEFUN([XORG_WITH_PERL],[
695 AC_ARG_VAR([PERL], [Path to perl command])
696 # Preserves the interface, should it be implemented later
697 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
698 m4_define([_defopt], m4_default([$2], [auto]))
699 AC_ARG_WITH(perl,
700         AS_HELP_STRING([--with-perl],
701            [Use perl for extracting information from files (default: ]_defopt[)]),
702            [use_perl=$withval], [use_perl=]_defopt)
703 m4_undefine([_defopt])
704
705 if test "x$use_perl" = x"auto"; then
706    AC_PATH_PROG([PERL], [perl])
707    if test "x$PERL" = "x"; then
708         AC_MSG_WARN([perl not found - cannot extract information and report])
709         have_perl=no
710    else
711         have_perl=yes
712    fi
713 elif test "x$use_perl" = x"yes" ; then
714    AC_PATH_PROG([PERL], [perl])
715    if test "x$PERL" = "x"; then
716         AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
717    fi
718    have_perl=yes
719 elif test "x$use_perl" = x"no" ; then
720    if test "x$PERL" != "x"; then
721       AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
722    fi
723    have_perl=no
724 else
725    AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
726 fi
727
728 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
729 ]) # XORG_WITH_PERL
730
731 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
732 # ----------------
733 # Minimum version: 1.5.0
734 # Minimum version for optional DEFAULT argument: 1.11.0
735 #
736 # Documentation tools are not always available on all platforms and sometimes
737 # not at the appropriate level. This macro enables a module to test for the
738 # presence of the tool and obtain it's path in separate variables. Coupled with
739 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
740 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
741 # --with-asciidoc assumes 'auto'.
742 #
743 # Interface to module:
744 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
745 # ASCIIDOC:      returns the path of the asciidoc program found
746 #                returns the path set by the user in the environment
747 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
748 #                 'no' user instructs the module not to use asciidoc
749 #
750 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
751 #
752 AC_DEFUN([XORG_WITH_ASCIIDOC],[
753 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
754 m4_define([_defopt], m4_default([$2], [auto]))
755 AC_ARG_WITH(asciidoc,
756         AS_HELP_STRING([--with-asciidoc],
757            [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
758            [use_asciidoc=$withval], [use_asciidoc=]_defopt)
759 m4_undefine([_defopt])
760
761 if test "x$use_asciidoc" = x"auto"; then
762    AC_PATH_PROG([ASCIIDOC], [asciidoc])
763    if test "x$ASCIIDOC" = "x"; then
764         AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
765         have_asciidoc=no
766    else
767         have_asciidoc=yes
768    fi
769 elif test "x$use_asciidoc" = x"yes" ; then
770    AC_PATH_PROG([ASCIIDOC], [asciidoc])
771    if test "x$ASCIIDOC" = "x"; then
772         AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
773    fi
774    have_asciidoc=yes
775 elif test "x$use_asciidoc" = x"no" ; then
776    if test "x$ASCIIDOC" != "x"; then
777       AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
778    fi
779    have_asciidoc=no
780 else
781    AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
782 fi
783 m4_ifval([$1],
784 [if test "$have_asciidoc" = yes; then
785     # scrape the asciidoc version
786     AC_MSG_CHECKING([the asciidoc version])
787     asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
788     AC_MSG_RESULT([$asciidoc_version])
789     AS_VERSION_COMPARE([$asciidoc_version], [$1],
790         [if test "x$use_asciidoc" = xauto; then
791             AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
792             have_asciidoc=no
793         else
794             AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
795         fi])
796 fi])
797 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
798 ]) # XORG_WITH_ASCIIDOC
799
800 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
801 # --------------------------------
802 # Minimum version: 1.5.0
803 # Minimum version for optional DEFAULT argument: 1.11.0
804 #
805 # Documentation tools are not always available on all platforms and sometimes
806 # not at the appropriate level. This macro enables a module to test for the
807 # presence of the tool and obtain it's path in separate variables. Coupled with
808 # the --with-doxygen option, it allows maximum flexibilty in making decisions
809 # as whether or not to use the doxygen package. When DEFAULT is not specified,
810 # --with-doxygen assumes 'auto'.
811 #
812 # Interface to module:
813 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
814 # DOXYGEN:       returns the path of the doxygen program found
815 #                returns the path set by the user in the environment
816 # --with-doxygen: 'yes' user instructs the module to use doxygen
817 #                 'no' user instructs the module not to use doxygen
818 #
819 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
820 #
821 AC_DEFUN([XORG_WITH_DOXYGEN],[
822 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
823 m4_define([_defopt], m4_default([$2], [auto]))
824 AC_ARG_WITH(doxygen,
825         AS_HELP_STRING([--with-doxygen],
826            [Use doxygen to regenerate documentation (default: ]_defopt[)]),
827            [use_doxygen=$withval], [use_doxygen=]_defopt)
828 m4_undefine([_defopt])
829
830 if test "x$use_doxygen" = x"auto"; then
831    AC_PATH_PROG([DOXYGEN], [doxygen])
832    if test "x$DOXYGEN" = "x"; then
833         AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
834         have_doxygen=no
835    else
836         have_doxygen=yes
837    fi
838 elif test "x$use_doxygen" = x"yes" ; then
839    AC_PATH_PROG([DOXYGEN], [doxygen])
840    if test "x$DOXYGEN" = "x"; then
841         AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
842    fi
843    have_doxygen=yes
844 elif test "x$use_doxygen" = x"no" ; then
845    if test "x$DOXYGEN" != "x"; then
846       AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
847    fi
848    have_doxygen=no
849 else
850    AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
851 fi
852 m4_ifval([$1],
853 [if test "$have_doxygen" = yes; then
854     # scrape the doxygen version
855     AC_MSG_CHECKING([the doxygen version])
856     doxygen_version=`$DOXYGEN --version 2>/dev/null`
857     AC_MSG_RESULT([$doxygen_version])
858     AS_VERSION_COMPARE([$doxygen_version], [$1],
859         [if test "x$use_doxygen" = xauto; then
860             AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
861             have_doxygen=no
862         else
863             AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
864         fi])
865 fi])
866 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
867 ]) # XORG_WITH_DOXYGEN
868
869 # XORG_WITH_GROFF([DEFAULT])
870 # ----------------
871 # Minimum version: 1.6.0
872 # Minimum version for optional DEFAULT argument: 1.11.0
873 #
874 # Documentation tools are not always available on all platforms and sometimes
875 # not at the appropriate level. This macro enables a module to test for the
876 # presence of the tool and obtain it's path in separate variables. Coupled with
877 # the --with-groff option, it allows maximum flexibilty in making decisions
878 # as whether or not to use the groff package. When DEFAULT is not specified,
879 # --with-groff assumes 'auto'.
880 #
881 # Interface to module:
882 # HAVE_GROFF:    used in makefiles to conditionally generate documentation
883 # HAVE_GROFF_MM: the memorandum macros (-mm) package
884 # HAVE_GROFF_MS: the -ms macros package
885 # GROFF:         returns the path of the groff program found
886 #                returns the path set by the user in the environment
887 # --with-groff:  'yes' user instructs the module to use groff
888 #                'no' user instructs the module not to use groff
889 #
890 # Added in version 1.9.0:
891 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
892 #                  pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
893 #                  psselect from the psutils package.
894 #                  the ghostcript package. Refer to the grohtml man pages
895 #
896 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
897 #
898 # OS and distros often splits groff in a basic and full package, the former
899 # having the groff program and the later having devices, fonts and macros
900 # Checking for the groff executable is not enough.
901 #
902 # If macros are missing, we cannot assume that groff is useless, so we don't
903 # unset HAVE_GROFF or GROFF env variables.
904 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
905 #
906 AC_DEFUN([XORG_WITH_GROFF],[
907 AC_ARG_VAR([GROFF], [Path to groff command])
908 m4_define([_defopt], m4_default([$1], [auto]))
909 AC_ARG_WITH(groff,
910         AS_HELP_STRING([--with-groff],
911            [Use groff to regenerate documentation (default: ]_defopt[)]),
912            [use_groff=$withval], [use_groff=]_defopt)
913 m4_undefine([_defopt])
914
915 if test "x$use_groff" = x"auto"; then
916    AC_PATH_PROG([GROFF], [groff])
917    if test "x$GROFF" = "x"; then
918         AC_MSG_WARN([groff not found - documentation targets will be skipped])
919         have_groff=no
920    else
921         have_groff=yes
922    fi
923 elif test "x$use_groff" = x"yes" ; then
924    AC_PATH_PROG([GROFF], [groff])
925    if test "x$GROFF" = "x"; then
926         AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
927    fi
928    have_groff=yes
929 elif test "x$use_groff" = x"no" ; then
930    if test "x$GROFF" != "x"; then
931       AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
932    fi
933    have_groff=no
934 else
935    AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
936 fi
937
938 # We have groff, test for the presence of the macro packages
939 if test "x$have_groff" = x"yes"; then
940     AC_MSG_CHECKING([for ${GROFF} -ms macros])
941     if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
942         groff_ms_works=yes
943     else
944         groff_ms_works=no
945     fi
946     AC_MSG_RESULT([$groff_ms_works])
947     AC_MSG_CHECKING([for ${GROFF} -mm macros])
948     if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
949         groff_mm_works=yes
950     else
951         groff_mm_works=no
952     fi
953     AC_MSG_RESULT([$groff_mm_works])
954 fi
955
956 # We have groff, test for HTML dependencies, one command per package
957 if test "x$have_groff" = x"yes"; then
958    AC_PATH_PROGS(GS_PATH, [gs gswin32c])
959    AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
960    AC_PATH_PROG(PSSELECT_PATH, [psselect])
961    if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
962       have_groff_html=yes
963    else
964       have_groff_html=no
965       AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
966    fi
967 fi
968
969 # Set Automake conditionals for Makefiles
970 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
971 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
972 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
973 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
974 ]) # XORG_WITH_GROFF
975
976 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
977 # ---------------------------------------
978 # Minimum version: 1.6.0
979 # Minimum version for optional DEFAULT argument: 1.11.0
980 # Minimum version for optional MIN-VERSION argument: 1.15.0
981 #
982 # Documentation tools are not always available on all platforms and sometimes
983 # not at the appropriate level. This macro enables a module to test for the
984 # presence of the tool and obtain it's path in separate variables. Coupled with
985 # the --with-fop option, it allows maximum flexibilty in making decisions
986 # as whether or not to use the fop package. When DEFAULT is not specified,
987 # --with-fop assumes 'auto'.
988 #
989 # Interface to module:
990 # HAVE_FOP:     used in makefiles to conditionally generate documentation
991 # FOP:          returns the path of the fop program found
992 #               returns the path set by the user in the environment
993 # --with-fop:   'yes' user instructs the module to use fop
994 #               'no' user instructs the module not to use fop
995 #
996 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
997 #
998 AC_DEFUN([XORG_WITH_FOP],[
999 AC_ARG_VAR([FOP], [Path to fop command])
1000 m4_define([_defopt], m4_default([$2], [auto]))
1001 AC_ARG_WITH(fop,
1002         AS_HELP_STRING([--with-fop],
1003            [Use fop to regenerate documentation (default: ]_defopt[)]),
1004            [use_fop=$withval], [use_fop=]_defopt)
1005 m4_undefine([_defopt])
1006
1007 if test "x$use_fop" = x"auto"; then
1008    AC_PATH_PROG([FOP], [fop])
1009    if test "x$FOP" = "x"; then
1010         AC_MSG_WARN([fop not found - documentation targets will be skipped])
1011         have_fop=no
1012    else
1013         have_fop=yes
1014    fi
1015 elif test "x$use_fop" = x"yes" ; then
1016    AC_PATH_PROG([FOP], [fop])
1017    if test "x$FOP" = "x"; then
1018         AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1019    fi
1020    have_fop=yes
1021 elif test "x$use_fop" = x"no" ; then
1022    if test "x$FOP" != "x"; then
1023       AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1024    fi
1025    have_fop=no
1026 else
1027    AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1028 fi
1029
1030 # Test for a minimum version of fop, if provided.
1031 m4_ifval([$1],
1032 [if test "$have_fop" = yes; then
1033     # scrape the fop version
1034     AC_MSG_CHECKING([for fop minimum version])
1035     fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1036     AC_MSG_RESULT([$fop_version])
1037     AS_VERSION_COMPARE([$fop_version], [$1],
1038         [if test "x$use_fop" = xauto; then
1039             AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1040             have_fop=no
1041         else
1042             AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1043         fi])
1044 fi])
1045 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1046 ]) # XORG_WITH_FOP
1047
1048 # XORG_WITH_PS2PDF([DEFAULT])
1049 # ----------------
1050 # Minimum version: 1.6.0
1051 # Minimum version for optional DEFAULT argument: 1.11.0
1052 #
1053 # Documentation tools are not always available on all platforms and sometimes
1054 # not at the appropriate level. This macro enables a module to test for the
1055 # presence of the tool and obtain it's path in separate variables. Coupled with
1056 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1057 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1058 # --with-ps2pdf assumes 'auto'.
1059 #
1060 # Interface to module:
1061 # HAVE_PS2PDF:  used in makefiles to conditionally generate documentation
1062 # PS2PDF:       returns the path of the ps2pdf program found
1063 #               returns the path set by the user in the environment
1064 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1065 #                'no' user instructs the module not to use ps2pdf
1066 #
1067 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1068 #
1069 AC_DEFUN([XORG_WITH_PS2PDF],[
1070 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1071 m4_define([_defopt], m4_default([$1], [auto]))
1072 AC_ARG_WITH(ps2pdf,
1073         AS_HELP_STRING([--with-ps2pdf],
1074            [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1075            [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1076 m4_undefine([_defopt])
1077
1078 if test "x$use_ps2pdf" = x"auto"; then
1079    AC_PATH_PROG([PS2PDF], [ps2pdf])
1080    if test "x$PS2PDF" = "x"; then
1081         AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1082         have_ps2pdf=no
1083    else
1084         have_ps2pdf=yes
1085    fi
1086 elif test "x$use_ps2pdf" = x"yes" ; then
1087    AC_PATH_PROG([PS2PDF], [ps2pdf])
1088    if test "x$PS2PDF" = "x"; then
1089         AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1090    fi
1091    have_ps2pdf=yes
1092 elif test "x$use_ps2pdf" = x"no" ; then
1093    if test "x$PS2PDF" != "x"; then
1094       AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1095    fi
1096    have_ps2pdf=no
1097 else
1098    AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1099 fi
1100 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1101 ]) # XORG_WITH_PS2PDF
1102
1103 # XORG_ENABLE_DOCS (enable_docs=yes)
1104 # ----------------
1105 # Minimum version: 1.6.0
1106 #
1107 # Documentation tools are not always available on all platforms and sometimes
1108 # not at the appropriate level. This macro enables a builder to skip all
1109 # documentation targets except traditional man pages.
1110 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1111 # maximum flexibilty in controlling documentation building.
1112 # Refer to:
1113 # XORG_WITH_XMLTO         --with-xmlto
1114 # XORG_WITH_ASCIIDOC      --with-asciidoc
1115 # XORG_WITH_DOXYGEN       --with-doxygen
1116 # XORG_WITH_FOP           --with-fop
1117 # XORG_WITH_GROFF         --with-groff
1118 # XORG_WITH_PS2PDF        --with-ps2pdf
1119 #
1120 # Interface to module:
1121 # ENABLE_DOCS:    used in makefiles to conditionally generate documentation
1122 # --enable-docs: 'yes' user instructs the module to generate docs
1123 #                'no' user instructs the module not to generate docs
1124 # parm1:        specify the default value, yes or no.
1125 #
1126 AC_DEFUN([XORG_ENABLE_DOCS],[
1127 m4_define([docs_default], m4_default([$1], [yes]))
1128 AC_ARG_ENABLE(docs,
1129         AS_HELP_STRING([--enable-docs],
1130            [Enable building the documentation (default: ]docs_default[)]),
1131            [build_docs=$enableval], [build_docs=]docs_default)
1132 m4_undefine([docs_default])
1133 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1134 AC_MSG_CHECKING([whether to build documentation])
1135 AC_MSG_RESULT([$build_docs])
1136 ]) # XORG_ENABLE_DOCS
1137
1138 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1139 # ----------------
1140 # Minimum version: 1.6.0
1141 #
1142 # This macro enables a builder to skip all developer documentation.
1143 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1144 # maximum flexibilty in controlling documentation building.
1145 # Refer to:
1146 # XORG_WITH_XMLTO         --with-xmlto
1147 # XORG_WITH_ASCIIDOC      --with-asciidoc
1148 # XORG_WITH_DOXYGEN       --with-doxygen
1149 # XORG_WITH_FOP           --with-fop
1150 # XORG_WITH_GROFF         --with-groff
1151 # XORG_WITH_PS2PDF        --with-ps2pdf
1152 #
1153 # Interface to module:
1154 # ENABLE_DEVEL_DOCS:    used in makefiles to conditionally generate developer docs
1155 # --enable-devel-docs:  'yes' user instructs the module to generate developer docs
1156 #                       'no' user instructs the module not to generate developer docs
1157 # parm1:                specify the default value, yes or no.
1158 #
1159 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1160 m4_define([devel_default], m4_default([$1], [yes]))
1161 AC_ARG_ENABLE(devel-docs,
1162         AS_HELP_STRING([--enable-devel-docs],
1163            [Enable building the developer documentation (default: ]devel_default[)]),
1164            [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1165 m4_undefine([devel_default])
1166 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1167 AC_MSG_CHECKING([whether to build developer documentation])
1168 AC_MSG_RESULT([$build_devel_docs])
1169 ]) # XORG_ENABLE_DEVEL_DOCS
1170
1171 # XORG_ENABLE_SPECS (enable_specs=yes)
1172 # ----------------
1173 # Minimum version: 1.6.0
1174 #
1175 # This macro enables a builder to skip all functional specification targets.
1176 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1177 # maximum flexibilty in controlling documentation building.
1178 # Refer to:
1179 # XORG_WITH_XMLTO         --with-xmlto
1180 # XORG_WITH_ASCIIDOC      --with-asciidoc
1181 # XORG_WITH_DOXYGEN       --with-doxygen
1182 # XORG_WITH_FOP           --with-fop
1183 # XORG_WITH_GROFF         --with-groff
1184 # XORG_WITH_PS2PDF        --with-ps2pdf
1185 #
1186 # Interface to module:
1187 # ENABLE_SPECS:         used in makefiles to conditionally generate specs
1188 # --enable-specs:       'yes' user instructs the module to generate specs
1189 #                       'no' user instructs the module not to generate specs
1190 # parm1:                specify the default value, yes or no.
1191 #
1192 AC_DEFUN([XORG_ENABLE_SPECS],[
1193 m4_define([spec_default], m4_default([$1], [yes]))
1194 AC_ARG_ENABLE(specs,
1195         AS_HELP_STRING([--enable-specs],
1196            [Enable building the specs (default: ]spec_default[)]),
1197            [build_specs=$enableval], [build_specs=]spec_default)
1198 m4_undefine([spec_default])
1199 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1200 AC_MSG_CHECKING([whether to build functional specifications])
1201 AC_MSG_RESULT([$build_specs])
1202 ]) # XORG_ENABLE_SPECS
1203
1204 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1205 # ----------------------------------------------
1206 # Minimum version: 1.13.0
1207 #
1208 # This macro enables a builder to enable/disable unit testing
1209 # It makes no assumption about the test cases implementation
1210 # Test cases may or may not use Automake "Support for test suites"
1211 # They may or may not use the software utility library GLib
1212 #
1213 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1214 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1215 # The variable enable_unit_tests is used by other macros in this file.
1216 #
1217 # Interface to module:
1218 # ENABLE_UNIT_TESTS:    used in makefiles to conditionally build tests
1219 # enable_unit_tests:    used in configure.ac for additional configuration
1220 # --enable-unit-tests:  'yes' user instructs the module to build tests
1221 #                       'no' user instructs the module not to build tests
1222 # parm1:                specify the default value, yes or no.
1223 #
1224 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1225 AC_BEFORE([$0], [XORG_WITH_GLIB])
1226 AC_BEFORE([$0], [XORG_LD_WRAP])
1227 m4_define([_defopt], m4_default([$1], [auto]))
1228 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1229         [Enable building unit test cases (default: ]_defopt[)]),
1230         [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1231 m4_undefine([_defopt])
1232 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1233 AC_MSG_CHECKING([whether to build unit test cases])
1234 AC_MSG_RESULT([$enable_unit_tests])
1235 ]) # XORG_ENABLE_UNIT_TESTS
1236
1237 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1238 # ----------------------------------------
1239 # Minimum version: 1.13.0
1240 #
1241 # GLib is a library which provides advanced data structures and functions.
1242 # This macro enables a module to test for the presence of Glib.
1243 #
1244 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1245 # Otherwise the value of $enable_unit_tests is blank.
1246 #
1247 # Interface to module:
1248 # HAVE_GLIB: used in makefiles to conditionally build targets
1249 # with_glib: used in configure.ac to know if GLib has been found
1250 # --with-glib:  'yes' user instructs the module to use glib
1251 #               'no' user instructs the module not to use glib
1252 #
1253 AC_DEFUN([XORG_WITH_GLIB],[
1254 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1255 m4_define([_defopt], m4_default([$2], [auto]))
1256 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1257         [Use GLib library for unit testing (default: ]_defopt[)]),
1258         [with_glib=$withval], [with_glib=]_defopt)
1259 m4_undefine([_defopt])
1260
1261 have_glib=no
1262 # Do not probe GLib if user explicitly disabled unit testing
1263 if test "x$enable_unit_tests" != x"no"; then
1264   # Do not probe GLib if user explicitly disabled it
1265   if test "x$with_glib" != x"no"; then
1266     m4_ifval(
1267       [$1],
1268       [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1269       [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1270     )
1271   fi
1272 fi
1273
1274 # Not having GLib when unit testing has been explicitly requested is an error
1275 if test "x$enable_unit_tests" = x"yes"; then
1276   if test "x$have_glib" = x"no"; then
1277     AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1278   fi
1279 fi
1280
1281 # Having unit testing disabled when GLib has been explicitly requested is an error
1282 if test "x$enable_unit_tests" = x"no"; then
1283   if test "x$with_glib" = x"yes"; then
1284     AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1285   fi
1286 fi
1287
1288 # Not having GLib when it has been explicitly requested is an error
1289 if test "x$with_glib" = x"yes"; then
1290   if test "x$have_glib" = x"no"; then
1291     AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1292   fi
1293 fi
1294
1295 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1296 ]) # XORG_WITH_GLIB
1297
1298 # XORG_LD_WRAP
1299 # ------------
1300 # Minimum version: 1.13.0
1301 #
1302 # Check if linker supports -wrap, passed via compiler flags
1303 #
1304 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1305 # Otherwise the value of $enable_unit_tests is blank.
1306 #
1307 AC_DEFUN([XORG_LD_WRAP],[
1308 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
1309 # Not having ld wrap when unit testing has been explicitly requested is an error
1310 if test "x$enable_unit_tests" = x"yes"; then
1311   if test "x$have_ld_wrap" = x"no"; then
1312     AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1313   fi
1314 fi
1315 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1316 #
1317 ]) # XORG_LD_WRAP
1318
1319 # XORG_CHECK_LINKER_FLAGS
1320 # -----------------------
1321 # SYNOPSIS
1322 #
1323 #   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
1324 #
1325 # DESCRIPTION
1326 #
1327 #   Check whether the given linker FLAGS work with the current language's
1328 #   linker, or whether they give an error.
1329 #
1330 #   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1331 #   success/failure.
1332 #
1333 #   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1334 #
1335 # LICENSE
1336 #
1337 #   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1338 #   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1339 #   Copyright (c) 2009 Matteo Frigo
1340 #
1341 #   This program is free software: you can redistribute it and/or modify it
1342 #   under the terms of the GNU General Public License as published by the
1343 #   Free Software Foundation, either version 3 of the License, or (at your
1344 #   option) any later version.
1345 #
1346 #   This program is distributed in the hope that it will be useful, but
1347 #   WITHOUT ANY WARRANTY; without even the implied warranty of
1348 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1349 #   Public License for more details.
1350 #
1351 #   You should have received a copy of the GNU General Public License along
1352 #   with this program. If not, see <http://www.gnu.org/licenses/>.
1353 #
1354 #   As a special exception, the respective Autoconf Macro's copyright owner
1355 #   gives unlimited permission to copy, distribute and modify the configure
1356 #   scripts that are the output of Autoconf when processing the Macro. You
1357 #   need not follow the terms of the GNU General Public License when using
1358 #   or distributing such scripts, even though portions of the text of the
1359 #   Macro appear in them. The GNU General Public License (GPL) does govern
1360 #   all other use of the material that constitutes the Autoconf Macro.
1361 #
1362 #   This special exception to the GPL applies to versions of the Autoconf
1363 #   Macro released by the Autoconf Archive. When you make and distribute a
1364 #   modified version of the Autoconf Macro, you may extend this special
1365 #   exception to the GPL to apply to your modified version as well.#
1366 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1367 [AC_MSG_CHECKING([whether the linker accepts $1])
1368 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1369 AS_LITERAL_IF([$1],
1370   [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1371       ax_save_FLAGS=$LDFLAGS
1372       LDFLAGS="$1"
1373       AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1374         AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1375         AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1376       LDFLAGS=$ax_save_FLAGS])],
1377   [ax_save_FLAGS=$LDFLAGS
1378    LDFLAGS="$1"
1379    AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1380      eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1381      eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1382    LDFLAGS=$ax_save_FLAGS])
1383 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1384 AC_MSG_RESULT($xorg_check_linker_flags)
1385 if test "x$xorg_check_linker_flags" = xyes; then
1386         m4_default([$2], :)
1387 else
1388         m4_default([$3], :)
1389 fi
1390 ]) # XORG_CHECK_LINKER_FLAGS
1391
1392 # XORG_CHECK_MALLOC_ZERO
1393 # ----------------------
1394 # Minimum version: 1.0.0
1395 #
1396 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1397 # malloc(0) returns NULL.  Packages should add one of these cflags to
1398 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1399 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1400 AC_ARG_ENABLE(malloc0returnsnull,
1401         AS_HELP_STRING([--enable-malloc0returnsnull],
1402                        [malloc(0) returns NULL (default: auto)]),
1403         [MALLOC_ZERO_RETURNS_NULL=$enableval],
1404         [MALLOC_ZERO_RETURNS_NULL=auto])
1405
1406 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1407 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1408         AC_RUN_IFELSE([AC_LANG_PROGRAM([
1409 #include <stdlib.h>
1410 ],[
1411     char *m0, *r0, *c0, *p;
1412     m0 = malloc(0);
1413     p = malloc(10);
1414     r0 = realloc(p,0);
1415     c0 = calloc(0,10);
1416     exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1417 ])],
1418                 [MALLOC_ZERO_RETURNS_NULL=yes],
1419                 [MALLOC_ZERO_RETURNS_NULL=no],
1420                 [MALLOC_ZERO_RETURNS_NULL=yes])
1421 fi
1422 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1423
1424 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1425         MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1426         XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1427         XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1428 else
1429         MALLOC_ZERO_CFLAGS=""
1430         XMALLOC_ZERO_CFLAGS=""
1431         XTMALLOC_ZERO_CFLAGS=""
1432 fi
1433
1434 AC_SUBST([MALLOC_ZERO_CFLAGS])
1435 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1436 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1437 ]) # XORG_CHECK_MALLOC_ZERO
1438
1439 # XORG_WITH_LINT()
1440 # ----------------
1441 # Minimum version: 1.1.0
1442 #
1443 # This macro enables the use of a tool that flags some suspicious and
1444 # non-portable constructs (likely to be bugs) in C language source code.
1445 # It will attempt to locate the tool and use appropriate options.
1446 # There are various lint type tools on different platforms.
1447 #
1448 # Interface to module:
1449 # LINT:         returns the path to the tool found on the platform
1450 #               or the value set to LINT on the configure cmd line
1451 #               also an Automake conditional
1452 # LINT_FLAGS:   an Automake variable with appropriate flags
1453 #
1454 # --with-lint:  'yes' user instructs the module to use lint
1455 #               'no' user instructs the module not to use lint (default)
1456 #
1457 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1458 # If the user sets the value of LINT_FLAGS, they are used verbatim.
1459 #
1460 AC_DEFUN([XORG_WITH_LINT],[
1461
1462 AC_ARG_VAR([LINT], [Path to a lint-style command])
1463 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1464 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1465                 [Use a lint-style source code checker (default: disabled)])],
1466                 [use_lint=$withval], [use_lint=no])
1467
1468 # Obtain platform specific info like program name and options
1469 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
1470 case $host_os in
1471   *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1472         lint_name=splint
1473         lint_options="-badflag"
1474         ;;
1475   *freebsd* | *netbsd*)
1476         lint_name=lint
1477         lint_options="-u -b"
1478         ;;
1479   *solaris*)
1480         lint_name=lint
1481         lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1482         ;;
1483 esac
1484
1485 # Test for the presence of the program (either guessed by the code or spelled out by the user)
1486 if test "x$use_lint" = x"yes" ; then
1487    AC_PATH_PROG([LINT], [$lint_name])
1488    if test "x$LINT" = "x"; then
1489         AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1490    fi
1491 elif test "x$use_lint" = x"no" ; then
1492    if test "x$LINT" != "x"; then
1493       AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1494    fi
1495 else
1496    AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1497 fi
1498
1499 # User supplied flags override default flags
1500 if test "x$LINT_FLAGS" != "x"; then
1501    lint_options=$LINT_FLAGS
1502 fi
1503
1504 AC_SUBST([LINT_FLAGS],[$lint_options])
1505 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1506
1507 ]) # XORG_WITH_LINT
1508
1509 # XORG_LINT_LIBRARY(LIBNAME)
1510 # --------------------------
1511 # Minimum version: 1.1.0
1512 #
1513 # Sets up flags for building lint libraries for checking programs that call
1514 # functions in the library.
1515 #
1516 # Interface to module:
1517 # LINTLIB               - Automake variable with the name of lint library file to make
1518 # MAKE_LINT_LIB         - Automake conditional
1519 #
1520 # --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1521 #                         - 'no' user instructs the module not to create a lint library (default)
1522
1523 AC_DEFUN([XORG_LINT_LIBRARY],[
1524 AC_REQUIRE([XORG_WITH_LINT])
1525 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1526         [Create lint library (default: disabled)])],
1527         [make_lint_lib=$enableval], [make_lint_lib=no])
1528
1529 if test "x$make_lint_lib" = x"yes" ; then
1530    LINTLIB=llib-l$1.ln
1531    if test "x$LINT" = "x"; then
1532         AC_MSG_ERROR([Cannot make lint library without --with-lint])
1533    fi
1534 elif test "x$make_lint_lib" != x"no" ; then
1535    AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1536 fi
1537
1538 AC_SUBST(LINTLIB)
1539 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1540
1541 ]) # XORG_LINT_LIBRARY
1542
1543 # XORG_COMPILER_BRAND
1544 # -------------------
1545 # Minimum version: 1.14.0
1546 #
1547 # Checks for various brands of compilers and sets flags as appropriate:
1548 #   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1549 #   clang compiler - sets CLANGCC to "yes"
1550 #   Intel compiler - sets INTELCC to "yes"
1551 #   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1552 #
1553 AC_DEFUN([XORG_COMPILER_BRAND], [
1554 AC_REQUIRE([AC_PROG_CC_C99])
1555 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1556 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1557 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1558 ]) # XORG_COMPILER_BRAND
1559
1560 # XORG_CWARNFLAGS
1561 # ---------------
1562 # Minimum version: 1.2.0
1563 #
1564 # Defines CWARNFLAGS to enable C compiler warnings.
1565 #
1566 AC_DEFUN([XORG_CWARNFLAGS], [
1567 AC_REQUIRE([AC_PROG_CC_C99])
1568 AC_REQUIRE([XORG_COMPILER_BRAND])
1569 if  test "x$GCC" = xyes ; then
1570     CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1571 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1572 -Wbad-function-cast -Wformat=2"
1573     case `$CC -dumpversion` in
1574     3.4.* | 4.*)
1575         CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1576         ;;
1577     esac
1578 else
1579     if test "x$SUNCC" = "xyes"; then
1580         CWARNFLAGS="-v"
1581     fi
1582 fi
1583 AC_SUBST(CWARNFLAGS)
1584 ]) # XORG_CWARNFLAGS
1585
1586 # XORG_STRICT_OPTION
1587 # -----------------------
1588 # Minimum version: 1.3.0
1589 #
1590 # Add configure option to enable strict compilation flags, such as treating
1591 # warnings as fatal errors.
1592 # If --enable-strict-compilation is passed to configure, adds strict flags to
1593 # $CWARNFLAGS.
1594 #
1595 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1596 # when strict compilation is unconditionally desired.
1597 AC_DEFUN([XORG_STRICT_OPTION], [
1598 # If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1599 AC_REQUIRE([AC_PROG_CC_C99])
1600 AC_REQUIRE([XORG_COMPILER_BRAND])
1601 AC_REQUIRE([XORG_CWARNFLAGS])
1602
1603 AC_ARG_ENABLE(strict-compilation,
1604                           AS_HELP_STRING([--enable-strict-compilation],
1605                           [Enable all warnings from compiler and make them errors (default: disabled)]),
1606                           [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1607 if test "x$GCC" = xyes ; then
1608     STRICT_CFLAGS="-pedantic -Werror"
1609     # Add -Werror=attributes if supported (gcc 4.2 & later)
1610     AC_MSG_CHECKING([if $CC supports -Werror=attributes])
1611     save_CFLAGS="$CFLAGS"
1612     CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
1613     AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
1614                       [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
1615                        AC_MSG_RESULT([yes])],
1616                       [AC_MSG_RESULT([no])])
1617     CFLAGS="$save_CFLAGS"
1618 elif test "x$SUNCC" = "xyes"; then
1619     STRICT_CFLAGS="-errwarn"
1620 elif test "x$INTELCC" = "xyes"; then
1621     STRICT_CFLAGS="-Werror"
1622 fi
1623 if test "x$STRICT_COMPILE" = "xyes"; then
1624     CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1625 fi
1626 AC_SUBST([STRICT_CFLAGS])
1627 AC_SUBST([CWARNFLAGS])
1628 ]) # XORG_STRICT_OPTION
1629
1630 # XORG_DEFAULT_OPTIONS
1631 # --------------------
1632 # Minimum version: 1.3.0
1633 #
1634 # Defines default options for X.Org modules.
1635 #
1636 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1637 AC_REQUIRE([AC_PROG_INSTALL])
1638 XORG_CWARNFLAGS
1639 XORG_STRICT_OPTION
1640 XORG_RELEASE_VERSION
1641 XORG_CHANGELOG
1642 XORG_INSTALL
1643 XORG_MANPAGE_SECTIONS
1644 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1645     [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1646 ]) # XORG_DEFAULT_OPTIONS
1647
1648 # XORG_INSTALL()
1649 # ----------------
1650 # Minimum version: 1.4.0
1651 #
1652 # Defines the variable INSTALL_CMD as the command to copy
1653 # INSTALL from $prefix/share/util-macros.
1654 #
1655 AC_DEFUN([XORG_INSTALL], [
1656 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1657 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1658 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1659 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1660 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1661 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1662 AC_SUBST([INSTALL_CMD])
1663 ]) # XORG_INSTALL
1664 dnl Copyright 2005 Red Hat, Inc
1665 dnl
1666 dnl Permission to use, copy, modify, distribute, and sell this software and its
1667 dnl documentation for any purpose is hereby granted without fee, provided that
1668 dnl the above copyright notice appear in all copies and that both that
1669 dnl copyright notice and this permission notice appear in supporting
1670 dnl documentation.
1671 dnl
1672 dnl The above copyright notice and this permission notice shall be included
1673 dnl in all copies or substantial portions of the Software.
1674 dnl
1675 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1676 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1677 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1678 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1679 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1680 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1681 dnl OTHER DEALINGS IN THE SOFTWARE.
1682 dnl
1683 dnl Except as contained in this notice, the name of the copyright holders shall
1684 dnl not be used in advertising or otherwise to promote the sale, use or
1685 dnl other dealings in this Software without prior written authorization
1686 dnl from the copyright holders.
1687 dnl
1688
1689 # XORG_RELEASE_VERSION
1690 # --------------------
1691 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1692  
1693 AC_DEFUN([XORG_RELEASE_VERSION],[
1694         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1695                 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1696                 [Major version of this package])
1697         PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1698         if test "x$PVM" = "x"; then
1699                 PVM="0"
1700         fi
1701         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1702                 [$PVM],
1703                 [Minor version of this package])
1704         PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1705         if test "x$PVP" = "x"; then
1706                 PVP="0"
1707         fi
1708         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1709                 [$PVP],
1710                 [Patch version of this package])
1711 ])
1712
1713 # XORG_CHANGELOG()
1714 # ----------------
1715 # Minimum version: 1.2.0
1716 #
1717 # Defines the variable CHANGELOG_CMD as the command to generate
1718 # ChangeLog from git.
1719 #
1720 #
1721 AC_DEFUN([XORG_CHANGELOG], [
1722 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1723 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1724 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1725 echo 'git directory not found: installing possibly empty changelog.' >&2)"
1726 AC_SUBST([CHANGELOG_CMD])
1727 ]) # XORG_CHANGELOG
1728
1729 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1730 #
1731 # This file is free software; the Free Software Foundation
1732 # gives unlimited permission to copy and/or distribute it,
1733 # with or without modifications, as long as this notice is preserved.
1734
1735 # AM_AUTOMAKE_VERSION(VERSION)
1736 # ----------------------------
1737 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1738 # generated from the m4 files accompanying Automake X.Y.
1739 # (This private macro should not be called outside this file.)
1740 AC_DEFUN([AM_AUTOMAKE_VERSION],
1741 [am__api_version='1.11'
1742 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1743 dnl require some minimum version.  Point them to the right macro.
1744 m4_if([$1], [1.11.1], [],
1745       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1746 ])
1747
1748 # _AM_AUTOCONF_VERSION(VERSION)
1749 # -----------------------------
1750 # aclocal traces this macro to find the Autoconf version.
1751 # This is a private macro too.  Using m4_define simplifies
1752 # the logic in aclocal, which can simply ignore this definition.
1753 m4_define([_AM_AUTOCONF_VERSION], [])
1754
1755 # AM_SET_CURRENT_AUTOMAKE_VERSION
1756 # -------------------------------
1757 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1758 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1759 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1760 [AM_AUTOMAKE_VERSION([1.11.1])dnl
1761 m4_ifndef([AC_AUTOCONF_VERSION],
1762   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1763 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1764
1765 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1766
1767 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1768 #
1769 # This file is free software; the Free Software Foundation
1770 # gives unlimited permission to copy and/or distribute it,
1771 # with or without modifications, as long as this notice is preserved.
1772
1773 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1774 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1775 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1776 #
1777 # Of course, Automake must honor this variable whenever it calls a
1778 # tool from the auxiliary directory.  The problem is that $srcdir (and
1779 # therefore $ac_aux_dir as well) can be either absolute or relative,
1780 # depending on how configure is run.  This is pretty annoying, since
1781 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1782 # source directory, any form will work fine, but in subdirectories a
1783 # relative path needs to be adjusted first.
1784 #
1785 # $ac_aux_dir/missing
1786 #    fails when called from a subdirectory if $ac_aux_dir is relative
1787 # $top_srcdir/$ac_aux_dir/missing
1788 #    fails if $ac_aux_dir is absolute,
1789 #    fails when called from a subdirectory in a VPATH build with
1790 #          a relative $ac_aux_dir
1791 #
1792 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1793 # are both prefixed by $srcdir.  In an in-source build this is usually
1794 # harmless because $srcdir is `.', but things will broke when you
1795 # start a VPATH build or use an absolute $srcdir.
1796 #
1797 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1798 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1799 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1800 # and then we would define $MISSING as
1801 #   MISSING="\${SHELL} $am_aux_dir/missing"
1802 # This will work as long as MISSING is not called from configure, because
1803 # unfortunately $(top_srcdir) has no meaning in configure.
1804 # However there are other variables, like CC, which are often used in
1805 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1806 #
1807 # Another solution, used here, is to always expand $ac_aux_dir to an
1808 # absolute PATH.  The drawback is that using absolute paths prevent a
1809 # configured tree to be moved without reconfiguration.
1810
1811 AC_DEFUN([AM_AUX_DIR_EXPAND],
1812 [dnl Rely on autoconf to set up CDPATH properly.
1813 AC_PREREQ([2.50])dnl
1814 # expand $ac_aux_dir to an absolute path
1815 am_aux_dir=`cd $ac_aux_dir && pwd`
1816 ])
1817
1818 # AM_CONDITIONAL                                            -*- Autoconf -*-
1819
1820 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1821 # Free Software Foundation, Inc.
1822 #
1823 # This file is free software; the Free Software Foundation
1824 # gives unlimited permission to copy and/or distribute it,
1825 # with or without modifications, as long as this notice is preserved.
1826
1827 # serial 9
1828
1829 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1830 # -------------------------------------
1831 # Define a conditional.
1832 AC_DEFUN([AM_CONDITIONAL],
1833 [AC_PREREQ(2.52)dnl
1834  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1835         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1836 AC_SUBST([$1_TRUE])dnl
1837 AC_SUBST([$1_FALSE])dnl
1838 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1839 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1840 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1841 if $2; then
1842   $1_TRUE=
1843   $1_FALSE='#'
1844 else
1845   $1_TRUE='#'
1846   $1_FALSE=
1847 fi
1848 AC_CONFIG_COMMANDS_PRE(
1849 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1850   AC_MSG_ERROR([[conditional "$1" was never defined.
1851 Usually this means the macro was only invoked conditionally.]])
1852 fi])])
1853
1854 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1855 # Free Software Foundation, Inc.
1856 #
1857 # This file is free software; the Free Software Foundation
1858 # gives unlimited permission to copy and/or distribute it,
1859 # with or without modifications, as long as this notice is preserved.
1860
1861 # serial 10
1862
1863 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1864 # written in clear, in which case automake, when reading aclocal.m4,
1865 # will think it sees a *use*, and therefore will trigger all it's
1866 # C support machinery.  Also note that it means that autoscan, seeing
1867 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1868
1869
1870 # _AM_DEPENDENCIES(NAME)
1871 # ----------------------
1872 # See how the compiler implements dependency checking.
1873 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1874 # We try a few techniques and use that to set a single cache variable.
1875 #
1876 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1877 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1878 # dependency, and given that the user is not expected to run this macro,
1879 # just rely on AC_PROG_CC.
1880 AC_DEFUN([_AM_DEPENDENCIES],
1881 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1882 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1883 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1884 AC_REQUIRE([AM_DEP_TRACK])dnl
1885
1886 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1887        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1888        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1889        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1890        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1891                    [depcc="$$1"   am_compiler_list=])
1892
1893 AC_CACHE_CHECK([dependency style of $depcc],
1894                [am_cv_$1_dependencies_compiler_type],
1895 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1896   # We make a subdir and do the tests there.  Otherwise we can end up
1897   # making bogus files that we don't know about and never remove.  For
1898   # instance it was reported that on HP-UX the gcc test will end up
1899   # making a dummy file named `D' -- because `-MD' means `put the output
1900   # in D'.
1901   mkdir conftest.dir
1902   # Copy depcomp to subdir because otherwise we won't find it if we're
1903   # using a relative directory.
1904   cp "$am_depcomp" conftest.dir
1905   cd conftest.dir
1906   # We will build objects and dependencies in a subdirectory because
1907   # it helps to detect inapplicable dependency modes.  For instance
1908   # both Tru64's cc and ICC support -MD to output dependencies as a
1909   # side effect of compilation, but ICC will put the dependencies in
1910   # the current directory while Tru64 will put them in the object
1911   # directory.
1912   mkdir sub
1913
1914   am_cv_$1_dependencies_compiler_type=none
1915   if test "$am_compiler_list" = ""; then
1916      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1917   fi
1918   am__universal=false
1919   m4_case([$1], [CC],
1920     [case " $depcc " in #(
1921      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1922      esac],
1923     [CXX],
1924     [case " $depcc " in #(
1925      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1926      esac])
1927
1928   for depmode in $am_compiler_list; do
1929     # Setup a source with many dependencies, because some compilers
1930     # like to wrap large dependency lists on column 80 (with \), and
1931     # we should not choose a depcomp mode which is confused by this.
1932     #
1933     # We need to recreate these files for each test, as the compiler may
1934     # overwrite some of them when testing with obscure command lines.
1935     # This happens at least with the AIX C compiler.
1936     : > sub/conftest.c
1937     for i in 1 2 3 4 5 6; do
1938       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1939       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1940       # Solaris 8's {/usr,}/bin/sh.
1941       touch sub/conftst$i.h
1942     done
1943     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1944
1945     # We check with `-c' and `-o' for the sake of the "dashmstdout"
1946     # mode.  It turns out that the SunPro C++ compiler does not properly
1947     # handle `-M -o', and we need to detect this.  Also, some Intel
1948     # versions had trouble with output in subdirs
1949     am__obj=sub/conftest.${OBJEXT-o}
1950     am__minus_obj="-o $am__obj"
1951     case $depmode in
1952     gcc)
1953       # This depmode causes a compiler race in universal mode.
1954       test "$am__universal" = false || continue
1955       ;;
1956     nosideeffect)
1957       # after this tag, mechanisms are not by side-effect, so they'll
1958       # only be used when explicitly requested
1959       if test "x$enable_dependency_tracking" = xyes; then
1960         continue
1961       else
1962         break
1963       fi
1964       ;;
1965     msvisualcpp | msvcmsys)
1966       # This compiler won't grok `-c -o', but also, the minuso test has
1967       # not run yet.  These depmodes are late enough in the game, and
1968       # so weak that their functioning should not be impacted.
1969       am__obj=conftest.${OBJEXT-o}
1970       am__minus_obj=
1971       ;;
1972     none) break ;;
1973     esac
1974     if depmode=$depmode \
1975        source=sub/conftest.c object=$am__obj \
1976        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1977        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1978          >/dev/null 2>conftest.err &&
1979        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1980        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1981        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1982        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1983       # icc doesn't choke on unknown options, it will just issue warnings
1984       # or remarks (even with -Werror).  So we grep stderr for any message
1985       # that says an option was ignored or not supported.
1986       # When given -MP, icc 7.0 and 7.1 complain thusly:
1987       #   icc: Command line warning: ignoring option '-M'; no argument required
1988       # The diagnosis changed in icc 8.0:
1989       #   icc: Command line remark: option '-MP' not supported
1990       if (grep 'ignoring option' conftest.err ||
1991           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1992         am_cv_$1_dependencies_compiler_type=$depmode
1993         break
1994       fi
1995     fi
1996   done
1997
1998   cd ..
1999   rm -rf conftest.dir
2000 else
2001   am_cv_$1_dependencies_compiler_type=none
2002 fi
2003 ])
2004 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2005 AM_CONDITIONAL([am__fastdep$1], [
2006   test "x$enable_dependency_tracking" != xno \
2007   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2008 ])
2009
2010
2011 # AM_SET_DEPDIR
2012 # -------------
2013 # Choose a directory name for dependency files.
2014 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
2015 AC_DEFUN([AM_SET_DEPDIR],
2016 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2017 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2018 ])
2019
2020
2021 # AM_DEP_TRACK
2022 # ------------
2023 AC_DEFUN([AM_DEP_TRACK],
2024 [AC_ARG_ENABLE(dependency-tracking,
2025 [  --disable-dependency-tracking  speeds up one-time build
2026   --enable-dependency-tracking   do not reject slow dependency extractors])
2027 if test "x$enable_dependency_tracking" != xno; then
2028   am_depcomp="$ac_aux_dir/depcomp"
2029   AMDEPBACKSLASH='\'
2030 fi
2031 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2032 AC_SUBST([AMDEPBACKSLASH])dnl
2033 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2034 ])
2035
2036 # Generate code to set up dependency tracking.              -*- Autoconf -*-
2037
2038 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2039 # Free Software Foundation, Inc.
2040 #
2041 # This file is free software; the Free Software Foundation
2042 # gives unlimited permission to copy and/or distribute it,
2043 # with or without modifications, as long as this notice is preserved.
2044
2045 #serial 5
2046
2047 # _AM_OUTPUT_DEPENDENCY_COMMANDS
2048 # ------------------------------
2049 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2050 [{
2051   # Autoconf 2.62 quotes --file arguments for eval, but not when files
2052   # are listed without --file.  Let's play safe and only enable the eval
2053   # if we detect the quoting.
2054   case $CONFIG_FILES in
2055   *\'*) eval set x "$CONFIG_FILES" ;;
2056   *)   set x $CONFIG_FILES ;;
2057   esac
2058   shift
2059   for mf
2060   do
2061     # Strip MF so we end up with the name of the file.
2062     mf=`echo "$mf" | sed -e 's/:.*$//'`
2063     # Check whether this is an Automake generated Makefile or not.
2064     # We used to match only the files named `Makefile.in', but
2065     # some people rename them; so instead we look at the file content.
2066     # Grep'ing the first line is not enough: some people post-process
2067     # each Makefile.in and add a new line on top of each file to say so.
2068     # Grep'ing the whole file is not good either: AIX grep has a line
2069     # limit of 2048, but all sed's we know have understand at least 4000.
2070     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2071       dirpart=`AS_DIRNAME("$mf")`
2072     else
2073       continue
2074     fi
2075     # Extract the definition of DEPDIR, am__include, and am__quote
2076     # from the Makefile without running `make'.
2077     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2078     test -z "$DEPDIR" && continue
2079     am__include=`sed -n 's/^am__include = //p' < "$mf"`
2080     test -z "am__include" && continue
2081     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2082     # When using ansi2knr, U may be empty or an underscore; expand it
2083     U=`sed -n 's/^U = //p' < "$mf"`
2084     # Find all dependency output files, they are included files with
2085     # $(DEPDIR) in their names.  We invoke sed twice because it is the
2086     # simplest approach to changing $(DEPDIR) to its actual value in the
2087     # expansion.
2088     for file in `sed -n "
2089       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2090          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2091       # Make sure the directory exists.
2092       test -f "$dirpart/$file" && continue
2093       fdir=`AS_DIRNAME(["$file"])`
2094       AS_MKDIR_P([$dirpart/$fdir])
2095       # echo "creating $dirpart/$file"
2096       echo '# dummy' > "$dirpart/$file"
2097     done
2098   done
2099 }
2100 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2101
2102
2103 # AM_OUTPUT_DEPENDENCY_COMMANDS
2104 # -----------------------------
2105 # This macro should only be invoked once -- use via AC_REQUIRE.
2106 #
2107 # This code is only required when automatic dependency tracking
2108 # is enabled.  FIXME.  This creates each `.P' file that we will
2109 # need in order to bootstrap the dependency handling code.
2110 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2111 [AC_CONFIG_COMMANDS([depfiles],
2112      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2113      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2114 ])
2115
2116 # Do all the work for Automake.                             -*- Autoconf -*-
2117
2118 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2119 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
2120 #
2121 # This file is free software; the Free Software Foundation
2122 # gives unlimited permission to copy and/or distribute it,
2123 # with or without modifications, as long as this notice is preserved.
2124
2125 # serial 16
2126
2127 # This macro actually does too much.  Some checks are only needed if
2128 # your package does certain things.  But this isn't really a big deal.
2129
2130 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2131 # AM_INIT_AUTOMAKE([OPTIONS])
2132 # -----------------------------------------------
2133 # The call with PACKAGE and VERSION arguments is the old style
2134 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
2135 # and VERSION should now be passed to AC_INIT and removed from
2136 # the call to AM_INIT_AUTOMAKE.
2137 # We support both call styles for the transition.  After
2138 # the next Automake release, Autoconf can make the AC_INIT
2139 # arguments mandatory, and then we can depend on a new Autoconf
2140 # release and drop the old call support.
2141 AC_DEFUN([AM_INIT_AUTOMAKE],
2142 [AC_PREREQ([2.62])dnl
2143 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
2144 dnl the ones we care about.
2145 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2146 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2147 AC_REQUIRE([AC_PROG_INSTALL])dnl
2148 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2149   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2150   # is not polluted with repeated "-I."
2151   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2152   # test to see if srcdir already configured
2153   if test -f $srcdir/config.status; then
2154     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2155   fi
2156 fi
2157
2158 # test whether we have cygpath
2159 if test -z "$CYGPATH_W"; then
2160   if (cygpath --version) >/dev/null 2>/dev/null; then
2161     CYGPATH_W='cygpath -w'
2162   else
2163     CYGPATH_W=echo
2164   fi
2165 fi
2166 AC_SUBST([CYGPATH_W])
2167
2168 # Define the identity of the package.
2169 dnl Distinguish between old-style and new-style calls.
2170 m4_ifval([$2],
2171 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2172  AC_SUBST([PACKAGE], [$1])dnl
2173  AC_SUBST([VERSION], [$2])],
2174 [_AM_SET_OPTIONS([$1])dnl
2175 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2176 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
2177   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2178  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2179  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2180
2181 _AM_IF_OPTION([no-define],,
2182 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2183  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2184
2185 # Some tools Automake needs.
2186 AC_REQUIRE([AM_SANITY_CHECK])dnl
2187 AC_REQUIRE([AC_ARG_PROGRAM])dnl
2188 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2189 AM_MISSING_PROG(AUTOCONF, autoconf)
2190 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2191 AM_MISSING_PROG(AUTOHEADER, autoheader)
2192 AM_MISSING_PROG(MAKEINFO, makeinfo)
2193 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2194 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2195 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
2196 # We need awk for the "check" target.  The system "awk" is bad on
2197 # some platforms.
2198 AC_REQUIRE([AC_PROG_AWK])dnl
2199 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2200 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2201 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2202               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2203                              [_AM_PROG_TAR([v7])])])
2204 _AM_IF_OPTION([no-dependencies],,
2205 [AC_PROVIDE_IFELSE([AC_PROG_CC],
2206                   [_AM_DEPENDENCIES(CC)],
2207                   [define([AC_PROG_CC],
2208                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
2209 AC_PROVIDE_IFELSE([AC_PROG_CXX],
2210                   [_AM_DEPENDENCIES(CXX)],
2211                   [define([AC_PROG_CXX],
2212                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
2213 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
2214                   [_AM_DEPENDENCIES(OBJC)],
2215                   [define([AC_PROG_OBJC],
2216                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
2217 ])
2218 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
2219 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
2220 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
2221 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
2222 AC_CONFIG_COMMANDS_PRE(dnl
2223 [m4_provide_if([_AM_COMPILER_EXEEXT],
2224   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2225 ])
2226
2227 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2228 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2229 dnl mangled by Autoconf and run in a shell conditional statement.
2230 m4_define([_AC_COMPILER_EXEEXT],
2231 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2232
2233
2234 # When config.status generates a header, we must update the stamp-h file.
2235 # This file resides in the same directory as the config header
2236 # that is generated.  The stamp files are numbered to have different names.
2237
2238 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2239 # loop where config.status creates the headers, so we can generate
2240 # our stamp files there.
2241 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2242 [# Compute $1's index in $config_headers.
2243 _am_arg=$1
2244 _am_stamp_count=1
2245 for _am_header in $config_headers :; do
2246   case $_am_header in
2247     $_am_arg | $_am_arg:* )
2248       break ;;
2249     * )
2250       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2251   esac
2252 done
2253 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2254
2255 # Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
2256 #
2257 # This file is free software; the Free Software Foundation
2258 # gives unlimited permission to copy and/or distribute it,
2259 # with or without modifications, as long as this notice is preserved.
2260
2261 # AM_PROG_INSTALL_SH
2262 # ------------------
2263 # Define $install_sh.
2264 AC_DEFUN([AM_PROG_INSTALL_SH],
2265 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2266 if test x"${install_sh}" != xset; then
2267   case $am_aux_dir in
2268   *\ * | *\     *)
2269     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2270   *)
2271     install_sh="\${SHELL} $am_aux_dir/install-sh"
2272   esac
2273 fi
2274 AC_SUBST(install_sh)])
2275
2276 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
2277 #
2278 # This file is free software; the Free Software Foundation
2279 # gives unlimited permission to copy and/or distribute it,
2280 # with or without modifications, as long as this notice is preserved.
2281
2282 # serial 2
2283
2284 # Check whether the underlying file-system supports filenames
2285 # with a leading dot.  For instance MS-DOS doesn't.
2286 AC_DEFUN([AM_SET_LEADING_DOT],
2287 [rm -rf .tst 2>/dev/null
2288 mkdir .tst 2>/dev/null
2289 if test -d .tst; then
2290   am__leading_dot=.
2291 else
2292   am__leading_dot=_
2293 fi
2294 rmdir .tst 2>/dev/null
2295 AC_SUBST([am__leading_dot])])
2296
2297 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
2298 # From Jim Meyering
2299
2300 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2301 # Free Software Foundation, Inc.
2302 #
2303 # This file is free software; the Free Software Foundation
2304 # gives unlimited permission to copy and/or distribute it,
2305 # with or without modifications, as long as this notice is preserved.
2306
2307 # serial 5
2308
2309 # AM_MAINTAINER_MODE([DEFAULT-MODE])
2310 # ----------------------------------
2311 # Control maintainer-specific portions of Makefiles.
2312 # Default is to disable them, unless `enable' is passed literally.
2313 # For symmetry, `disable' may be passed as well.  Anyway, the user
2314 # can override the default with the --enable/--disable switch.
2315 AC_DEFUN([AM_MAINTAINER_MODE],
2316 [m4_case(m4_default([$1], [disable]),
2317        [enable], [m4_define([am_maintainer_other], [disable])],
2318        [disable], [m4_define([am_maintainer_other], [enable])],
2319        [m4_define([am_maintainer_other], [enable])
2320         m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
2321 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
2322   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2323   AC_ARG_ENABLE([maintainer-mode],
2324 [  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
2325                           (and sometimes confusing) to the casual installer],
2326       [USE_MAINTAINER_MODE=$enableval],
2327       [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2328   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2329   AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2330   MAINT=$MAINTAINER_MODE_TRUE
2331   AC_SUBST([MAINT])dnl
2332 ]
2333 )
2334
2335 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
2336
2337 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
2338
2339 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
2340 #
2341 # This file is free software; the Free Software Foundation
2342 # gives unlimited permission to copy and/or distribute it,
2343 # with or without modifications, as long as this notice is preserved.
2344
2345 # serial 4
2346
2347 # AM_MAKE_INCLUDE()
2348 # -----------------
2349 # Check to see how make treats includes.
2350 AC_DEFUN([AM_MAKE_INCLUDE],
2351 [am_make=${MAKE-make}
2352 cat > confinc << 'END'
2353 am__doit:
2354         @echo this is the am__doit target
2355 .PHONY: am__doit
2356 END
2357 # If we don't find an include directive, just comment out the code.
2358 AC_MSG_CHECKING([for style of include used by $am_make])
2359 am__include="#"
2360 am__quote=
2361 _am_result=none
2362 # First try GNU make style include.
2363 echo "include confinc" > confmf
2364 # Ignore all kinds of additional output from `make'.
2365 case `$am_make -s -f confmf 2> /dev/null` in #(
2366 *the\ am__doit\ target*)
2367   am__include=include
2368   am__quote=
2369   _am_result=GNU
2370   ;;
2371 esac
2372 # Now try BSD make style include.
2373 if test "$am__include" = "#"; then
2374    echo '.include "confinc"' > confmf
2375    case `$am_make -s -f confmf 2> /dev/null` in #(
2376    *the\ am__doit\ target*)
2377      am__include=.include
2378      am__quote="\""
2379      _am_result=BSD
2380      ;;
2381    esac
2382 fi
2383 AC_SUBST([am__include])
2384 AC_SUBST([am__quote])
2385 AC_MSG_RESULT([$_am_result])
2386 rm -f confinc confmf
2387 ])
2388
2389 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2390
2391 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2392 # Free Software Foundation, Inc.
2393 #
2394 # This file is free software; the Free Software Foundation
2395 # gives unlimited permission to copy and/or distribute it,
2396 # with or without modifications, as long as this notice is preserved.
2397
2398 # serial 6
2399
2400 # AM_MISSING_PROG(NAME, PROGRAM)
2401 # ------------------------------
2402 AC_DEFUN([AM_MISSING_PROG],
2403 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2404 $1=${$1-"${am_missing_run}$2"}
2405 AC_SUBST($1)])
2406
2407
2408 # AM_MISSING_HAS_RUN
2409 # ------------------
2410 # Define MISSING if not defined so far and test if it supports --run.
2411 # If it does, set am_missing_run to use it, otherwise, to nothing.
2412 AC_DEFUN([AM_MISSING_HAS_RUN],
2413 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2414 AC_REQUIRE_AUX_FILE([missing])dnl
2415 if test x"${MISSING+set}" != xset; then
2416   case $am_aux_dir in
2417   *\ * | *\     *)
2418     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2419   *)
2420     MISSING="\${SHELL} $am_aux_dir/missing" ;;
2421   esac
2422 fi
2423 # Use eval to expand $SHELL
2424 if eval "$MISSING --run true"; then
2425   am_missing_run="$MISSING --run "
2426 else
2427   am_missing_run=
2428   AC_MSG_WARN([`missing' script is too old or missing])
2429 fi
2430 ])
2431
2432 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2433 #
2434 # This file is free software; the Free Software Foundation
2435 # gives unlimited permission to copy and/or distribute it,
2436 # with or without modifications, as long as this notice is preserved.
2437
2438 # AM_PROG_MKDIR_P
2439 # ---------------
2440 # Check for `mkdir -p'.
2441 AC_DEFUN([AM_PROG_MKDIR_P],
2442 [AC_PREREQ([2.60])dnl
2443 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2444 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2445 dnl while keeping a definition of mkdir_p for backward compatibility.
2446 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2447 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2448 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2449 dnl adjustment using top_builddir (which is defined more often than
2450 dnl MKDIR_P).
2451 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2452 case $mkdir_p in
2453   [[\\/$]]* | ?:[[\\/]]*) ;;
2454   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2455 esac
2456 ])
2457
2458 # Helper functions for option handling.                     -*- Autoconf -*-
2459
2460 # Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2461 #
2462 # This file is free software; the Free Software Foundation
2463 # gives unlimited permission to copy and/or distribute it,
2464 # with or without modifications, as long as this notice is preserved.
2465
2466 # serial 4
2467
2468 # _AM_MANGLE_OPTION(NAME)
2469 # -----------------------
2470 AC_DEFUN([_AM_MANGLE_OPTION],
2471 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2472
2473 # _AM_SET_OPTION(NAME)
2474 # ------------------------------
2475 # Set option NAME.  Presently that only means defining a flag for this option.
2476 AC_DEFUN([_AM_SET_OPTION],
2477 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2478
2479 # _AM_SET_OPTIONS(OPTIONS)
2480 # ----------------------------------
2481 # OPTIONS is a space-separated list of Automake options.
2482 AC_DEFUN([_AM_SET_OPTIONS],
2483 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2484
2485 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2486 # -------------------------------------------
2487 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2488 AC_DEFUN([_AM_IF_OPTION],
2489 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2490
2491 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
2492
2493 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2494 # Free Software Foundation, Inc.
2495 #
2496 # This file is free software; the Free Software Foundation
2497 # gives unlimited permission to copy and/or distribute it,
2498 # with or without modifications, as long as this notice is preserved.
2499
2500 # serial 5
2501
2502 # AM_SANITY_CHECK
2503 # ---------------
2504 AC_DEFUN([AM_SANITY_CHECK],
2505 [AC_MSG_CHECKING([whether build environment is sane])
2506 # Just in case
2507 sleep 1
2508 echo timestamp > conftest.file
2509 # Reject unsafe characters in $srcdir or the absolute working directory
2510 # name.  Accept space and tab only in the latter.
2511 am_lf='
2512 '
2513 case `pwd` in
2514   *[[\\\"\#\$\&\'\`$am_lf]]*)
2515     AC_MSG_ERROR([unsafe absolute working directory name]);;
2516 esac
2517 case $srcdir in
2518   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2519     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2520 esac
2521
2522 # Do `set' in a subshell so we don't clobber the current shell's
2523 # arguments.  Must try -L first in case configure is actually a
2524 # symlink; some systems play weird games with the mod time of symlinks
2525 # (eg FreeBSD returns the mod time of the symlink's containing
2526 # directory).
2527 if (
2528    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2529    if test "$[*]" = "X"; then
2530       # -L didn't work.
2531       set X `ls -t "$srcdir/configure" conftest.file`
2532    fi
2533    rm -f conftest.file
2534    if test "$[*]" != "X $srcdir/configure conftest.file" \
2535       && test "$[*]" != "X conftest.file $srcdir/configure"; then
2536
2537       # If neither matched, then we have a broken ls.  This can happen
2538       # if, for instance, CONFIG_SHELL is bash and it inherits a
2539       # broken ls alias from the environment.  This has actually
2540       # happened.  Such a system could not be considered "sane".
2541       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2542 alias in your environment])
2543    fi
2544
2545    test "$[2]" = conftest.file
2546    )
2547 then
2548    # Ok.
2549    :
2550 else
2551    AC_MSG_ERROR([newly created file is older than distributed files!
2552 Check your system clock])
2553 fi
2554 AC_MSG_RESULT(yes)])
2555
2556 # Copyright (C) 2009  Free Software Foundation, Inc.
2557 #
2558 # This file is free software; the Free Software Foundation
2559 # gives unlimited permission to copy and/or distribute it,
2560 # with or without modifications, as long as this notice is preserved.
2561
2562 # serial 1
2563
2564 # AM_SILENT_RULES([DEFAULT])
2565 # --------------------------
2566 # Enable less verbose build rules; with the default set to DEFAULT
2567 # (`yes' being less verbose, `no' or empty being verbose).
2568 AC_DEFUN([AM_SILENT_RULES],
2569 [AC_ARG_ENABLE([silent-rules],
2570 [  --enable-silent-rules          less verbose build output (undo: `make V=1')
2571   --disable-silent-rules         verbose build output (undo: `make V=0')])
2572 case $enable_silent_rules in
2573 yes) AM_DEFAULT_VERBOSITY=0;;
2574 no)  AM_DEFAULT_VERBOSITY=1;;
2575 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2576 esac
2577 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2578 AM_BACKSLASH='\'
2579 AC_SUBST([AM_BACKSLASH])dnl
2580 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2581 ])
2582
2583 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2584 #
2585 # This file is free software; the Free Software Foundation
2586 # gives unlimited permission to copy and/or distribute it,
2587 # with or without modifications, as long as this notice is preserved.
2588
2589 # AM_PROG_INSTALL_STRIP
2590 # ---------------------
2591 # One issue with vendor `install' (even GNU) is that you can't
2592 # specify the program used to strip binaries.  This is especially
2593 # annoying in cross-compiling environments, where the build's strip
2594 # is unlikely to handle the host's binaries.
2595 # Fortunately install-sh will honor a STRIPPROG variable, so we
2596 # always use install-sh in `make install-strip', and initialize
2597 # STRIPPROG with the value of the STRIP variable (set by the user).
2598 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2599 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2600 # Installed binaries are usually stripped using `strip' when the user
2601 # run `make install-strip'.  However `strip' might not be the right
2602 # tool to use in cross-compilation environments, therefore Automake
2603 # will honor the `STRIP' environment variable to overrule this program.
2604 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2605 if test "$cross_compiling" != no; then
2606   AC_CHECK_TOOL([STRIP], [strip], :)
2607 fi
2608 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2609 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2610
2611 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2612 #
2613 # This file is free software; the Free Software Foundation
2614 # gives unlimited permission to copy and/or distribute it,
2615 # with or without modifications, as long as this notice is preserved.
2616
2617 # serial 2
2618
2619 # _AM_SUBST_NOTMAKE(VARIABLE)
2620 # ---------------------------
2621 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2622 # This macro is traced by Automake.
2623 AC_DEFUN([_AM_SUBST_NOTMAKE])
2624
2625 # AM_SUBST_NOTMAKE(VARIABLE)
2626 # ---------------------------
2627 # Public sister of _AM_SUBST_NOTMAKE.
2628 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2629
2630 # Check how to create a tarball.                            -*- Autoconf -*-
2631
2632 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2633 #
2634 # This file is free software; the Free Software Foundation
2635 # gives unlimited permission to copy and/or distribute it,
2636 # with or without modifications, as long as this notice is preserved.
2637
2638 # serial 2
2639
2640 # _AM_PROG_TAR(FORMAT)
2641 # --------------------
2642 # Check how to create a tarball in format FORMAT.
2643 # FORMAT should be one of `v7', `ustar', or `pax'.
2644 #
2645 # Substitute a variable $(am__tar) that is a command
2646 # writing to stdout a FORMAT-tarball containing the directory
2647 # $tardir.
2648 #     tardir=directory && $(am__tar) > result.tar
2649 #
2650 # Substitute a variable $(am__untar) that extract such
2651 # a tarball read from stdin.
2652 #     $(am__untar) < result.tar
2653 AC_DEFUN([_AM_PROG_TAR],
2654 [# Always define AMTAR for backward compatibility.
2655 AM_MISSING_PROG([AMTAR], [tar])
2656 m4_if([$1], [v7],
2657      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2658      [m4_case([$1], [ustar],, [pax],,
2659               [m4_fatal([Unknown tar format])])
2660 AC_MSG_CHECKING([how to create a $1 tar archive])
2661 # Loop over all known methods to create a tar archive until one works.
2662 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2663 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2664 # Do not fold the above two line into one, because Tru64 sh and
2665 # Solaris sh will not grok spaces in the rhs of `-'.
2666 for _am_tool in $_am_tools
2667 do
2668   case $_am_tool in
2669   gnutar)
2670     for _am_tar in tar gnutar gtar;
2671     do
2672       AM_RUN_LOG([$_am_tar --version]) && break
2673     done
2674     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2675     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2676     am__untar="$_am_tar -xf -"
2677     ;;
2678   plaintar)
2679     # Must skip GNU tar: if it does not support --format= it doesn't create
2680     # ustar tarball either.
2681     (tar --version) >/dev/null 2>&1 && continue
2682     am__tar='tar chf - "$$tardir"'
2683     am__tar_='tar chf - "$tardir"'
2684     am__untar='tar xf -'
2685     ;;
2686   pax)
2687     am__tar='pax -L -x $1 -w "$$tardir"'
2688     am__tar_='pax -L -x $1 -w "$tardir"'
2689     am__untar='pax -r'
2690     ;;
2691   cpio)
2692     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2693     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2694     am__untar='cpio -i -H $1 -d'
2695     ;;
2696   none)
2697     am__tar=false
2698     am__tar_=false
2699     am__untar=false
2700     ;;
2701   esac
2702
2703   # If the value was cached, stop now.  We just wanted to have am__tar
2704   # and am__untar set.
2705   test -n "${am_cv_prog_tar_$1}" && break
2706
2707   # tar/untar a dummy directory, and stop if the command works
2708   rm -rf conftest.dir
2709   mkdir conftest.dir
2710   echo GrepMe > conftest.dir/file
2711   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2712   rm -rf conftest.dir
2713   if test -s conftest.tar; then
2714     AM_RUN_LOG([$am__untar <conftest.tar])
2715     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2716   fi
2717 done
2718 rm -rf conftest.dir
2719
2720 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2721 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2722 AC_SUBST([am__tar])
2723 AC_SUBST([am__untar])
2724 ]) # _AM_PROG_TAR
2725