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