Add default Smack manifest for xorg-x11-drv-intel.spec
[adaptation/xorg-x11-drv-intel.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.67],,
17 [m4_warning([this file was generated for autoconf 2.67.
18 You have another version of autoconf.  It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
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])[]dnl
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/>.])[]dnl
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.12.0])
220 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
221 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
222 m4_if(m4_cmp(maj_have, maj_needed), 0,,
223     [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
224 m4_if(m4_version_compare(vers_have, [$1]), -1,
225     [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
226 m4_undefine([vers_have])
227 m4_undefine([maj_have])
228 m4_undefine([maj_needed])
229 ]) # XORG_MACROS_VERSION
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([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([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 m4_define([_defopt], m4_default([$2], [auto]))
640 AC_ARG_WITH(xsltproc,
641         AS_HELP_STRING([--with-xsltproc],
642            [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
643            [use_xsltproc=$withval], [use_xsltproc=]_defopt)
644 m4_undefine([_defopt])
645
646 if test "x$use_xsltproc" = x"auto"; then
647    AC_PATH_PROG([XSLTPROC], [xsltproc])
648    if test "x$XSLTPROC" = "x"; then
649         AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
650         have_xsltproc=no
651    else
652         have_xsltproc=yes
653    fi
654 elif test "x$use_xsltproc" = x"yes" ; then
655    AC_PATH_PROG([XSLTPROC], [xsltproc])
656    if test "x$XSLTPROC" = "x"; then
657         AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
658    fi
659    have_xsltproc=yes
660 elif test "x$use_xsltproc" = x"no" ; then
661    if test "x$XSLTPROC" != "x"; then
662       AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
663    fi
664    have_xsltproc=no
665 else
666    AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
667 fi
668
669 # Checking for minimum version is not implemented
670 # but we want to keep the interface consistent with other commands
671 m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
672
673 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
674 ]) # XORG_WITH_XSLTPROC
675
676
677 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
678 # ----------------
679 # Minimum version: 1.5.0
680 # Minimum version for optional DEFAULT argument: 1.11.0
681 #
682 # Documentation tools are not always available on all platforms and sometimes
683 # not at the appropriate level. This macro enables a module to test for the
684 # presence of the tool and obtain it's path in separate variables. Coupled with
685 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
686 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
687 # --with-asciidoc assumes 'auto'.
688 #
689 # Interface to module:
690 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
691 # ASCIIDOC:      returns the path of the asciidoc program found
692 #                returns the path set by the user in the environment
693 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
694 #                 'no' user instructs the module not to use asciidoc
695 #
696 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
697 #
698 AC_DEFUN([XORG_WITH_ASCIIDOC],[
699 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
700 m4_define([_defopt], m4_default([$2], [auto]))
701 AC_ARG_WITH(asciidoc,
702         AS_HELP_STRING([--with-asciidoc],
703            [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
704            [use_asciidoc=$withval], [use_asciidoc=]_defopt)
705 m4_undefine([_defopt])
706
707 if test "x$use_asciidoc" = x"auto"; then
708    AC_PATH_PROG([ASCIIDOC], [asciidoc])
709    if test "x$ASCIIDOC" = "x"; then
710         AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
711         have_asciidoc=no
712    else
713         have_asciidoc=yes
714    fi
715 elif test "x$use_asciidoc" = x"yes" ; then
716    AC_PATH_PROG([ASCIIDOC], [asciidoc])
717    if test "x$ASCIIDOC" = "x"; then
718         AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
719    fi
720    have_asciidoc=yes
721 elif test "x$use_asciidoc" = x"no" ; then
722    if test "x$ASCIIDOC" != "x"; then
723       AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
724    fi
725    have_asciidoc=no
726 else
727    AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
728 fi
729 m4_ifval([$1],
730 [if test "$have_asciidoc" = yes; then
731     # scrape the asciidoc version
732     AC_MSG_CHECKING([the asciidoc version])
733     asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
734     AC_MSG_RESULT([$asciidoc_version])
735     AS_VERSION_COMPARE([$asciidoc_version], [$1],
736         [if test "x$use_asciidoc" = xauto; then
737             AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
738             have_asciidoc=no
739         else
740             AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
741         fi])
742 fi])
743 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
744 ]) # XORG_WITH_ASCIIDOC
745
746 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
747 # --------------------------------
748 # Minimum version: 1.5.0
749 # Minimum version for optional DEFAULT argument: 1.11.0
750 #
751 # Documentation tools are not always available on all platforms and sometimes
752 # not at the appropriate level. This macro enables a module to test for the
753 # presence of the tool and obtain it's path in separate variables. Coupled with
754 # the --with-doxygen option, it allows maximum flexibilty in making decisions
755 # as whether or not to use the doxygen package. When DEFAULT is not specified,
756 # --with-doxygen assumes 'auto'.
757 #
758 # Interface to module:
759 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
760 # DOXYGEN:       returns the path of the doxygen program found
761 #                returns the path set by the user in the environment
762 # --with-doxygen: 'yes' user instructs the module to use doxygen
763 #                 'no' user instructs the module not to use doxygen
764 #
765 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
766 #
767 AC_DEFUN([XORG_WITH_DOXYGEN],[
768 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
769 m4_define([_defopt], m4_default([$2], [auto]))
770 AC_ARG_WITH(doxygen,
771         AS_HELP_STRING([--with-doxygen],
772            [Use doxygen to regenerate documentation (default: ]_defopt[)]),
773            [use_doxygen=$withval], [use_doxygen=]_defopt)
774 m4_undefine([_defopt])
775
776 if test "x$use_doxygen" = x"auto"; then
777    AC_PATH_PROG([DOXYGEN], [doxygen])
778    if test "x$DOXYGEN" = "x"; then
779         AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
780         have_doxygen=no
781    else
782         have_doxygen=yes
783    fi
784 elif test "x$use_doxygen" = x"yes" ; then
785    AC_PATH_PROG([DOXYGEN], [doxygen])
786    if test "x$DOXYGEN" = "x"; then
787         AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
788    fi
789    have_doxygen=yes
790 elif test "x$use_doxygen" = x"no" ; then
791    if test "x$DOXYGEN" != "x"; then
792       AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
793    fi
794    have_doxygen=no
795 else
796    AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
797 fi
798 m4_ifval([$1],
799 [if test "$have_doxygen" = yes; then
800     # scrape the doxygen version
801     AC_MSG_CHECKING([the doxygen version])
802     doxygen_version=`$DOXYGEN --version 2>/dev/null`
803     AC_MSG_RESULT([$doxygen_version])
804     AS_VERSION_COMPARE([$doxygen_version], [$1],
805         [if test "x$use_doxygen" = xauto; then
806             AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
807             have_doxygen=no
808         else
809             AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
810         fi])
811 fi])
812 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
813 ]) # XORG_WITH_DOXYGEN
814
815 # XORG_WITH_GROFF([DEFAULT])
816 # ----------------
817 # Minimum version: 1.6.0
818 # Minimum version for optional DEFAULT argument: 1.11.0
819 #
820 # Documentation tools are not always available on all platforms and sometimes
821 # not at the appropriate level. This macro enables a module to test for the
822 # presence of the tool and obtain it's path in separate variables. Coupled with
823 # the --with-groff option, it allows maximum flexibilty in making decisions
824 # as whether or not to use the groff package. When DEFAULT is not specified,
825 # --with-groff assumes 'auto'.
826 #
827 # Interface to module:
828 # HAVE_GROFF:    used in makefiles to conditionally generate documentation
829 # HAVE_GROFF_MM: the memorandum macros (-mm) package
830 # HAVE_GROFF_MS: the -ms macros package
831 # GROFF:         returns the path of the groff program found
832 #                returns the path set by the user in the environment
833 # --with-groff:  'yes' user instructs the module to use groff
834 #                'no' user instructs the module not to use groff
835 #
836 # Added in version 1.9.0:
837 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
838 #                  pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
839 #                  psselect from the psutils package.
840 #                  the ghostcript package. Refer to the grohtml man pages
841 #
842 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
843 #
844 # OS and distros often splits groff in a basic and full package, the former
845 # having the groff program and the later having devices, fonts and macros
846 # Checking for the groff executable is not enough.
847 #
848 # If macros are missing, we cannot assume that groff is useless, so we don't
849 # unset HAVE_GROFF or GROFF env variables.
850 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
851 #
852 AC_DEFUN([XORG_WITH_GROFF],[
853 AC_ARG_VAR([GROFF], [Path to groff command])
854 m4_define([_defopt], m4_default([$1], [auto]))
855 AC_ARG_WITH(groff,
856         AS_HELP_STRING([--with-groff],
857            [Use groff to regenerate documentation (default: ]_defopt[)]),
858            [use_groff=$withval], [use_groff=]_defopt)
859 m4_undefine([_defopt])
860
861 if test "x$use_groff" = x"auto"; then
862    AC_PATH_PROG([GROFF], [groff])
863    if test "x$GROFF" = "x"; then
864         AC_MSG_WARN([groff not found - documentation targets will be skipped])
865         have_groff=no
866    else
867         have_groff=yes
868    fi
869 elif test "x$use_groff" = x"yes" ; then
870    AC_PATH_PROG([GROFF], [groff])
871    if test "x$GROFF" = "x"; then
872         AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
873    fi
874    have_groff=yes
875 elif test "x$use_groff" = x"no" ; then
876    if test "x$GROFF" != "x"; then
877       AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
878    fi
879    have_groff=no
880 else
881    AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
882 fi
883
884 # We have groff, test for the presence of the macro packages
885 if test "x$have_groff" = x"yes"; then
886     AC_MSG_CHECKING([for ${GROFF} -ms macros])
887     if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
888         groff_ms_works=yes
889     else
890         groff_ms_works=no
891     fi
892     AC_MSG_RESULT([$groff_ms_works])
893     AC_MSG_CHECKING([for ${GROFF} -mm macros])
894     if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
895         groff_mm_works=yes
896     else
897         groff_mm_works=no
898     fi
899     AC_MSG_RESULT([$groff_mm_works])
900 fi
901
902 # We have groff, test for HTML dependencies, one command per package
903 if test "x$have_groff" = x"yes"; then
904    AC_PATH_PROGS(GS_PATH, [gs gswin32c])
905    AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
906    AC_PATH_PROG(PSSELECT_PATH, [psselect])
907    if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
908       have_groff_html=yes
909    else
910       have_groff_html=no
911       AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
912    fi
913 fi
914
915 # Set Automake conditionals for Makefiles
916 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
917 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
918 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
919 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
920 ]) # XORG_WITH_GROFF
921
922 # XORG_WITH_FOP([DEFAULT])
923 # ----------------
924 # Minimum version: 1.6.0
925 # Minimum version for optional DEFAULT argument: 1.11.0
926 #
927 # Documentation tools are not always available on all platforms and sometimes
928 # not at the appropriate level. This macro enables a module to test for the
929 # presence of the tool and obtain it's path in separate variables. Coupled with
930 # the --with-fop option, it allows maximum flexibilty in making decisions
931 # as whether or not to use the fop package. When DEFAULT is not specified,
932 # --with-fop assumes 'auto'.
933 #
934 # Interface to module:
935 # HAVE_FOP:     used in makefiles to conditionally generate documentation
936 # FOP:          returns the path of the fop program found
937 #               returns the path set by the user in the environment
938 # --with-fop:   'yes' user instructs the module to use fop
939 #               'no' user instructs the module not to use fop
940 #
941 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
942 #
943 AC_DEFUN([XORG_WITH_FOP],[
944 AC_ARG_VAR([FOP], [Path to fop command])
945 m4_define([_defopt], m4_default([$1], [auto]))
946 AC_ARG_WITH(fop,
947         AS_HELP_STRING([--with-fop],
948            [Use fop to regenerate documentation (default: ]_defopt[)]),
949            [use_fop=$withval], [use_fop=]_defopt)
950 m4_undefine([_defopt])
951
952 if test "x$use_fop" = x"auto"; then
953    AC_PATH_PROG([FOP], [fop])
954    if test "x$FOP" = "x"; then
955         AC_MSG_WARN([fop not found - documentation targets will be skipped])
956         have_fop=no
957    else
958         have_fop=yes
959    fi
960 elif test "x$use_fop" = x"yes" ; then
961    AC_PATH_PROG([FOP], [fop])
962    if test "x$FOP" = "x"; then
963         AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
964    fi
965    have_fop=yes
966 elif test "x$use_fop" = x"no" ; then
967    if test "x$FOP" != "x"; then
968       AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
969    fi
970    have_fop=no
971 else
972    AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
973 fi
974 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
975 ]) # XORG_WITH_FOP
976
977 # XORG_WITH_PS2PDF([DEFAULT])
978 # ----------------
979 # Minimum version: 1.6.0
980 # Minimum version for optional DEFAULT argument: 1.11.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-ps2pdf option, it allows maximum flexibilty in making decisions
986 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
987 # --with-ps2pdf assumes 'auto'.
988 #
989 # Interface to module:
990 # HAVE_PS2PDF:  used in makefiles to conditionally generate documentation
991 # PS2PDF:       returns the path of the ps2pdf program found
992 #               returns the path set by the user in the environment
993 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
994 #                'no' user instructs the module not to use ps2pdf
995 #
996 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
997 #
998 AC_DEFUN([XORG_WITH_PS2PDF],[
999 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1000 m4_define([_defopt], m4_default([$1], [auto]))
1001 AC_ARG_WITH(ps2pdf,
1002         AS_HELP_STRING([--with-ps2pdf],
1003            [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1004            [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1005 m4_undefine([_defopt])
1006
1007 if test "x$use_ps2pdf" = x"auto"; then
1008    AC_PATH_PROG([PS2PDF], [ps2pdf])
1009    if test "x$PS2PDF" = "x"; then
1010         AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1011         have_ps2pdf=no
1012    else
1013         have_ps2pdf=yes
1014    fi
1015 elif test "x$use_ps2pdf" = x"yes" ; then
1016    AC_PATH_PROG([PS2PDF], [ps2pdf])
1017    if test "x$PS2PDF" = "x"; then
1018         AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1019    fi
1020    have_ps2pdf=yes
1021 elif test "x$use_ps2pdf" = x"no" ; then
1022    if test "x$PS2PDF" != "x"; then
1023       AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1024    fi
1025    have_ps2pdf=no
1026 else
1027    AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1028 fi
1029 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1030 ]) # XORG_WITH_PS2PDF
1031
1032 # XORG_ENABLE_DOCS (enable_docs=yes)
1033 # ----------------
1034 # Minimum version: 1.6.0
1035 #
1036 # Documentation tools are not always available on all platforms and sometimes
1037 # not at the appropriate level. This macro enables a builder to skip all
1038 # documentation targets except traditional man pages.
1039 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1040 # maximum flexibilty in controlling documentation building.
1041 # Refer to:
1042 # XORG_WITH_XMLTO         --with-xmlto
1043 # XORG_WITH_ASCIIDOC      --with-asciidoc
1044 # XORG_WITH_DOXYGEN       --with-doxygen
1045 # XORG_WITH_FOP           --with-fop
1046 # XORG_WITH_GROFF         --with-groff
1047 # XORG_WITH_PS2PDF        --with-ps2pdf
1048 #
1049 # Interface to module:
1050 # ENABLE_DOCS:    used in makefiles to conditionally generate documentation
1051 # --enable-docs: 'yes' user instructs the module to generate docs
1052 #                'no' user instructs the module not to generate docs
1053 # parm1:        specify the default value, yes or no.
1054 #
1055 AC_DEFUN([XORG_ENABLE_DOCS],[
1056 m4_define([docs_default], m4_default([$1], [yes]))
1057 AC_ARG_ENABLE(docs,
1058         AS_HELP_STRING([--enable-docs],
1059            [Enable building the documentation (default: ]docs_default[)]),
1060            [build_docs=$enableval], [build_docs=]docs_default)
1061 m4_undefine([docs_default])
1062 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1063 AC_MSG_CHECKING([whether to build documentation])
1064 AC_MSG_RESULT([$build_docs])
1065 ]) # XORG_ENABLE_DOCS
1066
1067 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1068 # ----------------
1069 # Minimum version: 1.6.0
1070 #
1071 # This macro enables a builder to skip all developer documentation.
1072 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1073 # maximum flexibilty in controlling documentation building.
1074 # Refer to:
1075 # XORG_WITH_XMLTO         --with-xmlto
1076 # XORG_WITH_ASCIIDOC      --with-asciidoc
1077 # XORG_WITH_DOXYGEN       --with-doxygen
1078 # XORG_WITH_FOP           --with-fop
1079 # XORG_WITH_GROFF         --with-groff
1080 # XORG_WITH_PS2PDF        --with-ps2pdf
1081 #
1082 # Interface to module:
1083 # ENABLE_DEVEL_DOCS:    used in makefiles to conditionally generate developer docs
1084 # --enable-devel-docs:  'yes' user instructs the module to generate developer docs
1085 #                       'no' user instructs the module not to generate developer docs
1086 # parm1:                specify the default value, yes or no.
1087 #
1088 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1089 m4_define([devel_default], m4_default([$1], [yes]))
1090 AC_ARG_ENABLE(devel-docs,
1091         AS_HELP_STRING([--enable-devel-docs],
1092            [Enable building the developer documentation (default: ]devel_default[)]),
1093            [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1094 m4_undefine([devel_default])
1095 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1096 AC_MSG_CHECKING([whether to build developer documentation])
1097 AC_MSG_RESULT([$build_devel_docs])
1098 ]) # XORG_ENABLE_DEVEL_DOCS
1099
1100 # XORG_ENABLE_SPECS (enable_specs=yes)
1101 # ----------------
1102 # Minimum version: 1.6.0
1103 #
1104 # This macro enables a builder to skip all functional specification targets.
1105 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1106 # maximum flexibilty in controlling documentation building.
1107 # Refer to:
1108 # XORG_WITH_XMLTO         --with-xmlto
1109 # XORG_WITH_ASCIIDOC      --with-asciidoc
1110 # XORG_WITH_DOXYGEN       --with-doxygen
1111 # XORG_WITH_FOP           --with-fop
1112 # XORG_WITH_GROFF         --with-groff
1113 # XORG_WITH_PS2PDF        --with-ps2pdf
1114 #
1115 # Interface to module:
1116 # ENABLE_SPECS:         used in makefiles to conditionally generate specs
1117 # --enable-specs:       'yes' user instructs the module to generate specs
1118 #                       'no' user instructs the module not to generate specs
1119 # parm1:                specify the default value, yes or no.
1120 #
1121 AC_DEFUN([XORG_ENABLE_SPECS],[
1122 m4_define([spec_default], m4_default([$1], [yes]))
1123 AC_ARG_ENABLE(specs,
1124         AS_HELP_STRING([--enable-specs],
1125            [Enable building the specs (default: ]spec_default[)]),
1126            [build_specs=$enableval], [build_specs=]spec_default)
1127 m4_undefine([spec_default])
1128 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1129 AC_MSG_CHECKING([whether to build functional specifications])
1130 AC_MSG_RESULT([$build_specs])
1131 ]) # XORG_ENABLE_SPECS
1132
1133 # XORG_CHECK_MALLOC_ZERO
1134 # ----------------------
1135 # Minimum version: 1.0.0
1136 #
1137 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1138 # malloc(0) returns NULL.  Packages should add one of these cflags to
1139 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1140 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1141 AC_ARG_ENABLE(malloc0returnsnull,
1142         AS_HELP_STRING([--enable-malloc0returnsnull],
1143                        [malloc(0) returns NULL (default: auto)]),
1144         [MALLOC_ZERO_RETURNS_NULL=$enableval],
1145         [MALLOC_ZERO_RETURNS_NULL=auto])
1146
1147 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1148 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1149         AC_RUN_IFELSE([AC_LANG_PROGRAM([
1150 #include <stdlib.h>
1151 ],[
1152     char *m0, *r0, *c0, *p;
1153     m0 = malloc(0);
1154     p = malloc(10);
1155     r0 = realloc(p,0);
1156     c0 = calloc(0,10);
1157     exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1158 ])],
1159                 [MALLOC_ZERO_RETURNS_NULL=yes],
1160                 [MALLOC_ZERO_RETURNS_NULL=no],
1161                 [MALLOC_ZERO_RETURNS_NULL=yes])
1162 fi
1163 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1164
1165 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1166         MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1167         XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1168         XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1169 else
1170         MALLOC_ZERO_CFLAGS=""
1171         XMALLOC_ZERO_CFLAGS=""
1172         XTMALLOC_ZERO_CFLAGS=""
1173 fi
1174
1175 AC_SUBST([MALLOC_ZERO_CFLAGS])
1176 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1177 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1178 ]) # XORG_CHECK_MALLOC_ZERO
1179
1180 # XORG_WITH_LINT()
1181 # ----------------
1182 # Minimum version: 1.1.0
1183 #
1184 # This macro enables the use of a tool that flags some suspicious and
1185 # non-portable constructs (likely to be bugs) in C language source code.
1186 # It will attempt to locate the tool and use appropriate options.
1187 # There are various lint type tools on different platforms.
1188 #
1189 # Interface to module:
1190 # LINT:         returns the path to the tool found on the platform
1191 #               or the value set to LINT on the configure cmd line
1192 #               also an Automake conditional
1193 # LINT_FLAGS:   an Automake variable with appropriate flags
1194 #
1195 # --with-lint:  'yes' user instructs the module to use lint
1196 #               'no' user instructs the module not to use lint (default)
1197 #
1198 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1199 # If the user sets the value of LINT_FLAGS, they are used verbatim.
1200 #
1201 AC_DEFUN([XORG_WITH_LINT],[
1202
1203 AC_ARG_VAR([LINT], [Path to a lint-style command])
1204 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1205 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1206                 [Use a lint-style source code checker (default: disabled)])],
1207                 [use_lint=$withval], [use_lint=no])
1208
1209 # Obtain platform specific info like program name and options
1210 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
1211 case $host_os in
1212   *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1213         lint_name=splint
1214         lint_options="-badflag"
1215         ;;
1216   *freebsd* | *netbsd*)
1217         lint_name=lint
1218         lint_options="-u -b"
1219         ;;
1220   *solaris*)
1221         lint_name=lint
1222         lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1223         ;;
1224 esac
1225
1226 # Test for the presence of the program (either guessed by the code or spelled out by the user)
1227 if test "x$use_lint" = x"yes" ; then
1228    AC_PATH_PROG([LINT], [$lint_name])
1229    if test "x$LINT" = "x"; then
1230         AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1231    fi
1232 elif test "x$use_lint" = x"no" ; then
1233    if test "x$LINT" != "x"; then
1234       AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1235    fi
1236 else
1237    AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1238 fi
1239
1240 # User supplied flags override default flags
1241 if test "x$LINT_FLAGS" != "x"; then
1242    lint_options=$LINT_FLAGS
1243 fi
1244
1245 AC_SUBST([LINT_FLAGS],[$lint_options])
1246 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1247
1248 ]) # XORG_WITH_LINT
1249
1250 # XORG_LINT_LIBRARY(LIBNAME)
1251 # --------------------------
1252 # Minimum version: 1.1.0
1253 #
1254 # Sets up flags for building lint libraries for checking programs that call
1255 # functions in the library.
1256 #
1257 # Interface to module:
1258 # LINTLIB               - Automake variable with the name of lint library file to make
1259 # MAKE_LINT_LIB         - Automake conditional
1260 #
1261 # --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1262 #                         - 'no' user instructs the module not to create a lint library (default)
1263
1264 AC_DEFUN([XORG_LINT_LIBRARY],[
1265 AC_REQUIRE([XORG_WITH_LINT])
1266 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1267         [Create lint library (default: disabled)])],
1268         [make_lint_lib=$enableval], [make_lint_lib=no])
1269
1270 if test "x$make_lint_lib" = x"yes" ; then
1271    LINTLIB=llib-l$1.ln
1272    if test "x$LINT" = "x"; then
1273         AC_MSG_ERROR([Cannot make lint library without --with-lint])
1274    fi
1275 elif test "x$make_lint_lib" != x"no" ; then
1276    AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1277 fi
1278
1279 AC_SUBST(LINTLIB)
1280 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1281
1282 ]) # XORG_LINT_LIBRARY
1283
1284 # XORG_CWARNFLAGS
1285 # ---------------
1286 # Minimum version: 1.2.0
1287 #
1288 # Defines CWARNFLAGS to enable C compiler warnings.
1289 #
1290 AC_DEFUN([XORG_CWARNFLAGS], [
1291 AC_REQUIRE([AC_PROG_CC_C99])
1292 if  test "x$GCC" = xyes ; then
1293     CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1294 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1295 -Wbad-function-cast -Wformat=2"
1296     case `$CC -dumpversion` in
1297     3.4.* | 4.*)
1298         CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1299         ;;
1300     esac
1301 else
1302     AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1303     if test "x$SUNCC" = "xyes"; then
1304         CWARNFLAGS="-v"
1305     fi
1306 fi
1307 AC_SUBST(CWARNFLAGS)
1308 ]) # XORG_CWARNFLAGS
1309
1310 # XORG_STRICT_OPTION
1311 # -----------------------
1312 # Minimum version: 1.3.0
1313 #
1314 # Add configure option to enable strict compilation
1315 AC_DEFUN([XORG_STRICT_OPTION], [
1316 # If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1317 AC_REQUIRE([AC_PROG_CC_C99])
1318 AC_REQUIRE([XORG_CWARNFLAGS])
1319
1320 AC_ARG_ENABLE(strict-compilation,
1321                           AS_HELP_STRING([--enable-strict-compilation],
1322                           [Enable all warnings from compiler and make them errors (default: disabled)]),
1323                           [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1324 if test "x$STRICT_COMPILE" = "xyes"; then
1325         AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1326         AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1327         if test "x$GCC" = xyes ; then
1328                 STRICT_CFLAGS="-pedantic -Werror"
1329         elif test "x$SUNCC" = "xyes"; then
1330                 STRICT_CFLAGS="-errwarn"
1331     elif test "x$INTELCC" = "xyes"; then
1332                 STRICT_CFLAGS="-Werror"
1333         fi
1334 fi
1335 CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1336 AC_SUBST([CWARNFLAGS])
1337 ]) # XORG_STRICT_OPTION
1338
1339 # XORG_DEFAULT_OPTIONS
1340 # --------------------
1341 # Minimum version: 1.3.0
1342 #
1343 # Defines default options for X.Org modules.
1344 #
1345 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1346 AC_REQUIRE([AC_PROG_INSTALL])
1347 XORG_CWARNFLAGS
1348 XORG_STRICT_OPTION
1349 XORG_RELEASE_VERSION
1350 XORG_CHANGELOG
1351 XORG_INSTALL
1352 XORG_MANPAGE_SECTIONS
1353 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1354     [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1355 ]) # XORG_DEFAULT_OPTIONS
1356
1357 # XORG_INSTALL()
1358 # ----------------
1359 # Minimum version: 1.4.0
1360 #
1361 # Defines the variable INSTALL_CMD as the command to copy
1362 # INSTALL from $prefix/share/util-macros.
1363 #
1364 AC_DEFUN([XORG_INSTALL], [
1365 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1366 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1367 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1368 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1369 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1370 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1371 AC_SUBST([INSTALL_CMD])
1372 ]) # XORG_INSTALL
1373 dnl Copyright 2005 Red Hat, Inc
1374 dnl
1375 dnl Permission to use, copy, modify, distribute, and sell this software and its
1376 dnl documentation for any purpose is hereby granted without fee, provided that
1377 dnl the above copyright notice appear in all copies and that both that
1378 dnl copyright notice and this permission notice appear in supporting
1379 dnl documentation.
1380 dnl
1381 dnl The above copyright notice and this permission notice shall be included
1382 dnl in all copies or substantial portions of the Software.
1383 dnl
1384 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1385 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1386 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1387 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1388 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1389 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1390 dnl OTHER DEALINGS IN THE SOFTWARE.
1391 dnl
1392 dnl Except as contained in this notice, the name of the copyright holders shall
1393 dnl not be used in advertising or otherwise to promote the sale, use or
1394 dnl other dealings in this Software without prior written authorization
1395 dnl from the copyright holders.
1396 dnl
1397
1398 # XORG_RELEASE_VERSION
1399 # --------------------
1400 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1401  
1402 AC_DEFUN([XORG_RELEASE_VERSION],[
1403         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1404                 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1405                 [Major version of this package])
1406         PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1407         if test "x$PVM" = "x"; then
1408                 PVM="0"
1409         fi
1410         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1411                 [$PVM],
1412                 [Minor version of this package])
1413         PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1414         if test "x$PVP" = "x"; then
1415                 PVP="0"
1416         fi
1417         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1418                 [$PVP],
1419                 [Patch version of this package])
1420 ])
1421
1422 # XORG_CHANGELOG()
1423 # ----------------
1424 # Minimum version: 1.2.0
1425 #
1426 # Defines the variable CHANGELOG_CMD as the command to generate
1427 # ChangeLog from git.
1428 #
1429 #
1430 AC_DEFUN([XORG_CHANGELOG], [
1431 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1432 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1433 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1434 echo 'git directory not found: installing possibly empty changelog.' >&2)"
1435 AC_SUBST([CHANGELOG_CMD])
1436 ]) # XORG_CHANGELOG
1437
1438 dnl Copyright 2005 Red Hat, Inc
1439 dnl 
1440 dnl Permission to use, copy, modify, distribute, and sell this software and its
1441 dnl documentation for any purpose is hereby granted without fee, provided that
1442 dnl the above copyright notice appear in all copies and that both that
1443 dnl copyright notice and this permission notice appear in supporting
1444 dnl documentation.
1445 dnl 
1446 dnl The above copyright notice and this permission notice shall be included
1447 dnl in all copies or substantial portions of the Software.
1448 dnl 
1449 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1450 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1451 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1452 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1453 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1454 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1455 dnl OTHER DEALINGS IN THE SOFTWARE.
1456 dnl 
1457 dnl Except as contained in this notice, the name of the copyright holders shall
1458 dnl not be used in advertising or otherwise to promote the sale, use or
1459 dnl other dealings in this Software without prior written authorization
1460 dnl from the copyright holders.
1461 dnl 
1462
1463 # XORG_DRIVER_CHECK_EXT()
1464 # --------------------------
1465 # Checks for the $1 define in xorg-server.h (from the sdk).  If it
1466 # is defined, then add $1 to $REQUIRED_MODULES.
1467
1468 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
1469         AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1470         SAVE_CFLAGS="$CFLAGS"
1471         CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
1472         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1473 #include "xorg-server.h"
1474 #if !defined $1
1475 #error $1 not defined
1476 #endif
1477                 ]])],
1478                 [_EXT_CHECK=yes],
1479                 [_EXT_CHECK=no])
1480         CFLAGS="$SAVE_CFLAGS"
1481         AC_MSG_CHECKING([if $1 is defined])
1482         AC_MSG_RESULT([$_EXT_CHECK])
1483         if test "$_EXT_CHECK" != no; then
1484                 REQUIRED_MODULES="$REQUIRED_MODULES $2"
1485         fi
1486 ])
1487
1488 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1489 #
1490 # This file is free software; the Free Software Foundation
1491 # gives unlimited permission to copy and/or distribute it,
1492 # with or without modifications, as long as this notice is preserved.
1493
1494 # AM_AUTOMAKE_VERSION(VERSION)
1495 # ----------------------------
1496 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1497 # generated from the m4 files accompanying Automake X.Y.
1498 # (This private macro should not be called outside this file.)
1499 AC_DEFUN([AM_AUTOMAKE_VERSION],
1500 [am__api_version='1.11'
1501 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1502 dnl require some minimum version.  Point them to the right macro.
1503 m4_if([$1], [1.11.1], [],
1504       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1505 ])
1506
1507 # _AM_AUTOCONF_VERSION(VERSION)
1508 # -----------------------------
1509 # aclocal traces this macro to find the Autoconf version.
1510 # This is a private macro too.  Using m4_define simplifies
1511 # the logic in aclocal, which can simply ignore this definition.
1512 m4_define([_AM_AUTOCONF_VERSION], [])
1513
1514 # AM_SET_CURRENT_AUTOMAKE_VERSION
1515 # -------------------------------
1516 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1517 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1518 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1519 [AM_AUTOMAKE_VERSION([1.11.1])dnl
1520 m4_ifndef([AC_AUTOCONF_VERSION],
1521   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1522 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1523
1524 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1525
1526 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1527 #
1528 # This file is free software; the Free Software Foundation
1529 # gives unlimited permission to copy and/or distribute it,
1530 # with or without modifications, as long as this notice is preserved.
1531
1532 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1533 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1534 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1535 #
1536 # Of course, Automake must honor this variable whenever it calls a
1537 # tool from the auxiliary directory.  The problem is that $srcdir (and
1538 # therefore $ac_aux_dir as well) can be either absolute or relative,
1539 # depending on how configure is run.  This is pretty annoying, since
1540 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1541 # source directory, any form will work fine, but in subdirectories a
1542 # relative path needs to be adjusted first.
1543 #
1544 # $ac_aux_dir/missing
1545 #    fails when called from a subdirectory if $ac_aux_dir is relative
1546 # $top_srcdir/$ac_aux_dir/missing
1547 #    fails if $ac_aux_dir is absolute,
1548 #    fails when called from a subdirectory in a VPATH build with
1549 #          a relative $ac_aux_dir
1550 #
1551 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1552 # are both prefixed by $srcdir.  In an in-source build this is usually
1553 # harmless because $srcdir is `.', but things will broke when you
1554 # start a VPATH build or use an absolute $srcdir.
1555 #
1556 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1557 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1558 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1559 # and then we would define $MISSING as
1560 #   MISSING="\${SHELL} $am_aux_dir/missing"
1561 # This will work as long as MISSING is not called from configure, because
1562 # unfortunately $(top_srcdir) has no meaning in configure.
1563 # However there are other variables, like CC, which are often used in
1564 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1565 #
1566 # Another solution, used here, is to always expand $ac_aux_dir to an
1567 # absolute PATH.  The drawback is that using absolute paths prevent a
1568 # configured tree to be moved without reconfiguration.
1569
1570 AC_DEFUN([AM_AUX_DIR_EXPAND],
1571 [dnl Rely on autoconf to set up CDPATH properly.
1572 AC_PREREQ([2.50])dnl
1573 # expand $ac_aux_dir to an absolute path
1574 am_aux_dir=`cd $ac_aux_dir && pwd`
1575 ])
1576
1577 # AM_CONDITIONAL                                            -*- Autoconf -*-
1578
1579 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1580 # Free Software Foundation, Inc.
1581 #
1582 # This file is free software; the Free Software Foundation
1583 # gives unlimited permission to copy and/or distribute it,
1584 # with or without modifications, as long as this notice is preserved.
1585
1586 # serial 9
1587
1588 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1589 # -------------------------------------
1590 # Define a conditional.
1591 AC_DEFUN([AM_CONDITIONAL],
1592 [AC_PREREQ(2.52)dnl
1593  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1594         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1595 AC_SUBST([$1_TRUE])dnl
1596 AC_SUBST([$1_FALSE])dnl
1597 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1598 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1599 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1600 if $2; then
1601   $1_TRUE=
1602   $1_FALSE='#'
1603 else
1604   $1_TRUE='#'
1605   $1_FALSE=
1606 fi
1607 AC_CONFIG_COMMANDS_PRE(
1608 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1609   AC_MSG_ERROR([[conditional "$1" was never defined.
1610 Usually this means the macro was only invoked conditionally.]])
1611 fi])])
1612
1613 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1614 # Free Software Foundation, Inc.
1615 #
1616 # This file is free software; the Free Software Foundation
1617 # gives unlimited permission to copy and/or distribute it,
1618 # with or without modifications, as long as this notice is preserved.
1619
1620 # serial 10
1621
1622 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1623 # written in clear, in which case automake, when reading aclocal.m4,
1624 # will think it sees a *use*, and therefore will trigger all it's
1625 # C support machinery.  Also note that it means that autoscan, seeing
1626 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1627
1628
1629 # _AM_DEPENDENCIES(NAME)
1630 # ----------------------
1631 # See how the compiler implements dependency checking.
1632 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1633 # We try a few techniques and use that to set a single cache variable.
1634 #
1635 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1636 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1637 # dependency, and given that the user is not expected to run this macro,
1638 # just rely on AC_PROG_CC.
1639 AC_DEFUN([_AM_DEPENDENCIES],
1640 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1641 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1642 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1643 AC_REQUIRE([AM_DEP_TRACK])dnl
1644
1645 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1646        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1647        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1648        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1649        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1650                    [depcc="$$1"   am_compiler_list=])
1651
1652 AC_CACHE_CHECK([dependency style of $depcc],
1653                [am_cv_$1_dependencies_compiler_type],
1654 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1655   # We make a subdir and do the tests there.  Otherwise we can end up
1656   # making bogus files that we don't know about and never remove.  For
1657   # instance it was reported that on HP-UX the gcc test will end up
1658   # making a dummy file named `D' -- because `-MD' means `put the output
1659   # in D'.
1660   mkdir conftest.dir
1661   # Copy depcomp to subdir because otherwise we won't find it if we're
1662   # using a relative directory.
1663   cp "$am_depcomp" conftest.dir
1664   cd conftest.dir
1665   # We will build objects and dependencies in a subdirectory because
1666   # it helps to detect inapplicable dependency modes.  For instance
1667   # both Tru64's cc and ICC support -MD to output dependencies as a
1668   # side effect of compilation, but ICC will put the dependencies in
1669   # the current directory while Tru64 will put them in the object
1670   # directory.
1671   mkdir sub
1672
1673   am_cv_$1_dependencies_compiler_type=none
1674   if test "$am_compiler_list" = ""; then
1675      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1676   fi
1677   am__universal=false
1678   m4_case([$1], [CC],
1679     [case " $depcc " in #(
1680      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1681      esac],
1682     [CXX],
1683     [case " $depcc " in #(
1684      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1685      esac])
1686
1687   for depmode in $am_compiler_list; do
1688     # Setup a source with many dependencies, because some compilers
1689     # like to wrap large dependency lists on column 80 (with \), and
1690     # we should not choose a depcomp mode which is confused by this.
1691     #
1692     # We need to recreate these files for each test, as the compiler may
1693     # overwrite some of them when testing with obscure command lines.
1694     # This happens at least with the AIX C compiler.
1695     : > sub/conftest.c
1696     for i in 1 2 3 4 5 6; do
1697       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1698       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1699       # Solaris 8's {/usr,}/bin/sh.
1700       touch sub/conftst$i.h
1701     done
1702     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1703
1704     # We check with `-c' and `-o' for the sake of the "dashmstdout"
1705     # mode.  It turns out that the SunPro C++ compiler does not properly
1706     # handle `-M -o', and we need to detect this.  Also, some Intel
1707     # versions had trouble with output in subdirs
1708     am__obj=sub/conftest.${OBJEXT-o}
1709     am__minus_obj="-o $am__obj"
1710     case $depmode in
1711     gcc)
1712       # This depmode causes a compiler race in universal mode.
1713       test "$am__universal" = false || continue
1714       ;;
1715     nosideeffect)
1716       # after this tag, mechanisms are not by side-effect, so they'll
1717       # only be used when explicitly requested
1718       if test "x$enable_dependency_tracking" = xyes; then
1719         continue
1720       else
1721         break
1722       fi
1723       ;;
1724     msvisualcpp | msvcmsys)
1725       # This compiler won't grok `-c -o', but also, the minuso test has
1726       # not run yet.  These depmodes are late enough in the game, and
1727       # so weak that their functioning should not be impacted.
1728       am__obj=conftest.${OBJEXT-o}
1729       am__minus_obj=
1730       ;;
1731     none) break ;;
1732     esac
1733     if depmode=$depmode \
1734        source=sub/conftest.c object=$am__obj \
1735        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1736        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1737          >/dev/null 2>conftest.err &&
1738        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1739        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1740        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1741        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1742       # icc doesn't choke on unknown options, it will just issue warnings
1743       # or remarks (even with -Werror).  So we grep stderr for any message
1744       # that says an option was ignored or not supported.
1745       # When given -MP, icc 7.0 and 7.1 complain thusly:
1746       #   icc: Command line warning: ignoring option '-M'; no argument required
1747       # The diagnosis changed in icc 8.0:
1748       #   icc: Command line remark: option '-MP' not supported
1749       if (grep 'ignoring option' conftest.err ||
1750           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1751         am_cv_$1_dependencies_compiler_type=$depmode
1752         break
1753       fi
1754     fi
1755   done
1756
1757   cd ..
1758   rm -rf conftest.dir
1759 else
1760   am_cv_$1_dependencies_compiler_type=none
1761 fi
1762 ])
1763 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1764 AM_CONDITIONAL([am__fastdep$1], [
1765   test "x$enable_dependency_tracking" != xno \
1766   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1767 ])
1768
1769
1770 # AM_SET_DEPDIR
1771 # -------------
1772 # Choose a directory name for dependency files.
1773 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1774 AC_DEFUN([AM_SET_DEPDIR],
1775 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1776 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1777 ])
1778
1779
1780 # AM_DEP_TRACK
1781 # ------------
1782 AC_DEFUN([AM_DEP_TRACK],
1783 [AC_ARG_ENABLE(dependency-tracking,
1784 [  --disable-dependency-tracking  speeds up one-time build
1785   --enable-dependency-tracking   do not reject slow dependency extractors])
1786 if test "x$enable_dependency_tracking" != xno; then
1787   am_depcomp="$ac_aux_dir/depcomp"
1788   AMDEPBACKSLASH='\'
1789 fi
1790 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1791 AC_SUBST([AMDEPBACKSLASH])dnl
1792 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1793 ])
1794
1795 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1796
1797 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1798 # Free Software Foundation, Inc.
1799 #
1800 # This file is free software; the Free Software Foundation
1801 # gives unlimited permission to copy and/or distribute it,
1802 # with or without modifications, as long as this notice is preserved.
1803
1804 #serial 5
1805
1806 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1807 # ------------------------------
1808 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1809 [{
1810   # Autoconf 2.62 quotes --file arguments for eval, but not when files
1811   # are listed without --file.  Let's play safe and only enable the eval
1812   # if we detect the quoting.
1813   case $CONFIG_FILES in
1814   *\'*) eval set x "$CONFIG_FILES" ;;
1815   *)   set x $CONFIG_FILES ;;
1816   esac
1817   shift
1818   for mf
1819   do
1820     # Strip MF so we end up with the name of the file.
1821     mf=`echo "$mf" | sed -e 's/:.*$//'`
1822     # Check whether this is an Automake generated Makefile or not.
1823     # We used to match only the files named `Makefile.in', but
1824     # some people rename them; so instead we look at the file content.
1825     # Grep'ing the first line is not enough: some people post-process
1826     # each Makefile.in and add a new line on top of each file to say so.
1827     # Grep'ing the whole file is not good either: AIX grep has a line
1828     # limit of 2048, but all sed's we know have understand at least 4000.
1829     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1830       dirpart=`AS_DIRNAME("$mf")`
1831     else
1832       continue
1833     fi
1834     # Extract the definition of DEPDIR, am__include, and am__quote
1835     # from the Makefile without running `make'.
1836     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1837     test -z "$DEPDIR" && continue
1838     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1839     test -z "am__include" && continue
1840     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1841     # When using ansi2knr, U may be empty or an underscore; expand it
1842     U=`sed -n 's/^U = //p' < "$mf"`
1843     # Find all dependency output files, they are included files with
1844     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1845     # simplest approach to changing $(DEPDIR) to its actual value in the
1846     # expansion.
1847     for file in `sed -n "
1848       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1849          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1850       # Make sure the directory exists.
1851       test -f "$dirpart/$file" && continue
1852       fdir=`AS_DIRNAME(["$file"])`
1853       AS_MKDIR_P([$dirpart/$fdir])
1854       # echo "creating $dirpart/$file"
1855       echo '# dummy' > "$dirpart/$file"
1856     done
1857   done
1858 }
1859 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1860
1861
1862 # AM_OUTPUT_DEPENDENCY_COMMANDS
1863 # -----------------------------
1864 # This macro should only be invoked once -- use via AC_REQUIRE.
1865 #
1866 # This code is only required when automatic dependency tracking
1867 # is enabled.  FIXME.  This creates each `.P' file that we will
1868 # need in order to bootstrap the dependency handling code.
1869 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1870 [AC_CONFIG_COMMANDS([depfiles],
1871      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1872      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1873 ])
1874
1875 # Do all the work for Automake.                             -*- Autoconf -*-
1876
1877 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1878 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1879 #
1880 # This file is free software; the Free Software Foundation
1881 # gives unlimited permission to copy and/or distribute it,
1882 # with or without modifications, as long as this notice is preserved.
1883
1884 # serial 16
1885
1886 # This macro actually does too much.  Some checks are only needed if
1887 # your package does certain things.  But this isn't really a big deal.
1888
1889 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1890 # AM_INIT_AUTOMAKE([OPTIONS])
1891 # -----------------------------------------------
1892 # The call with PACKAGE and VERSION arguments is the old style
1893 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1894 # and VERSION should now be passed to AC_INIT and removed from
1895 # the call to AM_INIT_AUTOMAKE.
1896 # We support both call styles for the transition.  After
1897 # the next Automake release, Autoconf can make the AC_INIT
1898 # arguments mandatory, and then we can depend on a new Autoconf
1899 # release and drop the old call support.
1900 AC_DEFUN([AM_INIT_AUTOMAKE],
1901 [AC_PREREQ([2.62])dnl
1902 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1903 dnl the ones we care about.
1904 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1905 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1906 AC_REQUIRE([AC_PROG_INSTALL])dnl
1907 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1908   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1909   # is not polluted with repeated "-I."
1910   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1911   # test to see if srcdir already configured
1912   if test -f $srcdir/config.status; then
1913     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1914   fi
1915 fi
1916
1917 # test whether we have cygpath
1918 if test -z "$CYGPATH_W"; then
1919   if (cygpath --version) >/dev/null 2>/dev/null; then
1920     CYGPATH_W='cygpath -w'
1921   else
1922     CYGPATH_W=echo
1923   fi
1924 fi
1925 AC_SUBST([CYGPATH_W])
1926
1927 # Define the identity of the package.
1928 dnl Distinguish between old-style and new-style calls.
1929 m4_ifval([$2],
1930 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1931  AC_SUBST([PACKAGE], [$1])dnl
1932  AC_SUBST([VERSION], [$2])],
1933 [_AM_SET_OPTIONS([$1])dnl
1934 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1935 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1936   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1937  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1938  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1939
1940 _AM_IF_OPTION([no-define],,
1941 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1942  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1943
1944 # Some tools Automake needs.
1945 AC_REQUIRE([AM_SANITY_CHECK])dnl
1946 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1947 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1948 AM_MISSING_PROG(AUTOCONF, autoconf)
1949 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1950 AM_MISSING_PROG(AUTOHEADER, autoheader)
1951 AM_MISSING_PROG(MAKEINFO, makeinfo)
1952 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1953 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1954 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1955 # We need awk for the "check" target.  The system "awk" is bad on
1956 # some platforms.
1957 AC_REQUIRE([AC_PROG_AWK])dnl
1958 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1959 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1960 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1961               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1962                              [_AM_PROG_TAR([v7])])])
1963 _AM_IF_OPTION([no-dependencies],,
1964 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1965                   [_AM_DEPENDENCIES(CC)],
1966                   [define([AC_PROG_CC],
1967                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1968 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1969                   [_AM_DEPENDENCIES(CXX)],
1970                   [define([AC_PROG_CXX],
1971                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1972 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1973                   [_AM_DEPENDENCIES(OBJC)],
1974                   [define([AC_PROG_OBJC],
1975                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1976 ])
1977 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1978 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1979 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1980 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1981 AC_CONFIG_COMMANDS_PRE(dnl
1982 [m4_provide_if([_AM_COMPILER_EXEEXT],
1983   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1984 ])
1985
1986 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1987 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1988 dnl mangled by Autoconf and run in a shell conditional statement.
1989 m4_define([_AC_COMPILER_EXEEXT],
1990 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1991
1992
1993 # When config.status generates a header, we must update the stamp-h file.
1994 # This file resides in the same directory as the config header
1995 # that is generated.  The stamp files are numbered to have different names.
1996
1997 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1998 # loop where config.status creates the headers, so we can generate
1999 # our stamp files there.
2000 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2001 [# Compute $1's index in $config_headers.
2002 _am_arg=$1
2003 _am_stamp_count=1
2004 for _am_header in $config_headers :; do
2005   case $_am_header in
2006     $_am_arg | $_am_arg:* )
2007       break ;;
2008     * )
2009       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2010   esac
2011 done
2012 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2013
2014 # Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
2015 #
2016 # This file is free software; the Free Software Foundation
2017 # gives unlimited permission to copy and/or distribute it,
2018 # with or without modifications, as long as this notice is preserved.
2019
2020 # AM_PROG_INSTALL_SH
2021 # ------------------
2022 # Define $install_sh.
2023 AC_DEFUN([AM_PROG_INSTALL_SH],
2024 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2025 if test x"${install_sh}" != xset; then
2026   case $am_aux_dir in
2027   *\ * | *\     *)
2028     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2029   *)
2030     install_sh="\${SHELL} $am_aux_dir/install-sh"
2031   esac
2032 fi
2033 AC_SUBST(install_sh)])
2034
2035 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
2036 #
2037 # This file is free software; the Free Software Foundation
2038 # gives unlimited permission to copy and/or distribute it,
2039 # with or without modifications, as long as this notice is preserved.
2040
2041 # serial 2
2042
2043 # Check whether the underlying file-system supports filenames
2044 # with a leading dot.  For instance MS-DOS doesn't.
2045 AC_DEFUN([AM_SET_LEADING_DOT],
2046 [rm -rf .tst 2>/dev/null
2047 mkdir .tst 2>/dev/null
2048 if test -d .tst; then
2049   am__leading_dot=.
2050 else
2051   am__leading_dot=_
2052 fi
2053 rmdir .tst 2>/dev/null
2054 AC_SUBST([am__leading_dot])])
2055
2056 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
2057 # From Jim Meyering
2058
2059 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2060 # Free Software Foundation, Inc.
2061 #
2062 # This file is free software; the Free Software Foundation
2063 # gives unlimited permission to copy and/or distribute it,
2064 # with or without modifications, as long as this notice is preserved.
2065
2066 # serial 5
2067
2068 # AM_MAINTAINER_MODE([DEFAULT-MODE])
2069 # ----------------------------------
2070 # Control maintainer-specific portions of Makefiles.
2071 # Default is to disable them, unless `enable' is passed literally.
2072 # For symmetry, `disable' may be passed as well.  Anyway, the user
2073 # can override the default with the --enable/--disable switch.
2074 AC_DEFUN([AM_MAINTAINER_MODE],
2075 [m4_case(m4_default([$1], [disable]),
2076        [enable], [m4_define([am_maintainer_other], [disable])],
2077        [disable], [m4_define([am_maintainer_other], [enable])],
2078        [m4_define([am_maintainer_other], [enable])
2079         m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
2080 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
2081   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2082   AC_ARG_ENABLE([maintainer-mode],
2083 [  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
2084                           (and sometimes confusing) to the casual installer],
2085       [USE_MAINTAINER_MODE=$enableval],
2086       [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2087   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2088   AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2089   MAINT=$MAINTAINER_MODE_TRUE
2090   AC_SUBST([MAINT])dnl
2091 ]
2092 )
2093
2094 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
2095
2096 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
2097
2098 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
2099 #
2100 # This file is free software; the Free Software Foundation
2101 # gives unlimited permission to copy and/or distribute it,
2102 # with or without modifications, as long as this notice is preserved.
2103
2104 # serial 4
2105
2106 # AM_MAKE_INCLUDE()
2107 # -----------------
2108 # Check to see how make treats includes.
2109 AC_DEFUN([AM_MAKE_INCLUDE],
2110 [am_make=${MAKE-make}
2111 cat > confinc << 'END'
2112 am__doit:
2113         @echo this is the am__doit target
2114 .PHONY: am__doit
2115 END
2116 # If we don't find an include directive, just comment out the code.
2117 AC_MSG_CHECKING([for style of include used by $am_make])
2118 am__include="#"
2119 am__quote=
2120 _am_result=none
2121 # First try GNU make style include.
2122 echo "include confinc" > confmf
2123 # Ignore all kinds of additional output from `make'.
2124 case `$am_make -s -f confmf 2> /dev/null` in #(
2125 *the\ am__doit\ target*)
2126   am__include=include
2127   am__quote=
2128   _am_result=GNU
2129   ;;
2130 esac
2131 # Now try BSD make style include.
2132 if test "$am__include" = "#"; then
2133    echo '.include "confinc"' > confmf
2134    case `$am_make -s -f confmf 2> /dev/null` in #(
2135    *the\ am__doit\ target*)
2136      am__include=.include
2137      am__quote="\""
2138      _am_result=BSD
2139      ;;
2140    esac
2141 fi
2142 AC_SUBST([am__include])
2143 AC_SUBST([am__quote])
2144 AC_MSG_RESULT([$_am_result])
2145 rm -f confinc confmf
2146 ])
2147
2148 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2149
2150 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2151 # Free Software Foundation, Inc.
2152 #
2153 # This file is free software; the Free Software Foundation
2154 # gives unlimited permission to copy and/or distribute it,
2155 # with or without modifications, as long as this notice is preserved.
2156
2157 # serial 6
2158
2159 # AM_MISSING_PROG(NAME, PROGRAM)
2160 # ------------------------------
2161 AC_DEFUN([AM_MISSING_PROG],
2162 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2163 $1=${$1-"${am_missing_run}$2"}
2164 AC_SUBST($1)])
2165
2166
2167 # AM_MISSING_HAS_RUN
2168 # ------------------
2169 # Define MISSING if not defined so far and test if it supports --run.
2170 # If it does, set am_missing_run to use it, otherwise, to nothing.
2171 AC_DEFUN([AM_MISSING_HAS_RUN],
2172 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2173 AC_REQUIRE_AUX_FILE([missing])dnl
2174 if test x"${MISSING+set}" != xset; then
2175   case $am_aux_dir in
2176   *\ * | *\     *)
2177     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2178   *)
2179     MISSING="\${SHELL} $am_aux_dir/missing" ;;
2180   esac
2181 fi
2182 # Use eval to expand $SHELL
2183 if eval "$MISSING --run true"; then
2184   am_missing_run="$MISSING --run "
2185 else
2186   am_missing_run=
2187   AC_MSG_WARN([`missing' script is too old or missing])
2188 fi
2189 ])
2190
2191 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2192 #
2193 # This file is free software; the Free Software Foundation
2194 # gives unlimited permission to copy and/or distribute it,
2195 # with or without modifications, as long as this notice is preserved.
2196
2197 # AM_PROG_MKDIR_P
2198 # ---------------
2199 # Check for `mkdir -p'.
2200 AC_DEFUN([AM_PROG_MKDIR_P],
2201 [AC_PREREQ([2.60])dnl
2202 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2203 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2204 dnl while keeping a definition of mkdir_p for backward compatibility.
2205 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2206 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2207 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2208 dnl adjustment using top_builddir (which is defined more often than
2209 dnl MKDIR_P).
2210 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2211 case $mkdir_p in
2212   [[\\/$]]* | ?:[[\\/]]*) ;;
2213   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2214 esac
2215 ])
2216
2217 # Helper functions for option handling.                     -*- Autoconf -*-
2218
2219 # Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2220 #
2221 # This file is free software; the Free Software Foundation
2222 # gives unlimited permission to copy and/or distribute it,
2223 # with or without modifications, as long as this notice is preserved.
2224
2225 # serial 4
2226
2227 # _AM_MANGLE_OPTION(NAME)
2228 # -----------------------
2229 AC_DEFUN([_AM_MANGLE_OPTION],
2230 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2231
2232 # _AM_SET_OPTION(NAME)
2233 # ------------------------------
2234 # Set option NAME.  Presently that only means defining a flag for this option.
2235 AC_DEFUN([_AM_SET_OPTION],
2236 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2237
2238 # _AM_SET_OPTIONS(OPTIONS)
2239 # ----------------------------------
2240 # OPTIONS is a space-separated list of Automake options.
2241 AC_DEFUN([_AM_SET_OPTIONS],
2242 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2243
2244 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2245 # -------------------------------------------
2246 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2247 AC_DEFUN([_AM_IF_OPTION],
2248 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2249
2250 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
2251
2252 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2253 # Free Software Foundation, Inc.
2254 #
2255 # This file is free software; the Free Software Foundation
2256 # gives unlimited permission to copy and/or distribute it,
2257 # with or without modifications, as long as this notice is preserved.
2258
2259 # serial 5
2260
2261 # AM_SANITY_CHECK
2262 # ---------------
2263 AC_DEFUN([AM_SANITY_CHECK],
2264 [AC_MSG_CHECKING([whether build environment is sane])
2265 # Just in case
2266 sleep 1
2267 echo timestamp > conftest.file
2268 # Reject unsafe characters in $srcdir or the absolute working directory
2269 # name.  Accept space and tab only in the latter.
2270 am_lf='
2271 '
2272 case `pwd` in
2273   *[[\\\"\#\$\&\'\`$am_lf]]*)
2274     AC_MSG_ERROR([unsafe absolute working directory name]);;
2275 esac
2276 case $srcdir in
2277   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2278     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2279 esac
2280
2281 # Do `set' in a subshell so we don't clobber the current shell's
2282 # arguments.  Must try -L first in case configure is actually a
2283 # symlink; some systems play weird games with the mod time of symlinks
2284 # (eg FreeBSD returns the mod time of the symlink's containing
2285 # directory).
2286 if (
2287    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2288    if test "$[*]" = "X"; then
2289       # -L didn't work.
2290       set X `ls -t "$srcdir/configure" conftest.file`
2291    fi
2292    rm -f conftest.file
2293    if test "$[*]" != "X $srcdir/configure conftest.file" \
2294       && test "$[*]" != "X conftest.file $srcdir/configure"; then
2295
2296       # If neither matched, then we have a broken ls.  This can happen
2297       # if, for instance, CONFIG_SHELL is bash and it inherits a
2298       # broken ls alias from the environment.  This has actually
2299       # happened.  Such a system could not be considered "sane".
2300       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2301 alias in your environment])
2302    fi
2303
2304    test "$[2]" = conftest.file
2305    )
2306 then
2307    # Ok.
2308    :
2309 else
2310    AC_MSG_ERROR([newly created file is older than distributed files!
2311 Check your system clock])
2312 fi
2313 AC_MSG_RESULT(yes)])
2314
2315 # Copyright (C) 2009  Free Software Foundation, Inc.
2316 #
2317 # This file is free software; the Free Software Foundation
2318 # gives unlimited permission to copy and/or distribute it,
2319 # with or without modifications, as long as this notice is preserved.
2320
2321 # serial 1
2322
2323 # AM_SILENT_RULES([DEFAULT])
2324 # --------------------------
2325 # Enable less verbose build rules; with the default set to DEFAULT
2326 # (`yes' being less verbose, `no' or empty being verbose).
2327 AC_DEFUN([AM_SILENT_RULES],
2328 [AC_ARG_ENABLE([silent-rules],
2329 [  --enable-silent-rules          less verbose build output (undo: `make V=1')
2330   --disable-silent-rules         verbose build output (undo: `make V=0')])
2331 case $enable_silent_rules in
2332 yes) AM_DEFAULT_VERBOSITY=0;;
2333 no)  AM_DEFAULT_VERBOSITY=1;;
2334 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2335 esac
2336 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2337 AM_BACKSLASH='\'
2338 AC_SUBST([AM_BACKSLASH])dnl
2339 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2340 ])
2341
2342 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2343 #
2344 # This file is free software; the Free Software Foundation
2345 # gives unlimited permission to copy and/or distribute it,
2346 # with or without modifications, as long as this notice is preserved.
2347
2348 # AM_PROG_INSTALL_STRIP
2349 # ---------------------
2350 # One issue with vendor `install' (even GNU) is that you can't
2351 # specify the program used to strip binaries.  This is especially
2352 # annoying in cross-compiling environments, where the build's strip
2353 # is unlikely to handle the host's binaries.
2354 # Fortunately install-sh will honor a STRIPPROG variable, so we
2355 # always use install-sh in `make install-strip', and initialize
2356 # STRIPPROG with the value of the STRIP variable (set by the user).
2357 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2358 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2359 # Installed binaries are usually stripped using `strip' when the user
2360 # run `make install-strip'.  However `strip' might not be the right
2361 # tool to use in cross-compilation environments, therefore Automake
2362 # will honor the `STRIP' environment variable to overrule this program.
2363 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2364 if test "$cross_compiling" != no; then
2365   AC_CHECK_TOOL([STRIP], [strip], :)
2366 fi
2367 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2368 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2369
2370 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2371 #
2372 # This file is free software; the Free Software Foundation
2373 # gives unlimited permission to copy and/or distribute it,
2374 # with or without modifications, as long as this notice is preserved.
2375
2376 # serial 2
2377
2378 # _AM_SUBST_NOTMAKE(VARIABLE)
2379 # ---------------------------
2380 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2381 # This macro is traced by Automake.
2382 AC_DEFUN([_AM_SUBST_NOTMAKE])
2383
2384 # AM_SUBST_NOTMAKE(VARIABLE)
2385 # ---------------------------
2386 # Public sister of _AM_SUBST_NOTMAKE.
2387 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2388
2389 # Check how to create a tarball.                            -*- Autoconf -*-
2390
2391 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2392 #
2393 # This file is free software; the Free Software Foundation
2394 # gives unlimited permission to copy and/or distribute it,
2395 # with or without modifications, as long as this notice is preserved.
2396
2397 # serial 2
2398
2399 # _AM_PROG_TAR(FORMAT)
2400 # --------------------
2401 # Check how to create a tarball in format FORMAT.
2402 # FORMAT should be one of `v7', `ustar', or `pax'.
2403 #
2404 # Substitute a variable $(am__tar) that is a command
2405 # writing to stdout a FORMAT-tarball containing the directory
2406 # $tardir.
2407 #     tardir=directory && $(am__tar) > result.tar
2408 #
2409 # Substitute a variable $(am__untar) that extract such
2410 # a tarball read from stdin.
2411 #     $(am__untar) < result.tar
2412 AC_DEFUN([_AM_PROG_TAR],
2413 [# Always define AMTAR for backward compatibility.
2414 AM_MISSING_PROG([AMTAR], [tar])
2415 m4_if([$1], [v7],
2416      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2417      [m4_case([$1], [ustar],, [pax],,
2418               [m4_fatal([Unknown tar format])])
2419 AC_MSG_CHECKING([how to create a $1 tar archive])
2420 # Loop over all known methods to create a tar archive until one works.
2421 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2422 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2423 # Do not fold the above two line into one, because Tru64 sh and
2424 # Solaris sh will not grok spaces in the rhs of `-'.
2425 for _am_tool in $_am_tools
2426 do
2427   case $_am_tool in
2428   gnutar)
2429     for _am_tar in tar gnutar gtar;
2430     do
2431       AM_RUN_LOG([$_am_tar --version]) && break
2432     done
2433     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2434     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2435     am__untar="$_am_tar -xf -"
2436     ;;
2437   plaintar)
2438     # Must skip GNU tar: if it does not support --format= it doesn't create
2439     # ustar tarball either.
2440     (tar --version) >/dev/null 2>&1 && continue
2441     am__tar='tar chf - "$$tardir"'
2442     am__tar_='tar chf - "$tardir"'
2443     am__untar='tar xf -'
2444     ;;
2445   pax)
2446     am__tar='pax -L -x $1 -w "$$tardir"'
2447     am__tar_='pax -L -x $1 -w "$tardir"'
2448     am__untar='pax -r'
2449     ;;
2450   cpio)
2451     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2452     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2453     am__untar='cpio -i -H $1 -d'
2454     ;;
2455   none)
2456     am__tar=false
2457     am__tar_=false
2458     am__untar=false
2459     ;;
2460   esac
2461
2462   # If the value was cached, stop now.  We just wanted to have am__tar
2463   # and am__untar set.
2464   test -n "${am_cv_prog_tar_$1}" && break
2465
2466   # tar/untar a dummy directory, and stop if the command works
2467   rm -rf conftest.dir
2468   mkdir conftest.dir
2469   echo GrepMe > conftest.dir/file
2470   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2471   rm -rf conftest.dir
2472   if test -s conftest.tar; then
2473     AM_RUN_LOG([$am__untar <conftest.tar])
2474     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2475   fi
2476 done
2477 rm -rf conftest.dir
2478
2479 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2480 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2481 AC_SUBST([am__tar])
2482 AC_SUBST([am__untar])
2483 ]) # _AM_PROG_TAR
2484
2485 m4_include([m4/libtool.m4])
2486 m4_include([m4/ltoptions.m4])
2487 m4_include([m4/ltsugar.m4])
2488 m4_include([m4/ltversion.m4])
2489 m4_include([m4/lt~obsolete.m4])