~ubuntu-branches/ubuntu/trusty/x11-xserver-utils/trusty

« back to all changes in this revision

Viewing changes to xrandr/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker
  • Date: 2010-08-09 10:24:12 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100809102412-3j7ifv5scdrd5f8m
Tags: 7.5+2ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - 101_xset_spellfix.patch: Spelling fix in help docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
 
1
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
2
 
3
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
 
# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 
4
# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5
5
# This file is free software; the Free Software Foundation
6
6
# gives unlimited permission to copy and/or distribute it,
7
7
# with or without modifications, as long as this notice is preserved.
13
13
 
14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
 
m4_if(AC_AUTOCONF_VERSION, [2.63],,
17
 
[m4_warning([this file was generated for autoconf 2.63.
 
16
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
 
17
[m4_warning([this file was generated for autoconf 2.65.
18
18
You have another version of autoconf.  It may work, but is not guaranteed to.
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
21
 
22
22
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
23
# serial 1 (pkg-config-0.24)
23
24
24
25
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25
26
#
47
48
AC_DEFUN([PKG_PROG_PKG_CONFIG],
48
49
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49
50
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 
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
 
51
55
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52
56
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
53
57
fi
60
64
                AC_MSG_RESULT([no])
61
65
                PKG_CONFIG=""
62
66
        fi
63
 
                
64
67
fi[]dnl
65
68
])# PKG_PROG_PKG_CONFIG
66
69
 
69
72
# Check to see whether a particular set of modules exists.  Similar
70
73
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
71
74
#
72
 
#
73
 
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
74
 
# this or PKG_CHECK_MODULES is called, or make sure to call
75
 
# PKG_CHECK_EXISTS manually
 
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
76
79
# --------------------------------------------------------------
77
80
AC_DEFUN([PKG_CHECK_EXISTS],
78
81
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
79
82
if test -n "$PKG_CONFIG" && \
80
83
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
81
 
  m4_ifval([$2], [$2], [:])
 
84
  m4_default([$2], [:])
82
85
m4_ifvaln([$3], [else
83
86
  $3])dnl
84
87
fi])
85
88
 
86
 
 
87
89
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
88
90
# ---------------------------------------------
89
91
m4_define([_PKG_CONFIG],
136
138
See the pkg-config man page for more details.])
137
139
 
138
140
if test $pkg_failed = yes; then
 
141
        AC_MSG_RESULT([no])
139
142
        _PKG_SHORT_ERRORS_SUPPORTED
140
143
        if test $_pkg_short_errors_supported = yes; then
141
144
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
145
148
        # Put the nasty error message in config.log where it belongs
146
149
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
147
150
 
148
 
        ifelse([$4], , [AC_MSG_ERROR(dnl
 
151
        m4_default([$4], [AC_MSG_ERROR(
149
152
[Package requirements ($2) were not met:
150
153
 
151
154
$$1_PKG_ERRORS
153
156
Consider adjusting the PKG_CONFIG_PATH environment variable if you
154
157
installed software in a non-standard prefix.
155
158
 
156
 
_PKG_TEXT
157
 
])],
158
 
                [AC_MSG_RESULT([no])
159
 
                $4])
 
159
_PKG_TEXT])dnl
 
160
        ])
160
161
elif test $pkg_failed = untried; then
161
 
        ifelse([$4], , [AC_MSG_FAILURE(dnl
 
162
        AC_MSG_RESULT([no])
 
163
        m4_default([$4], [AC_MSG_FAILURE(
162
164
[The pkg-config script could not be found or is too old.  Make sure it
163
165
is in your PATH or set the PKG_CONFIG environment variable to the full
164
166
path to pkg-config.
165
167
 
166
168
_PKG_TEXT
167
169
 
168
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
169
 
                [$4])
 
170
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
 
171
        ])
170
172
else
171
173
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
172
174
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
173
175
        AC_MSG_RESULT([yes])
174
 
        ifelse([$3], , :, [$3])
 
176
        $3
175
177
fi[]dnl
176
178
])# PKG_CHECK_MODULES
177
179
 
 
180
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
178
181
dnl
179
182
dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
180
183
dnl 
181
184
dnl Permission is hereby granted, free of charge, to any person obtaining a
182
 
dnl copy of this software and associated documentation files (the
183
 
dnl "Software"), to deal in the Software without restriction, including
184
 
dnl without limitation the rights to use, copy, modify, merge, publish,
185
 
dnl distribute, and/or sell copies of the Software, and to permit persons
186
 
dnl to whom the Software is furnished to do so, provided that the above
187
 
dnl copyright notice(s) and this permission notice appear in all copies of
188
 
dnl the Software and that both the above copyright notice(s) and this
189
 
dnl permission notice appear in supporting documentation.
190
 
dnl
191
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
192
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
193
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
194
 
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
195
 
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
196
 
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
197
 
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
198
 
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
199
 
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
200
 
dnl
201
 
dnl Except as contained in this notice, the name of a copyright holder
202
 
dnl shall not be used in advertising or otherwise to promote the sale, use
203
 
dnl or other dealings in this Software without prior written authorization
204
 
dnl of the copyright holder.
 
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.
205
202
 
206
203
# XORG_MACROS_VERSION(required-version)
207
204
# -------------------------------------
211
208
# your configure.ac with the minimum required version, such as:
212
209
# XORG_MACROS_VERSION(1.1)
213
210
#
214
 
# To force at least a version with this macro defined, also add:
215
 
# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
 
211
# To ensure that this macro is defined, also add:
 
212
# m4_ifndef([XORG_MACROS_VERSION],
 
213
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
216
214
#
217
215
#
218
216
# See the "minimum version" comment for each macro you use to see what 
219
217
# version you require.
220
 
AC_DEFUN([XORG_MACROS_VERSION],[
221
 
        [XORG_MACROS_needed_version=$1
222
 
        XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
223
 
        XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
224
 
        AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
225
 
        [XORG_MACROS_version=1.1.6
226
 
        XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
227
 
        XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
228
 
        if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
229
 
                AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
230
 
        fi
231
 
        if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
232
 
                AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
233
 
        fi
234
 
        AC_MSG_RESULT([yes, $XORG_MACROS_version])
 
218
m4_defun([XORG_MACROS_VERSION],[
 
219
m4_define([vers_have], [1.10.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])
235
229
]) # XORG_MACROS_VERSION
236
230
 
237
231
# XORG_PROG_RAWCPP()
256
250
        if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
257
251
                RAWCPPFLAGS=-undef
258
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])
259
257
        else
260
258
                AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
261
259
        fi
286
284
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
287
285
# Not sure if there's any better way than just hardcoding by OS name.
288
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
289
 
290
290
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
291
291
AC_REQUIRE([AC_CANONICAL_HOST])
 
292
AC_REQUIRE([AC_PROG_SED])
292
293
 
293
294
if test x$APP_MAN_SUFFIX = x    ; then
294
295
    APP_MAN_SUFFIX=1
357
358
AC_SUBST([MISC_MAN_DIR])
358
359
AC_SUBST([DRIVER_MAN_DIR])
359
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|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
 
371
        -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
 
372
        -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
 
373
        -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
 
374
        -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
 
375
        -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
 
376
AC_SUBST([MAN_SUBSTS])
 
377
 
360
378
]) # XORG_MANPAGE_SECTIONS
361
379
 
 
380
# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
 
381
# ------------------------
 
382
# Minimum version: 1.7.0
 
383
#
 
384
# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
 
385
# provided by xorg-sgml-doctools, if installed.
 
386
AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
 
387
AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
 
388
XORG_SGML_PATH=
 
389
PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
 
390
    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
 
391
    [m4_ifval([$1],[:],
 
392
        [if test x"$cross_compiling" != x"yes" ; then
 
393
            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
 
394
                          [XORG_SGML_PATH=$prefix/share/sgml])
 
395
         fi])
 
396
    ])
 
397
 
 
398
# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
 
399
# the path and the name of the doc stylesheet
 
400
if test "x$XORG_SGML_PATH" != "x" ; then
 
401
   AC_MSG_RESULT([$XORG_SGML_PATH])
 
402
   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
 
403
   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
 
404
else
 
405
   AC_MSG_RESULT([no])
 
406
fi
 
407
 
 
408
AC_SUBST(XORG_SGML_PATH)
 
409
AC_SUBST(STYLESHEET_SRCDIR)
 
410
AC_SUBST(XSL_STYLESHEET)
 
411
AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
 
412
]) # XORG_CHECK_SGML_DOCTOOLS
 
413
 
362
414
# XORG_CHECK_LINUXDOC
363
415
# -------------------
364
416
# Minimum version: 1.0.0
368
420
# Whether or not the necessary tools and files are found can be checked
369
421
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
370
422
AC_DEFUN([XORG_CHECK_LINUXDOC],[
371
 
XORG_SGML_PATH=$prefix/share/sgml
372
 
HAVE_DEFS_ENT=
373
 
 
374
 
if test x"$cross_compiling" = x"yes" ; then
375
 
  HAVE_DEFS_ENT=no
376
 
else
377
 
  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
378
 
fi
 
423
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
 
424
AC_REQUIRE([XORG_WITH_PS2PDF])
379
425
 
380
426
AC_PATH_PROG(LINUXDOC, linuxdoc)
381
 
AC_PATH_PROG(PS2PDF, ps2pdf)
382
 
 
383
 
AC_MSG_CHECKING([Whether to build documentation])
384
 
 
385
 
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
 
427
 
 
428
AC_MSG_CHECKING([whether to build documentation])
 
429
 
 
430
if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
386
431
   BUILDDOC=yes
387
432
else
388
433
   BUILDDOC=no
392
437
 
393
438
AC_MSG_RESULT([$BUILDDOC])
394
439
 
395
 
AC_MSG_CHECKING([Whether to build pdf documentation])
 
440
AC_MSG_CHECKING([whether to build pdf documentation])
396
441
 
397
 
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
 
442
if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
398
443
   BUILDPDFDOC=yes
399
444
else
400
445
   BUILDPDFDOC=no
404
449
 
405
450
AC_MSG_RESULT([$BUILDPDFDOC])
406
451
 
407
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
 
452
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
408
453
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
409
454
MAKE_PDF="$PS2PDF"
410
455
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
424
469
# indicates whether the necessary tools and files are found and, if set,
425
470
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
426
471
AC_DEFUN([XORG_CHECK_DOCBOOK],[
427
 
XORG_SGML_PATH=$prefix/share/sgml
428
 
HAVE_DEFS_ENT=
 
472
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
 
473
 
429
474
BUILDTXTDOC=no
430
475
BUILDPDFDOC=no
431
476
BUILDPSDOC=no
432
477
BUILDHTMLDOC=no
433
478
 
434
 
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
435
 
 
436
479
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
437
480
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
438
481
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
439
482
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
440
483
 
441
 
AC_MSG_CHECKING([Whether to build text documentation])
442
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
 
484
AC_MSG_CHECKING([whether to build text documentation])
 
485
if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
443
486
   test x$BUILD_TXTDOC != xno; then
444
487
        BUILDTXTDOC=yes
445
488
fi
446
489
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
447
490
AC_MSG_RESULT([$BUILDTXTDOC])
448
491
 
449
 
AC_MSG_CHECKING([Whether to build PDF documentation])
450
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
 
492
AC_MSG_CHECKING([whether to build PDF documentation])
 
493
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
451
494
   test x$BUILD_PDFDOC != xno; then
452
495
        BUILDPDFDOC=yes
453
496
fi
454
497
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
455
498
AC_MSG_RESULT([$BUILDPDFDOC])
456
499
 
457
 
AC_MSG_CHECKING([Whether to build PostScript documentation])
458
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
 
500
AC_MSG_CHECKING([whether to build PostScript documentation])
 
501
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
459
502
   test x$BUILD_PSDOC != xno; then
460
503
        BUILDPSDOC=yes
461
504
fi
462
505
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
463
506
AC_MSG_RESULT([$BUILDPSDOC])
464
507
 
465
 
AC_MSG_CHECKING([Whether to build HTML documentation])
466
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
 
508
AC_MSG_CHECKING([whether to build HTML documentation])
 
509
if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
467
510
   test x$BUILD_HTMLDOC != xno; then
468
511
        BUILDHTMLDOC=yes
469
512
fi
481
524
AC_SUBST(MAKE_HTML)
482
525
]) # XORG_CHECK_DOCBOOK
483
526
 
 
527
# XORG_WITH_XMLTO([MIN-VERSION])
 
528
# ----------------
 
529
# Minimum version: 1.5.0
 
530
#
 
531
# Documentation tools are not always available on all platforms and sometimes
 
532
# not at the appropriate level. This macro enables a module to test for the
 
533
# presence of the tool and obtain it's path in separate variables. Coupled with
 
534
# the --with-xmlto option, it allows maximum flexibilty in making decisions
 
535
# as whether or not to use the xmlto package.
 
536
#
 
537
# Interface to module:
 
538
# HAVE_XMLTO:   used in makefiles to conditionally generate documentation
 
539
# XMLTO:        returns the path of the xmlto program found
 
540
#               returns the path set by the user in the environment
 
541
# --with-xmlto: 'yes' user instructs the module to use xmlto
 
542
#               'no' user instructs the module not to use xmlto
 
543
#
 
544
# Added in version 1.10.0
 
545
# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
 
546
#                  xmlto for text output requires either lynx, links, or w3m browsers
 
547
#
 
548
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
 
549
#
 
550
AC_DEFUN([XORG_WITH_XMLTO],[
 
551
AC_ARG_VAR([XMLTO], [Path to xmlto command])
 
552
AC_ARG_WITH(xmlto,
 
553
        AS_HELP_STRING([--with-xmlto],
 
554
           [Use xmlto to regenerate documentation (default: yes, if installed)]),
 
555
           [use_xmlto=$withval], [use_xmlto=auto])
 
556
 
 
557
if test "x$use_xmlto" = x"auto"; then
 
558
   AC_PATH_PROG([XMLTO], [xmlto])
 
559
   if test "x$XMLTO" = "x"; then
 
560
        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
 
561
        have_xmlto=no
 
562
   else
 
563
        have_xmlto=yes
 
564
   fi
 
565
elif test "x$use_xmlto" = x"yes" ; then
 
566
   AC_PATH_PROG([XMLTO], [xmlto])
 
567
   if test "x$XMLTO" = "x"; then
 
568
        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
 
569
   fi
 
570
   have_xmlto=yes
 
571
elif test "x$use_xmlto" = x"no" ; then
 
572
   if test "x$XMLTO" != "x"; then
 
573
      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
 
574
   fi
 
575
   have_xmlto=no
 
576
else
 
577
   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
 
578
fi
 
579
 
 
580
# Test for a minimum version of xmlto, if provided.
 
581
m4_ifval([$1],
 
582
[if test "$have_xmlto" = yes; then
 
583
    # scrape the xmlto version
 
584
    AC_MSG_CHECKING([the xmlto version])
 
585
    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
 
586
    AC_MSG_RESULT([$xmlto_version])
 
587
    AS_VERSION_COMPARE([$xmlto_version], [$1],
 
588
        [if test "x$use_xmlto" = xauto; then
 
589
            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
 
590
            have_xmlto=no
 
591
        else
 
592
            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
 
593
        fi])
 
594
fi])
 
595
 
 
596
# Test for the ability of xmlto to generate a text target
 
597
have_xmlto_text=no
 
598
cat > conftest.xml << "EOF"
 
599
EOF
 
600
AS_IF([test "$have_xmlto" = yes],
 
601
      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
 
602
             [have_xmlto_text=yes],
 
603
             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
 
604
rm -f conftest.xml
 
605
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
 
606
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
 
607
]) # XORG_WITH_XMLTO
 
608
 
 
609
# XORG_WITH_ASCIIDOC([MIN-VERSION])
 
610
# ----------------
 
611
# Minimum version: 1.5.0
 
612
#
 
613
# Documentation tools are not always available on all platforms and sometimes
 
614
# not at the appropriate level. This macro enables a module to test for the
 
615
# presence of the tool and obtain it's path in separate variables. Coupled with
 
616
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
 
617
# as whether or not to use the asciidoc package.
 
618
#
 
619
# Interface to module:
 
620
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
 
621
# ASCIIDOC:      returns the path of the asciidoc program found
 
622
#                returns the path set by the user in the environment
 
623
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
 
624
#                 'no' user instructs the module not to use asciidoc
 
625
#
 
626
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
 
627
#
 
628
AC_DEFUN([XORG_WITH_ASCIIDOC],[
 
629
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
 
630
AC_ARG_WITH(asciidoc,
 
631
        AS_HELP_STRING([--with-asciidoc],
 
632
           [Use asciidoc to regenerate documentation (default: yes, if installed)]),
 
633
           [use_asciidoc=$withval], [use_asciidoc=auto])
 
634
 
 
635
if test "x$use_asciidoc" = x"auto"; then
 
636
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
 
637
   if test "x$ASCIIDOC" = "x"; then
 
638
        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
 
639
        have_asciidoc=no
 
640
   else
 
641
        have_asciidoc=yes
 
642
   fi
 
643
elif test "x$use_asciidoc" = x"yes" ; then
 
644
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
 
645
   if test "x$ASCIIDOC" = "x"; then
 
646
        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
 
647
   fi
 
648
   have_asciidoc=yes
 
649
elif test "x$use_asciidoc" = x"no" ; then
 
650
   if test "x$ASCIIDOC" != "x"; then
 
651
      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
 
652
   fi
 
653
   have_asciidoc=no
 
654
else
 
655
   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
 
656
fi
 
657
m4_ifval([$1],
 
658
[if test "$have_asciidoc" = yes; then
 
659
    # scrape the asciidoc version
 
660
    AC_MSG_CHECKING([the asciidoc version])
 
661
    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
 
662
    AC_MSG_RESULT([$asciidoc_version])
 
663
    AS_VERSION_COMPARE([$asciidoc_version], [$1],
 
664
        [if test "x$use_asciidoc" = xauto; then
 
665
            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
 
666
            have_asciidoc=no
 
667
        else
 
668
            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
 
669
        fi])
 
670
fi])
 
671
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
 
672
]) # XORG_WITH_ASCIIDOC
 
673
 
 
674
# XORG_WITH_DOXYGEN([MIN-VERSION])
 
675
# --------------------------------
 
676
# Minimum version: 1.5.0
 
677
#
 
678
# Documentation tools are not always available on all platforms and sometimes
 
679
# not at the appropriate level. This macro enables a module to test for the
 
680
# presence of the tool and obtain it's path in separate variables. Coupled with
 
681
# the --with-doxygen option, it allows maximum flexibilty in making decisions
 
682
# as whether or not to use the doxygen package.
 
683
#
 
684
# Interface to module:
 
685
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
 
686
# DOXYGEN:       returns the path of the doxygen program found
 
687
#                returns the path set by the user in the environment
 
688
# --with-doxygen: 'yes' user instructs the module to use doxygen
 
689
#                 'no' user instructs the module not to use doxygen
 
690
#
 
691
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
 
692
#
 
693
AC_DEFUN([XORG_WITH_DOXYGEN],[
 
694
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
 
695
AC_ARG_WITH(doxygen,
 
696
        AS_HELP_STRING([--with-doxygen],
 
697
           [Use doxygen to regenerate documentation (default: yes, if installed)]),
 
698
           [use_doxygen=$withval], [use_doxygen=auto])
 
699
 
 
700
if test "x$use_doxygen" = x"auto"; then
 
701
   AC_PATH_PROG([DOXYGEN], [doxygen])
 
702
   if test "x$DOXYGEN" = "x"; then
 
703
        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
 
704
        have_doxygen=no
 
705
   else
 
706
        have_doxygen=yes
 
707
   fi
 
708
elif test "x$use_doxygen" = x"yes" ; then
 
709
   AC_PATH_PROG([DOXYGEN], [doxygen])
 
710
   if test "x$DOXYGEN" = "x"; then
 
711
        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
 
712
   fi
 
713
   have_doxygen=yes
 
714
elif test "x$use_doxygen" = x"no" ; then
 
715
   if test "x$DOXYGEN" != "x"; then
 
716
      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
 
717
   fi
 
718
   have_doxygen=no
 
719
else
 
720
   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
 
721
fi
 
722
m4_ifval([$1],
 
723
[if test "$have_doxygen" = yes; then
 
724
    # scrape the doxygen version
 
725
    AC_MSG_CHECKING([the doxygen version])
 
726
    doxygen_version=`$DOXYGEN --version 2>/dev/null`
 
727
    AC_MSG_RESULT([$doxygen_version])
 
728
    AS_VERSION_COMPARE([$doxygen_version], [$1],
 
729
        [if test "x$use_doxygen" = xauto; then
 
730
            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
 
731
            have_doxygen=no
 
732
        else
 
733
            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
 
734
        fi])
 
735
fi])
 
736
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
 
737
]) # XORG_WITH_DOXYGEN
 
738
 
 
739
# XORG_WITH_GROFF
 
740
# ----------------
 
741
# Minimum version: 1.6.0
 
742
#
 
743
# Documentation tools are not always available on all platforms and sometimes
 
744
# not at the appropriate level. This macro enables a module to test for the
 
745
# presence of the tool and obtain it's path in separate variables. Coupled with
 
746
# the --with-groff option, it allows maximum flexibilty in making decisions
 
747
# as whether or not to use the groff package.
 
748
#
 
749
# Interface to module:
 
750
# HAVE_GROFF:    used in makefiles to conditionally generate documentation
 
751
# HAVE_GROFF_MM: the memorandum macros (-mm) package
 
752
# HAVE_GROFF_MS: the -ms macros package
 
753
# GROFF:         returns the path of the groff program found
 
754
#                returns the path set by the user in the environment
 
755
# --with-groff:  'yes' user instructs the module to use groff
 
756
#                'no' user instructs the module not to use groff
 
757
#
 
758
# Added in version 1.9.0:
 
759
# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
 
760
#                  pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
 
761
#                  psselect from the psutils package.
 
762
#                  the ghostcript package. Refer to the grohtml man pages
 
763
#
 
764
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
 
765
#
 
766
# OS and distros often splits groff in a basic and full package, the former
 
767
# having the groff program and the later having devices, fonts and macros
 
768
# Checking for the groff executable is not enough.
 
769
#
 
770
# If macros are missing, we cannot assume that groff is useless, so we don't
 
771
# unset HAVE_GROFF or GROFF env variables.
 
772
# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
 
773
#
 
774
AC_DEFUN([XORG_WITH_GROFF],[
 
775
AC_ARG_VAR([GROFF], [Path to groff command])
 
776
AC_ARG_WITH(groff,
 
777
        AS_HELP_STRING([--with-groff],
 
778
           [Use groff to regenerate documentation (default: yes, if installed)]),
 
779
           [use_groff=$withval], [use_groff=auto])
 
780
 
 
781
if test "x$use_groff" = x"auto"; then
 
782
   AC_PATH_PROG([GROFF], [groff])
 
783
   if test "x$GROFF" = "x"; then
 
784
        AC_MSG_WARN([groff not found - documentation targets will be skipped])
 
785
        have_groff=no
 
786
   else
 
787
        have_groff=yes
 
788
   fi
 
789
elif test "x$use_groff" = x"yes" ; then
 
790
   AC_PATH_PROG([GROFF], [groff])
 
791
   if test "x$GROFF" = "x"; then
 
792
        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
 
793
   fi
 
794
   have_groff=yes
 
795
elif test "x$use_groff" = x"no" ; then
 
796
   if test "x$GROFF" != "x"; then
 
797
      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
 
798
   fi
 
799
   have_groff=no
 
800
else
 
801
   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
 
802
fi
 
803
 
 
804
# We have groff, test for the presence of the macro packages
 
805
if test "x$have_groff" = x"yes"; then
 
806
    AC_MSG_CHECKING([for ${GROFF} -ms macros])
 
807
    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
 
808
        groff_ms_works=yes
 
809
    else
 
810
        groff_ms_works=no
 
811
    fi
 
812
    AC_MSG_RESULT([$groff_ms_works])
 
813
    AC_MSG_CHECKING([for ${GROFF} -mm macros])
 
814
    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
 
815
        groff_mm_works=yes
 
816
    else
 
817
        groff_mm_works=no
 
818
    fi
 
819
    AC_MSG_RESULT([$groff_mm_works])
 
820
fi
 
821
 
 
822
# We have groff, test for HTML dependencies, one command per package
 
823
if test "x$have_groff" = x"yes"; then
 
824
   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
 
825
   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
 
826
   AC_PATH_PROG(PSSELECT_PATH, [psselect])
 
827
   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
 
828
      have_groff_html=yes
 
829
   else
 
830
      have_groff_html=no
 
831
      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
 
832
   fi
 
833
fi
 
834
 
 
835
# Set Automake conditionals for Makefiles
 
836
AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
 
837
AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
 
838
AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
 
839
AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
 
840
]) # XORG_WITH_GROFF
 
841
 
 
842
# XORG_WITH_FOP
 
843
# ----------------
 
844
# Minimum version: 1.6.0
 
845
#
 
846
# Documentation tools are not always available on all platforms and sometimes
 
847
# not at the appropriate level. This macro enables a module to test for the
 
848
# presence of the tool and obtain it's path in separate variables. Coupled with
 
849
# the --with-fop option, it allows maximum flexibilty in making decisions
 
850
# as whether or not to use the fop package.
 
851
#
 
852
# Interface to module:
 
853
# HAVE_FOP:     used in makefiles to conditionally generate documentation
 
854
# FOP:          returns the path of the fop program found
 
855
#               returns the path set by the user in the environment
 
856
# --with-fop:   'yes' user instructs the module to use fop
 
857
#               'no' user instructs the module not to use fop
 
858
#
 
859
# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
 
860
#
 
861
AC_DEFUN([XORG_WITH_FOP],[
 
862
AC_ARG_VAR([FOP], [Path to fop command])
 
863
AC_ARG_WITH(fop,
 
864
        AS_HELP_STRING([--with-fop],
 
865
           [Use fop to regenerate documentation (default: yes, if installed)]),
 
866
           [use_fop=$withval], [use_fop=auto])
 
867
 
 
868
if test "x$use_fop" = x"auto"; then
 
869
   AC_PATH_PROG([FOP], [fop])
 
870
   if test "x$FOP" = "x"; then
 
871
        AC_MSG_WARN([fop not found - documentation targets will be skipped])
 
872
        have_fop=no
 
873
   else
 
874
        have_fop=yes
 
875
   fi
 
876
elif test "x$use_fop" = x"yes" ; then
 
877
   AC_PATH_PROG([FOP], [fop])
 
878
   if test "x$FOP" = "x"; then
 
879
        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
 
880
   fi
 
881
   have_fop=yes
 
882
elif test "x$use_fop" = x"no" ; then
 
883
   if test "x$FOP" != "x"; then
 
884
      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
 
885
   fi
 
886
   have_fop=no
 
887
else
 
888
   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
 
889
fi
 
890
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
 
891
]) # XORG_WITH_FOP
 
892
 
 
893
# XORG_WITH_PS2PDF
 
894
# ----------------
 
895
# Minimum version: 1.6.0
 
896
#
 
897
# Documentation tools are not always available on all platforms and sometimes
 
898
# not at the appropriate level. This macro enables a module to test for the
 
899
# presence of the tool and obtain it's path in separate variables. Coupled with
 
900
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
 
901
# as whether or not to use the ps2pdf package.
 
902
#
 
903
# Interface to module:
 
904
# HAVE_PS2PDF:  used in makefiles to conditionally generate documentation
 
905
# PS2PDF:       returns the path of the ps2pdf program found
 
906
#               returns the path set by the user in the environment
 
907
# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
 
908
#                'no' user instructs the module not to use ps2pdf
 
909
#
 
910
# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
 
911
#
 
912
AC_DEFUN([XORG_WITH_PS2PDF],[
 
913
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
 
914
AC_ARG_WITH(ps2pdf,
 
915
        AS_HELP_STRING([--with-ps2pdf],
 
916
           [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
 
917
           [use_ps2pdf=$withval], [use_ps2pdf=auto])
 
918
 
 
919
if test "x$use_ps2pdf" = x"auto"; then
 
920
   AC_PATH_PROG([PS2PDF], [ps2pdf])
 
921
   if test "x$PS2PDF" = "x"; then
 
922
        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
 
923
        have_ps2pdf=no
 
924
   else
 
925
        have_ps2pdf=yes
 
926
   fi
 
927
elif test "x$use_ps2pdf" = x"yes" ; then
 
928
   AC_PATH_PROG([PS2PDF], [ps2pdf])
 
929
   if test "x$PS2PDF" = "x"; then
 
930
        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
 
931
   fi
 
932
   have_ps2pdf=yes
 
933
elif test "x$use_ps2pdf" = x"no" ; then
 
934
   if test "x$PS2PDF" != "x"; then
 
935
      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
 
936
   fi
 
937
   have_ps2pdf=no
 
938
else
 
939
   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
 
940
fi
 
941
AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
 
942
]) # XORG_WITH_PS2PDF
 
943
 
 
944
# XORG_ENABLE_DOCS (enable_docs=yes)
 
945
# ----------------
 
946
# Minimum version: 1.6.0
 
947
#
 
948
# Documentation tools are not always available on all platforms and sometimes
 
949
# not at the appropriate level. This macro enables a builder to skip all
 
950
# documentation targets except traditional man pages.
 
951
# Combined with the specific tool checking macros XORG_WITH_*, it provides
 
952
# maximum flexibilty in controlling documentation building.
 
953
# Refer to:
 
954
# XORG_WITH_XMLTO         --with-xmlto
 
955
# XORG_WITH_ASCIIDOC      --with-asciidoc
 
956
# XORG_WITH_DOXYGEN       --with-doxygen
 
957
# XORG_WITH_FOP           --with-fop
 
958
# XORG_WITH_GROFF         --with-groff
 
959
# XORG_WITH_PS2PDF        --with-ps2pdf
 
960
#
 
961
# Interface to module:
 
962
# ENABLE_DOCS:    used in makefiles to conditionally generate documentation
 
963
# --enable-docs: 'yes' user instructs the module to generate docs
 
964
#                'no' user instructs the module not to generate docs
 
965
# parm1:        specify the default value, yes or no.
 
966
#
 
967
AC_DEFUN([XORG_ENABLE_DOCS],[
 
968
default=$1
 
969
if test "x$default" = x ; then
 
970
  default="yes"
 
971
fi
 
972
AC_ARG_ENABLE(docs,
 
973
        AS_HELP_STRING([--enable-docs],
 
974
           [Enable building the documentation (default: yes)]),
 
975
           [build_docs=$enableval], [build_docs=$default])
 
976
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
 
977
AC_MSG_CHECKING([whether to build documentation])
 
978
AC_MSG_RESULT([$build_docs])
 
979
]) # XORG_ENABLE_DOCS
 
980
 
 
981
# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
 
982
# ----------------
 
983
# Minimum version: 1.6.0
 
984
#
 
985
# This macro enables a builder to skip all developer documentation.
 
986
# Combined with the specific tool checking macros XORG_WITH_*, it provides
 
987
# maximum flexibilty in controlling documentation building.
 
988
# Refer to:
 
989
# XORG_WITH_XMLTO         --with-xmlto
 
990
# XORG_WITH_ASCIIDOC      --with-asciidoc
 
991
# XORG_WITH_DOXYGEN       --with-doxygen
 
992
# XORG_WITH_FOP           --with-fop
 
993
# XORG_WITH_GROFF         --with-groff
 
994
# XORG_WITH_PS2PDF        --with-ps2pdf
 
995
#
 
996
# Interface to module:
 
997
# ENABLE_DEVEL_DOCS:    used in makefiles to conditionally generate developer docs
 
998
# --enable-devel-docs:  'yes' user instructs the module to generate developer docs
 
999
#                       'no' user instructs the module not to generate developer docs
 
1000
# parm1:                specify the default value, yes or no.
 
1001
#
 
1002
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
 
1003
devel_default=$1
 
1004
if test "x$devel_default" = x ; then
 
1005
  devel_default="yes"
 
1006
fi
 
1007
AC_ARG_ENABLE(devel-docs,
 
1008
        AS_HELP_STRING([--enable-devel-docs],
 
1009
           [Enable building the developer documentation (default: yes)]),
 
1010
           [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
 
1011
AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
 
1012
AC_MSG_CHECKING([whether to build developer documentation])
 
1013
AC_MSG_RESULT([$build_devel_docs])
 
1014
]) # XORG_ENABLE_DEVEL_DOCS
 
1015
 
 
1016
# XORG_ENABLE_SPECS (enable_specs=yes)
 
1017
# ----------------
 
1018
# Minimum version: 1.6.0
 
1019
#
 
1020
# This macro enables a builder to skip all functional specification targets.
 
1021
# Combined with the specific tool checking macros XORG_WITH_*, it provides
 
1022
# maximum flexibilty in controlling documentation building.
 
1023
# Refer to:
 
1024
# XORG_WITH_XMLTO         --with-xmlto
 
1025
# XORG_WITH_ASCIIDOC      --with-asciidoc
 
1026
# XORG_WITH_DOXYGEN       --with-doxygen
 
1027
# XORG_WITH_FOP           --with-fop
 
1028
# XORG_WITH_GROFF         --with-groff
 
1029
# XORG_WITH_PS2PDF        --with-ps2pdf
 
1030
#
 
1031
# Interface to module:
 
1032
# ENABLE_SPECS:         used in makefiles to conditionally generate specs
 
1033
# --enable-specs:       'yes' user instructs the module to generate specs
 
1034
#                       'no' user instructs the module not to generate specs
 
1035
# parm1:                specify the default value, yes or no.
 
1036
#
 
1037
AC_DEFUN([XORG_ENABLE_SPECS],[
 
1038
spec_default=$1
 
1039
if test "x$spec_default" = x ; then
 
1040
  spec_default="yes"
 
1041
fi
 
1042
AC_ARG_ENABLE(specs,
 
1043
        AS_HELP_STRING([--enable-specs],
 
1044
           [Enable building the specs (default: yes)]),
 
1045
           [build_specs=$enableval], [build_specs=$spec_default])
 
1046
AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
 
1047
AC_MSG_CHECKING([whether to build functional specifications])
 
1048
AC_MSG_RESULT([$build_specs])
 
1049
]) # XORG_ENABLE_SPECS
 
1050
 
484
1051
# XORG_CHECK_MALLOC_ZERO
485
1052
# ----------------------
486
1053
# Minimum version: 1.0.0
490
1057
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
491
1058
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
492
1059
AC_ARG_ENABLE(malloc0returnsnull,
493
 
        AC_HELP_STRING([--enable-malloc0returnsnull],
 
1060
        AS_HELP_STRING([--enable-malloc0returnsnull],
494
1061
                       [malloc(0) returns NULL (default: auto)]),
495
1062
        [MALLOC_ZERO_RETURNS_NULL=$enableval],
496
1063
        [MALLOC_ZERO_RETURNS_NULL=auto])
510
1077
    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
511
1078
}],
512
1079
                [MALLOC_ZERO_RETURNS_NULL=yes],
513
 
                [MALLOC_ZERO_RETURNS_NULL=no])
 
1080
                [MALLOC_ZERO_RETURNS_NULL=no],
 
1081
                [MALLOC_ZERO_RETURNS_NULL=yes])
514
1082
fi
515
1083
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
516
1084
 
533
1101
# ----------------
534
1102
# Minimum version: 1.1.0
535
1103
#
536
 
# Sets up flags for source checkers such as lint and sparse if --with-lint
537
 
# is specified.   (Use --with-lint=sparse for sparse.)
538
 
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
539
 
# Sets $LINT_FLAGS to flags to pass to source checker
540
 
# Sets LINT automake conditional if enabled (default: disabled)
 
1104
# This macro enables the use of a tool that flags some suspicious and
 
1105
# non-portable constructs (likely to be bugs) in C language source code.
 
1106
# It will attempt to locate the tool and use appropriate options.
 
1107
# There are various lint type tools on different platforms.
 
1108
#
 
1109
# Interface to module:
 
1110
# LINT:         returns the path to the tool found on the platform
 
1111
#               or the value set to LINT on the configure cmd line
 
1112
#               also an Automake conditional
 
1113
# LINT_FLAGS:   an Automake variable with appropriate flags
 
1114
#
 
1115
# --with-lint:  'yes' user instructs the module to use lint
 
1116
#               'no' user instructs the module not to use lint (default)
 
1117
#
 
1118
# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
 
1119
# If the user sets the value of LINT_FLAGS, they are used verbatim.
541
1120
#
542
1121
AC_DEFUN([XORG_WITH_LINT],[
543
1122
 
544
 
# Allow checking code with lint, sparse, etc.
545
 
AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
 
1123
AC_ARG_VAR([LINT], [Path to a lint-style command])
 
1124
AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
 
1125
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
546
1126
                [Use a lint-style source code checker (default: disabled)])],
547
1127
                [use_lint=$withval], [use_lint=no])
548
 
if test "x$use_lint" = "xyes" ; then
549
 
        LINT="lint"
 
1128
 
 
1129
# Obtain platform specific info like program name and options
 
1130
# The lint program on FreeBSD and NetBSD is different from the one on Solaris
 
1131
case $host_os in
 
1132
  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
 
1133
        lint_name=splint
 
1134
        lint_options="-badflag"
 
1135
        ;;
 
1136
  *freebsd* | *netbsd*)
 
1137
        lint_name=lint
 
1138
        lint_options="-u -b"
 
1139
        ;;
 
1140
  *solaris*)
 
1141
        lint_name=lint
 
1142
        lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
 
1143
        ;;
 
1144
esac
 
1145
 
 
1146
# Test for the presence of the program (either guessed by the code or spelled out by the user)
 
1147
if test "x$use_lint" = x"yes" ; then
 
1148
   AC_PATH_PROG([LINT], [$lint_name])
 
1149
   if test "x$LINT" = "x"; then
 
1150
        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
 
1151
   fi
 
1152
elif test "x$use_lint" = x"no" ; then
 
1153
   if test "x$LINT" != "x"; then
 
1154
      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
 
1155
   fi
550
1156
else
551
 
        LINT="$use_lint"
552
 
fi
553
 
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
554
 
    case $LINT in
555
 
        lint|*/lint)
556
 
            case $host_os in
557
 
                solaris*)
558
 
                        LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
559
 
                        ;;
560
 
            esac
561
 
            ;;
562
 
    esac
563
 
fi
564
 
 
565
 
AC_SUBST(LINT)
566
 
AC_SUBST(LINT_FLAGS)
567
 
AM_CONDITIONAL(LINT, [test x$LINT != xno])
 
1157
   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
 
1158
fi
 
1159
 
 
1160
# User supplied flags override default flags
 
1161
if test "x$LINT_FLAGS" != "x"; then
 
1162
   lint_options=$LINT_FLAGS
 
1163
fi
 
1164
 
 
1165
AC_SUBST([LINT_FLAGS],[$lint_options])
 
1166
AM_CONDITIONAL(LINT, [test "x$LINT" != x])
568
1167
 
569
1168
]) # XORG_WITH_LINT
570
1169
 
574
1173
#
575
1174
# Sets up flags for building lint libraries for checking programs that call
576
1175
# functions in the library.
577
 
# Disabled by default, enable with --enable-lint-library
578
 
# Sets: 
579
 
#       @LINTLIB@               - name of lint library file to make
580
 
#       MAKE_LINT_LIB           - automake conditional
581
 
#
 
1176
#
 
1177
# Interface to module:
 
1178
# LINTLIB               - Automake variable with the name of lint library file to make
 
1179
# MAKE_LINT_LIB         - Automake conditional
 
1180
#
 
1181
# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
 
1182
#                         - 'no' user instructs the module not to create a lint library (default)
582
1183
 
583
1184
AC_DEFUN([XORG_LINT_LIBRARY],[
584
1185
AC_REQUIRE([XORG_WITH_LINT])
585
 
# Build lint "library" for more indepth checks of programs calling this library
586
 
AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
 
1186
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
587
1187
        [Create lint library (default: disabled)])],
588
1188
        [make_lint_lib=$enableval], [make_lint_lib=no])
589
 
if test "x$make_lint_lib" != "xno" ; then
590
 
        if test "x$LINT" = "xno" ; then
591
 
                AC_MSG_ERROR([Cannot make lint library without --with-lint])
592
 
        fi
593
 
        if test "x$make_lint_lib" = "xyes" ; then
594
 
                LINTLIB=llib-l$1.ln
595
 
        else
596
 
                LINTLIB=$make_lint_lib
597
 
        fi
 
1189
 
 
1190
if test "x$make_lint_lib" = x"yes" ; then
 
1191
   LINTLIB=llib-l$1.ln
 
1192
   if test "x$LINT" = "x"; then
 
1193
        AC_MSG_ERROR([Cannot make lint library without --with-lint])
 
1194
   fi
 
1195
elif test "x$make_lint_lib" != x"no" ; then
 
1196
   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
598
1197
fi
 
1198
 
599
1199
AC_SUBST(LINTLIB)
600
1200
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
601
1201
 
602
1202
]) # XORG_LINT_LIBRARY
603
1203
 
604
 
# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 
1204
# XORG_CWARNFLAGS
 
1205
# ---------------
 
1206
# Minimum version: 1.2.0
 
1207
#
 
1208
# Defines CWARNFLAGS to enable C compiler warnings.
 
1209
#
 
1210
AC_DEFUN([XORG_CWARNFLAGS], [
 
1211
AC_REQUIRE([AC_PROG_CC_C99])
 
1212
if  test "x$GCC" = xyes ; then
 
1213
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
 
1214
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
 
1215
-Wbad-function-cast -Wformat=2"
 
1216
    case `$CC -dumpversion` in
 
1217
    3.4.* | 4.*)
 
1218
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
 
1219
        ;;
 
1220
    esac
 
1221
else
 
1222
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
1223
    if test "x$SUNCC" = "xyes"; then
 
1224
        CWARNFLAGS="-v"
 
1225
    fi
 
1226
fi
 
1227
AC_SUBST(CWARNFLAGS)
 
1228
]) # XORG_CWARNFLAGS
 
1229
 
 
1230
# XORG_STRICT_OPTION
 
1231
# -----------------------
 
1232
# Minimum version: 1.3.0
 
1233
#
 
1234
# Add configure option to enable strict compilation
 
1235
AC_DEFUN([XORG_STRICT_OPTION], [
 
1236
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
 
1237
AC_REQUIRE([AC_PROG_CC_C99])
 
1238
AC_REQUIRE([XORG_CWARNFLAGS])
 
1239
 
 
1240
AC_ARG_ENABLE(strict-compilation,
 
1241
                          AS_HELP_STRING([--enable-strict-compilation],
 
1242
                          [Enable all warnings from compiler and make them errors (default: disabled)]),
 
1243
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
 
1244
if test "x$STRICT_COMPILE" = "xyes"; then
 
1245
        AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
1246
        AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
 
1247
        if test "x$GCC" = xyes ; then
 
1248
                STRICT_CFLAGS="-pedantic -Werror"
 
1249
        elif test "x$SUNCC" = "xyes"; then
 
1250
                STRICT_CFLAGS="-errwarn"
 
1251
    elif test "x$INTELCC" = "xyes"; then
 
1252
                STRICT_CFLAGS="-Werror"
 
1253
        fi
 
1254
fi
 
1255
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
 
1256
AC_SUBST([CWARNFLAGS])
 
1257
]) # XORG_STRICT_OPTION
 
1258
 
 
1259
# XORG_DEFAULT_OPTIONS
 
1260
# --------------------
 
1261
# Minimum version: 1.3.0
 
1262
#
 
1263
# Defines default options for X.Org modules.
 
1264
#
 
1265
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
 
1266
AC_REQUIRE([AC_PROG_INSTALL])
 
1267
XORG_CWARNFLAGS
 
1268
XORG_STRICT_OPTION
 
1269
XORG_RELEASE_VERSION
 
1270
XORG_CHANGELOG
 
1271
XORG_INSTALL
 
1272
XORG_MANPAGE_SECTIONS
 
1273
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
 
1274
    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
 
1275
]) # XORG_DEFAULT_OPTIONS
 
1276
 
 
1277
# XORG_INSTALL()
 
1278
# ----------------
 
1279
# Minimum version: 1.4.0
 
1280
#
 
1281
# Defines the variable INSTALL_CMD as the command to copy
 
1282
# INSTALL from $prefix/share/util-macros.
 
1283
#
 
1284
AC_DEFUN([XORG_INSTALL], [
 
1285
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1286
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
 
1287
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
 
1288
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
 
1289
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
 
1290
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
 
1291
AC_SUBST([INSTALL_CMD])
 
1292
]) # XORG_INSTALL
 
1293
dnl Copyright 2005 Red Hat, Inc
 
1294
dnl
 
1295
dnl Permission to use, copy, modify, distribute, and sell this software and its
 
1296
dnl documentation for any purpose is hereby granted without fee, provided that
 
1297
dnl the above copyright notice appear in all copies and that both that
 
1298
dnl copyright notice and this permission notice appear in supporting
 
1299
dnl documentation.
 
1300
dnl
 
1301
dnl The above copyright notice and this permission notice shall be included
 
1302
dnl in all copies or substantial portions of the Software.
 
1303
dnl
 
1304
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
1305
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
1306
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
1307
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
1308
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
1309
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
1310
dnl OTHER DEALINGS IN THE SOFTWARE.
 
1311
dnl
 
1312
dnl Except as contained in this notice, the name of the copyright holders shall
 
1313
dnl not be used in advertising or otherwise to promote the sale, use or
 
1314
dnl other dealings in this Software without prior written authorization
 
1315
dnl from the copyright holders.
 
1316
dnl
 
1317
 
 
1318
# XORG_RELEASE_VERSION
 
1319
# --------------------
 
1320
# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
 
1321
 
 
1322
AC_DEFUN([XORG_RELEASE_VERSION],[
 
1323
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
 
1324
                [`echo $PACKAGE_VERSION | cut -d . -f 1`],
 
1325
                [Major version of this package])
 
1326
        PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
 
1327
        if test "x$PVM" = "x"; then
 
1328
                PVM="0"
 
1329
        fi
 
1330
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
 
1331
                [$PVM],
 
1332
                [Minor version of this package])
 
1333
        PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
 
1334
        if test "x$PVP" = "x"; then
 
1335
                PVP="0"
 
1336
        fi
 
1337
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
 
1338
                [$PVP],
 
1339
                [Patch version of this package])
 
1340
])
 
1341
 
 
1342
# XORG_CHANGELOG()
 
1343
# ----------------
 
1344
# Minimum version: 1.2.0
 
1345
#
 
1346
# Defines the variable CHANGELOG_CMD as the command to generate
 
1347
# ChangeLog from git.
 
1348
#
 
1349
#
 
1350
AC_DEFUN([XORG_CHANGELOG], [
 
1351
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
 
1352
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
 
1353
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
 
1354
echo 'git directory not found: installing possibly empty changelog.' >&2)"
 
1355
AC_SUBST([CHANGELOG_CMD])
 
1356
]) # XORG_CHANGELOG
 
1357
 
 
1358
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
605
1359
#
606
1360
# This file is free software; the Free Software Foundation
607
1361
# gives unlimited permission to copy and/or distribute it,
613
1367
# generated from the m4 files accompanying Automake X.Y.
614
1368
# (This private macro should not be called outside this file.)
615
1369
AC_DEFUN([AM_AUTOMAKE_VERSION],
616
 
[am__api_version='1.10'
 
1370
[am__api_version='1.11'
617
1371
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
618
1372
dnl require some minimum version.  Point them to the right macro.
619
 
m4_if([$1], [1.10.1], [],
 
1373
m4_if([$1], [1.11.1], [],
620
1374
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
621
1375
])
622
1376
 
630
1384
# AM_SET_CURRENT_AUTOMAKE_VERSION
631
1385
# -------------------------------
632
1386
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
633
 
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 
1387
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
634
1388
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
635
 
[AM_AUTOMAKE_VERSION([1.10.1])dnl
 
1389
[AM_AUTOMAKE_VERSION([1.11.1])dnl
636
1390
m4_ifndef([AC_AUTOCONF_VERSION],
637
1391
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
638
 
_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
 
1392
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
639
1393
 
640
1394
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
641
1395
 
692
1446
 
693
1447
# AM_CONDITIONAL                                            -*- Autoconf -*-
694
1448
 
695
 
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
 
1449
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
696
1450
# Free Software Foundation, Inc.
697
1451
#
698
1452
# This file is free software; the Free Software Foundation
699
1453
# gives unlimited permission to copy and/or distribute it,
700
1454
# with or without modifications, as long as this notice is preserved.
701
1455
 
702
 
# serial 8
 
1456
# serial 9
703
1457
 
704
1458
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
705
1459
# -------------------------------------
712
1466
AC_SUBST([$1_FALSE])dnl
713
1467
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
714
1468
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
 
1469
m4_define([_AM_COND_VALUE_$1], [$2])dnl
715
1470
if $2; then
716
1471
  $1_TRUE=
717
1472
  $1_FALSE='#'
725
1480
Usually this means the macro was only invoked conditionally.]])
726
1481
fi])])
727
1482
 
728
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
1483
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
729
1484
# Free Software Foundation, Inc.
730
1485
#
731
1486
# This file is free software; the Free Software Foundation
732
1487
# gives unlimited permission to copy and/or distribute it,
733
1488
# with or without modifications, as long as this notice is preserved.
734
1489
 
735
 
# serial 9
 
1490
# serial 10
736
1491
 
737
1492
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
738
1493
# written in clear, in which case automake, when reading aclocal.m4,
789
1544
  if test "$am_compiler_list" = ""; then
790
1545
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
791
1546
  fi
 
1547
  am__universal=false
 
1548
  m4_case([$1], [CC],
 
1549
    [case " $depcc " in #(
 
1550
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
 
1551
     esac],
 
1552
    [CXX],
 
1553
    [case " $depcc " in #(
 
1554
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
 
1555
     esac])
 
1556
 
792
1557
  for depmode in $am_compiler_list; do
793
1558
    # Setup a source with many dependencies, because some compilers
794
1559
    # like to wrap large dependency lists on column 80 (with \), and
806
1571
    done
807
1572
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
808
1573
 
 
1574
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
 
1575
    # mode.  It turns out that the SunPro C++ compiler does not properly
 
1576
    # handle `-M -o', and we need to detect this.  Also, some Intel
 
1577
    # versions had trouble with output in subdirs
 
1578
    am__obj=sub/conftest.${OBJEXT-o}
 
1579
    am__minus_obj="-o $am__obj"
809
1580
    case $depmode in
 
1581
    gcc)
 
1582
      # This depmode causes a compiler race in universal mode.
 
1583
      test "$am__universal" = false || continue
 
1584
      ;;
810
1585
    nosideeffect)
811
1586
      # after this tag, mechanisms are not by side-effect, so they'll
812
1587
      # only be used when explicitly requested
816
1591
        break
817
1592
      fi
818
1593
      ;;
 
1594
    msvisualcpp | msvcmsys)
 
1595
      # This compiler won't grok `-c -o', but also, the minuso test has
 
1596
      # not run yet.  These depmodes are late enough in the game, and
 
1597
      # so weak that their functioning should not be impacted.
 
1598
      am__obj=conftest.${OBJEXT-o}
 
1599
      am__minus_obj=
 
1600
      ;;
819
1601
    none) break ;;
820
1602
    esac
821
 
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
822
 
    # mode.  It turns out that the SunPro C++ compiler does not properly
823
 
    # handle `-M -o', and we need to detect this.
824
1603
    if depmode=$depmode \
825
 
       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
 
1604
       source=sub/conftest.c object=$am__obj \
826
1605
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
827
 
       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
 
1606
       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
828
1607
         >/dev/null 2>conftest.err &&
829
1608
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
830
1609
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
831
 
       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
 
1610
       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
832
1611
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
833
1612
      # icc doesn't choke on unknown options, it will just issue warnings
834
1613
      # or remarks (even with -Werror).  So we grep stderr for any message
885
1664
 
886
1665
# Generate code to set up dependency tracking.              -*- Autoconf -*-
887
1666
 
888
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
 
1667
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
889
1668
# Free Software Foundation, Inc.
890
1669
#
891
1670
# This file is free software; the Free Software Foundation
892
1671
# gives unlimited permission to copy and/or distribute it,
893
1672
# with or without modifications, as long as this notice is preserved.
894
1673
 
895
 
#serial 3
 
1674
#serial 5
896
1675
 
897
1676
# _AM_OUTPUT_DEPENDENCY_COMMANDS
898
1677
# ------------------------------
899
1678
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
900
 
[for mf in $CONFIG_FILES; do
901
 
  # Strip MF so we end up with the name of the file.
902
 
  mf=`echo "$mf" | sed -e 's/:.*$//'`
903
 
  # Check whether this is an Automake generated Makefile or not.
904
 
  # We used to match only the files named `Makefile.in', but
905
 
  # some people rename them; so instead we look at the file content.
906
 
  # Grep'ing the first line is not enough: some people post-process
907
 
  # each Makefile.in and add a new line on top of each file to say so.
908
 
  # Grep'ing the whole file is not good either: AIX grep has a line
909
 
  # limit of 2048, but all sed's we know have understand at least 4000.
910
 
  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
911
 
    dirpart=`AS_DIRNAME("$mf")`
912
 
  else
913
 
    continue
914
 
  fi
915
 
  # Extract the definition of DEPDIR, am__include, and am__quote
916
 
  # from the Makefile without running `make'.
917
 
  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
918
 
  test -z "$DEPDIR" && continue
919
 
  am__include=`sed -n 's/^am__include = //p' < "$mf"`
920
 
  test -z "am__include" && continue
921
 
  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
922
 
  # When using ansi2knr, U may be empty or an underscore; expand it
923
 
  U=`sed -n 's/^U = //p' < "$mf"`
924
 
  # Find all dependency output files, they are included files with
925
 
  # $(DEPDIR) in their names.  We invoke sed twice because it is the
926
 
  # simplest approach to changing $(DEPDIR) to its actual value in the
927
 
  # expansion.
928
 
  for file in `sed -n "
929
 
    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
930
 
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
931
 
    # Make sure the directory exists.
932
 
    test -f "$dirpart/$file" && continue
933
 
    fdir=`AS_DIRNAME(["$file"])`
934
 
    AS_MKDIR_P([$dirpart/$fdir])
935
 
    # echo "creating $dirpart/$file"
936
 
    echo '# dummy' > "$dirpart/$file"
 
1679
[{
 
1680
  # Autoconf 2.62 quotes --file arguments for eval, but not when files
 
1681
  # are listed without --file.  Let's play safe and only enable the eval
 
1682
  # if we detect the quoting.
 
1683
  case $CONFIG_FILES in
 
1684
  *\'*) eval set x "$CONFIG_FILES" ;;
 
1685
  *)   set x $CONFIG_FILES ;;
 
1686
  esac
 
1687
  shift
 
1688
  for mf
 
1689
  do
 
1690
    # Strip MF so we end up with the name of the file.
 
1691
    mf=`echo "$mf" | sed -e 's/:.*$//'`
 
1692
    # Check whether this is an Automake generated Makefile or not.
 
1693
    # We used to match only the files named `Makefile.in', but
 
1694
    # some people rename them; so instead we look at the file content.
 
1695
    # Grep'ing the first line is not enough: some people post-process
 
1696
    # each Makefile.in and add a new line on top of each file to say so.
 
1697
    # Grep'ing the whole file is not good either: AIX grep has a line
 
1698
    # limit of 2048, but all sed's we know have understand at least 4000.
 
1699
    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
 
1700
      dirpart=`AS_DIRNAME("$mf")`
 
1701
    else
 
1702
      continue
 
1703
    fi
 
1704
    # Extract the definition of DEPDIR, am__include, and am__quote
 
1705
    # from the Makefile without running `make'.
 
1706
    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
 
1707
    test -z "$DEPDIR" && continue
 
1708
    am__include=`sed -n 's/^am__include = //p' < "$mf"`
 
1709
    test -z "am__include" && continue
 
1710
    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
 
1711
    # When using ansi2knr, U may be empty or an underscore; expand it
 
1712
    U=`sed -n 's/^U = //p' < "$mf"`
 
1713
    # Find all dependency output files, they are included files with
 
1714
    # $(DEPDIR) in their names.  We invoke sed twice because it is the
 
1715
    # simplest approach to changing $(DEPDIR) to its actual value in the
 
1716
    # expansion.
 
1717
    for file in `sed -n "
 
1718
      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
 
1719
         sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
 
1720
      # Make sure the directory exists.
 
1721
      test -f "$dirpart/$file" && continue
 
1722
      fdir=`AS_DIRNAME(["$file"])`
 
1723
      AS_MKDIR_P([$dirpart/$fdir])
 
1724
      # echo "creating $dirpart/$file"
 
1725
      echo '# dummy' > "$dirpart/$file"
 
1726
    done
937
1727
  done
938
 
done
 
1728
}
939
1729
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
940
1730
 
941
1731
 
967
1757
# Do all the work for Automake.                             -*- Autoconf -*-
968
1758
 
969
1759
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
970
 
# 2005, 2006, 2008 Free Software Foundation, Inc.
 
1760
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
971
1761
#
972
1762
# This file is free software; the Free Software Foundation
973
1763
# gives unlimited permission to copy and/or distribute it,
974
1764
# with or without modifications, as long as this notice is preserved.
975
1765
 
976
 
# serial 13
 
1766
# serial 16
977
1767
 
978
1768
# This macro actually does too much.  Some checks are only needed if
979
1769
# your package does certain things.  But this isn't really a big deal.
990
1780
# arguments mandatory, and then we can depend on a new Autoconf
991
1781
# release and drop the old call support.
992
1782
AC_DEFUN([AM_INIT_AUTOMAKE],
993
 
[AC_PREREQ([2.60])dnl
 
1783
[AC_PREREQ([2.62])dnl
994
1784
dnl Autoconf wants to disallow AM_ names.  We explicitly allow
995
1785
dnl the ones we care about.
996
1786
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1041
1831
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1042
1832
AM_MISSING_PROG(AUTOHEADER, autoheader)
1043
1833
AM_MISSING_PROG(MAKEINFO, makeinfo)
1044
 
AM_PROG_INSTALL_SH
1045
 
AM_PROG_INSTALL_STRIP
 
1834
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 
1835
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1046
1836
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1047
1837
# We need awk for the "check" target.  The system "awk" is bad on
1048
1838
# some platforms.
1050
1840
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1051
1841
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1052
1842
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1053
 
              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1054
 
                             [_AM_PROG_TAR([v7])])])
 
1843
              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
 
1844
                             [_AM_PROG_TAR([v7])])])
1055
1845
_AM_IF_OPTION([no-dependencies],,
1056
1846
[AC_PROVIDE_IFELSE([AC_PROG_CC],
1057
 
                  [_AM_DEPENDENCIES(CC)],
1058
 
                  [define([AC_PROG_CC],
1059
 
                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 
1847
                  [_AM_DEPENDENCIES(CC)],
 
1848
                  [define([AC_PROG_CC],
 
1849
                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1060
1850
AC_PROVIDE_IFELSE([AC_PROG_CXX],
1061
 
                  [_AM_DEPENDENCIES(CXX)],
1062
 
                  [define([AC_PROG_CXX],
1063
 
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 
1851
                  [_AM_DEPENDENCIES(CXX)],
 
1852
                  [define([AC_PROG_CXX],
 
1853
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1064
1854
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1065
 
                  [_AM_DEPENDENCIES(OBJC)],
1066
 
                  [define([AC_PROG_OBJC],
1067
 
                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1068
 
])
1069
 
])
 
1855
                  [_AM_DEPENDENCIES(OBJC)],
 
1856
                  [define([AC_PROG_OBJC],
 
1857
                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 
1858
])
 
1859
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
 
1860
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
 
1861
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
 
1862
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
 
1863
AC_CONFIG_COMMANDS_PRE(dnl
 
1864
[m4_provide_if([_AM_COMPILER_EXEEXT],
 
1865
  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 
1866
])
 
1867
 
 
1868
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 
1869
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 
1870
dnl mangled by Autoconf and run in a shell conditional statement.
 
1871
m4_define([_AC_COMPILER_EXEEXT],
 
1872
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1070
1873
 
1071
1874
 
1072
1875
# When config.status generates a header, we must update the stamp-h file.
1090
1893
done
1091
1894
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1092
1895
 
1093
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
1896
# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1094
1897
#
1095
1898
# This file is free software; the Free Software Foundation
1096
1899
# gives unlimited permission to copy and/or distribute it,
1101
1904
# Define $install_sh.
1102
1905
AC_DEFUN([AM_PROG_INSTALL_SH],
1103
1906
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1104
 
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
 
1907
if test x"${install_sh}" != xset; then
 
1908
  case $am_aux_dir in
 
1909
  *\ * | *\     *)
 
1910
    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
 
1911
  *)
 
1912
    install_sh="\${SHELL} $am_aux_dir/install-sh"
 
1913
  esac
 
1914
fi
1105
1915
AC_SUBST(install_sh)])
1106
1916
 
1107
1917
# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1128
1938
# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1129
1939
# From Jim Meyering
1130
1940
 
1131
 
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
 
1941
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1132
1942
# Free Software Foundation, Inc.
1133
1943
#
1134
1944
# This file is free software; the Free Software Foundation
1135
1945
# gives unlimited permission to copy and/or distribute it,
1136
1946
# with or without modifications, as long as this notice is preserved.
1137
1947
 
1138
 
# serial 4
 
1948
# serial 5
1139
1949
 
 
1950
# AM_MAINTAINER_MODE([DEFAULT-MODE])
 
1951
# ----------------------------------
 
1952
# Control maintainer-specific portions of Makefiles.
 
1953
# Default is to disable them, unless `enable' is passed literally.
 
1954
# For symmetry, `disable' may be passed as well.  Anyway, the user
 
1955
# can override the default with the --enable/--disable switch.
1140
1956
AC_DEFUN([AM_MAINTAINER_MODE],
1141
 
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1142
 
  dnl maintainer-mode is disabled by default
1143
 
  AC_ARG_ENABLE(maintainer-mode,
1144
 
[  --enable-maintainer-mode  enable make rules and dependencies not useful
 
1957
[m4_case(m4_default([$1], [disable]),
 
1958
       [enable], [m4_define([am_maintainer_other], [disable])],
 
1959
       [disable], [m4_define([am_maintainer_other], [enable])],
 
1960
       [m4_define([am_maintainer_other], [enable])
 
1961
        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
 
1962
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
 
1963
  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
 
1964
  AC_ARG_ENABLE([maintainer-mode],
 
1965
[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
1145
1966
                          (and sometimes confusing) to the casual installer],
1146
 
      USE_MAINTAINER_MODE=$enableval,
1147
 
      USE_MAINTAINER_MODE=no)
 
1967
      [USE_MAINTAINER_MODE=$enableval],
 
1968
      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
1148
1969
  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1149
 
  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
 
1970
  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
1150
1971
  MAINT=$MAINTAINER_MODE_TRUE
1151
 
  AC_SUBST(MAINT)dnl
 
1972
  AC_SUBST([MAINT])dnl
1152
1973
]
1153
1974
)
1154
1975
 
1156
1977
 
1157
1978
# Check to see how 'make' treats includes.                  -*- Autoconf -*-
1158
1979
 
1159
 
# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
 
1980
# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1160
1981
#
1161
1982
# This file is free software; the Free Software Foundation
1162
1983
# gives unlimited permission to copy and/or distribute it,
1163
1984
# with or without modifications, as long as this notice is preserved.
1164
1985
 
1165
 
# serial 3
 
1986
# serial 4
1166
1987
 
1167
1988
# AM_MAKE_INCLUDE()
1168
1989
# -----------------
1171
1992
[am_make=${MAKE-make}
1172
1993
cat > confinc << 'END'
1173
1994
am__doit:
1174
 
        @echo done
 
1995
        @echo this is the am__doit target
1175
1996
.PHONY: am__doit
1176
1997
END
1177
1998
# If we don't find an include directive, just comment out the code.
1181
2002
_am_result=none
1182
2003
# First try GNU make style include.
1183
2004
echo "include confinc" > confmf
1184
 
# We grep out `Entering directory' and `Leaving directory'
1185
 
# messages which can occur if `w' ends up in MAKEFLAGS.
1186
 
# In particular we don't look at `^make:' because GNU make might
1187
 
# be invoked under some other name (usually "gmake"), in which
1188
 
# case it prints its new name instead of `make'.
1189
 
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1190
 
   am__include=include
1191
 
   am__quote=
1192
 
   _am_result=GNU
1193
 
fi
 
2005
# Ignore all kinds of additional output from `make'.
 
2006
case `$am_make -s -f confmf 2> /dev/null` in #(
 
2007
*the\ am__doit\ target*)
 
2008
  am__include=include
 
2009
  am__quote=
 
2010
  _am_result=GNU
 
2011
  ;;
 
2012
esac
1194
2013
# Now try BSD make style include.
1195
2014
if test "$am__include" = "#"; then
1196
2015
   echo '.include "confinc"' > confmf
1197
 
   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1198
 
      am__include=.include
1199
 
      am__quote="\""
1200
 
      _am_result=BSD
1201
 
   fi
 
2016
   case `$am_make -s -f confmf 2> /dev/null` in #(
 
2017
   *the\ am__doit\ target*)
 
2018
     am__include=.include
 
2019
     am__quote="\""
 
2020
     _am_result=BSD
 
2021
     ;;
 
2022
   esac
1202
2023
fi
1203
2024
AC_SUBST([am__include])
1204
2025
AC_SUBST([am__quote])
1208
2029
 
1209
2030
# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1210
2031
 
1211
 
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
 
2032
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1212
2033
# Free Software Foundation, Inc.
1213
2034
#
1214
2035
# This file is free software; the Free Software Foundation
1215
2036
# gives unlimited permission to copy and/or distribute it,
1216
2037
# with or without modifications, as long as this notice is preserved.
1217
2038
 
1218
 
# serial 5
 
2039
# serial 6
1219
2040
 
1220
2041
# AM_MISSING_PROG(NAME, PROGRAM)
1221
2042
# ------------------------------
1232
2053
AC_DEFUN([AM_MISSING_HAS_RUN],
1233
2054
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1234
2055
AC_REQUIRE_AUX_FILE([missing])dnl
1235
 
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 
2056
if test x"${MISSING+set}" != xset; then
 
2057
  case $am_aux_dir in
 
2058
  *\ * | *\     *)
 
2059
    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
 
2060
  *)
 
2061
    MISSING="\${SHELL} $am_aux_dir/missing" ;;
 
2062
  esac
 
2063
fi
1236
2064
# Use eval to expand $SHELL
1237
2065
if eval "$MISSING --run true"; then
1238
2066
  am_missing_run="$MISSING --run "
1270
2098
 
1271
2099
# Helper functions for option handling.                     -*- Autoconf -*-
1272
2100
 
1273
 
# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
 
2101
# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1274
2102
#
1275
2103
# This file is free software; the Free Software Foundation
1276
2104
# gives unlimited permission to copy and/or distribute it,
1277
2105
# with or without modifications, as long as this notice is preserved.
1278
2106
 
1279
 
# serial 3
 
2107
# serial 4
1280
2108
 
1281
2109
# _AM_MANGLE_OPTION(NAME)
1282
2110
# -----------------------
1293
2121
# ----------------------------------
1294
2122
# OPTIONS is a space-separated list of Automake options.
1295
2123
AC_DEFUN([_AM_SET_OPTIONS],
1296
 
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
2124
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1297
2125
 
1298
2126
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1299
2127
# -------------------------------------------
1303
2131
 
1304
2132
# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1305
2133
 
1306
 
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
 
2134
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1307
2135
# Free Software Foundation, Inc.
1308
2136
#
1309
2137
# This file is free software; the Free Software Foundation
1310
2138
# gives unlimited permission to copy and/or distribute it,
1311
2139
# with or without modifications, as long as this notice is preserved.
1312
2140
 
1313
 
# serial 4
 
2141
# serial 5
1314
2142
 
1315
2143
# AM_SANITY_CHECK
1316
2144
# ---------------
1319
2147
# Just in case
1320
2148
sleep 1
1321
2149
echo timestamp > conftest.file
 
2150
# Reject unsafe characters in $srcdir or the absolute working directory
 
2151
# name.  Accept space and tab only in the latter.
 
2152
am_lf='
 
2153
'
 
2154
case `pwd` in
 
2155
  *[[\\\"\#\$\&\'\`$am_lf]]*)
 
2156
    AC_MSG_ERROR([unsafe absolute working directory name]);;
 
2157
esac
 
2158
case $srcdir in
 
2159
  *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
 
2160
    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
 
2161
esac
 
2162
 
1322
2163
# Do `set' in a subshell so we don't clobber the current shell's
1323
2164
# arguments.  Must try -L first in case configure is actually a
1324
2165
# symlink; some systems play weird games with the mod time of symlinks
1325
2166
# (eg FreeBSD returns the mod time of the symlink's containing
1326
2167
# directory).
1327
2168
if (
1328
 
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
 
2169
   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1329
2170
   if test "$[*]" = "X"; then
1330
2171
      # -L didn't work.
1331
 
      set X `ls -t $srcdir/configure conftest.file`
 
2172
      set X `ls -t "$srcdir/configure" conftest.file`
1332
2173
   fi
1333
2174
   rm -f conftest.file
1334
2175
   if test "$[*]" != "X $srcdir/configure conftest.file" \
1353
2194
fi
1354
2195
AC_MSG_RESULT(yes)])
1355
2196
 
 
2197
# Copyright (C) 2009  Free Software Foundation, Inc.
 
2198
#
 
2199
# This file is free software; the Free Software Foundation
 
2200
# gives unlimited permission to copy and/or distribute it,
 
2201
# with or without modifications, as long as this notice is preserved.
 
2202
 
 
2203
# serial 1
 
2204
 
 
2205
# AM_SILENT_RULES([DEFAULT])
 
2206
# --------------------------
 
2207
# Enable less verbose build rules; with the default set to DEFAULT
 
2208
# (`yes' being less verbose, `no' or empty being verbose).
 
2209
AC_DEFUN([AM_SILENT_RULES],
 
2210
[AC_ARG_ENABLE([silent-rules],
 
2211
[  --enable-silent-rules          less verbose build output (undo: `make V=1')
 
2212
  --disable-silent-rules         verbose build output (undo: `make V=0')])
 
2213
case $enable_silent_rules in
 
2214
yes) AM_DEFAULT_VERBOSITY=0;;
 
2215
no)  AM_DEFAULT_VERBOSITY=1;;
 
2216
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 
2217
esac
 
2218
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 
2219
AM_BACKSLASH='\'
 
2220
AC_SUBST([AM_BACKSLASH])dnl
 
2221
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 
2222
])
 
2223
 
1356
2224
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1357
2225
#
1358
2226
# This file is free software; the Free Software Foundation
1381
2249
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1382
2250
AC_SUBST([INSTALL_STRIP_PROGRAM])])
1383
2251
 
1384
 
# Copyright (C) 2006  Free Software Foundation, Inc.
 
2252
# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1385
2253
#
1386
2254
# This file is free software; the Free Software Foundation
1387
2255
# gives unlimited permission to copy and/or distribute it,
1388
2256
# with or without modifications, as long as this notice is preserved.
1389
2257
 
 
2258
# serial 2
 
2259
 
1390
2260
# _AM_SUBST_NOTMAKE(VARIABLE)
1391
2261
# ---------------------------
1392
2262
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1393
2263
# This macro is traced by Automake.
1394
2264
AC_DEFUN([_AM_SUBST_NOTMAKE])
1395
2265
 
 
2266
# AM_SUBST_NOTMAKE(VARIABLE)
 
2267
# ---------------------------
 
2268
# Public sister of _AM_SUBST_NOTMAKE.
 
2269
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
2270
 
1396
2271
# Check how to create a tarball.                            -*- Autoconf -*-
1397
2272
 
1398
2273
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1489
2364
AC_SUBST([am__untar])
1490
2365
]) # _AM_PROG_TAR
1491
2366
 
1492
 
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1493
 
dnl
1494
 
dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1495
 
dnl 
1496
 
dnl Permission is hereby granted, free of charge, to any person obtaining a
1497
 
dnl copy of this software and associated documentation files (the
1498
 
dnl "Software"), to deal in the Software without restriction, including
1499
 
dnl without limitation the rights to use, copy, modify, merge, publish,
1500
 
dnl distribute, and/or sell copies of the Software, and to permit persons
1501
 
dnl to whom the Software is furnished to do so, provided that the above
1502
 
dnl copyright notice(s) and this permission notice appear in all copies of
1503
 
dnl the Software and that both the above copyright notice(s) and this
1504
 
dnl permission notice appear in supporting documentation.
1505
 
dnl
1506
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1507
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1508
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1509
 
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1510
 
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1511
 
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1512
 
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1513
 
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1514
 
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515
 
dnl
1516
 
dnl Except as contained in this notice, the name of a copyright holder
1517
 
dnl shall not be used in advertising or otherwise to promote the sale, use
1518
 
dnl or other dealings in this Software without prior written authorization
1519
 
dnl of the copyright holder.
1520
 
 
1521
 
# XORG_MACROS_VERSION(required-version)
1522
 
# -------------------------------------
1523
 
# Minimum version: 1.1.0
1524
 
#
1525
 
# If you're using a macro added in Version 1.1 or newer, include this in
1526
 
# your configure.ac with the minimum required version, such as:
1527
 
# XORG_MACROS_VERSION(1.1)
1528
 
#
1529
 
# To ensure that this macro is defined, also add:
1530
 
# m4_ifndef([XORG_MACROS_VERSION],
1531
 
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1532
 
#
1533
 
#
1534
 
# See the "minimum version" comment for each macro you use to see what 
1535
 
# version you require.
1536
 
m4_defun([XORG_MACROS_VERSION],[
1537
 
m4_define([vers_have], [1.2.1])
1538
 
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1539
 
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1540
 
m4_if(m4_cmp(maj_have, maj_needed), 0,,
1541
 
    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1542
 
m4_if(m4_version_compare(vers_have, [$1]), -1,
1543
 
    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1544
 
m4_undefine([vers_have])
1545
 
m4_undefine([maj_have])
1546
 
m4_undefine([maj_needed])
1547
 
]) # XORG_MACROS_VERSION
1548
 
 
1549
 
# XORG_PROG_RAWCPP()
1550
 
# ------------------
1551
 
# Minimum version: 1.0.0
1552
 
#
1553
 
# Find cpp program and necessary flags for use in pre-processing text files
1554
 
# such as man pages and config files
1555
 
AC_DEFUN([XORG_PROG_RAWCPP],[
1556
 
AC_REQUIRE([AC_PROG_CPP])
1557
 
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1558
 
   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1559
 
 
1560
 
# Check for flag to avoid builtin definitions - assumes unix is predefined,
1561
 
# which is not the best choice for supporting other OS'es, but covers most
1562
 
# of the ones we need for now.
1563
 
AC_MSG_CHECKING([if $RAWCPP requires -undef])
1564
 
AC_LANG_CONFTEST([Does cpp redefine unix ?])
1565
 
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1566
 
        AC_MSG_RESULT([no])
1567
 
else
1568
 
        if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1569
 
                RAWCPPFLAGS=-undef
1570
 
                AC_MSG_RESULT([yes])
1571
 
        # under Cygwin unix is still defined even with -undef
1572
 
        elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1573
 
                RAWCPPFLAGS="-undef -ansi"
1574
 
                AC_MSG_RESULT([yes, with -ansi])
1575
 
        else
1576
 
                AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1577
 
        fi
1578
 
fi
1579
 
rm -f conftest.$ac_ext
1580
 
 
1581
 
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1582
 
AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1583
 
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1584
 
        AC_MSG_RESULT([no])
1585
 
else
1586
 
        if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1587
 
                RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1588
 
                AC_MSG_RESULT([yes])
1589
 
        else
1590
 
                AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1591
 
        fi
1592
 
fi
1593
 
rm -f conftest.$ac_ext
1594
 
AC_SUBST(RAWCPPFLAGS)
1595
 
]) # XORG_PROG_RAWCPP
1596
 
 
1597
 
# XORG_MANPAGE_SECTIONS()
1598
 
# -----------------------
1599
 
# Minimum version: 1.0.0
1600
 
#
1601
 
# Determine which sections man pages go in for the different man page types
1602
 
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1603
 
# Not sure if there's any better way than just hardcoding by OS name.
1604
 
# Override default settings by setting environment variables
1605
 
 
1606
 
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1607
 
AC_REQUIRE([AC_CANONICAL_HOST])
1608
 
 
1609
 
if test x$APP_MAN_SUFFIX = x    ; then
1610
 
    APP_MAN_SUFFIX=1
1611
 
fi
1612
 
if test x$APP_MAN_DIR = x    ; then
1613
 
    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1614
 
fi
1615
 
 
1616
 
if test x$LIB_MAN_SUFFIX = x    ; then
1617
 
    LIB_MAN_SUFFIX=3
1618
 
fi
1619
 
if test x$LIB_MAN_DIR = x    ; then
1620
 
    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1621
 
fi
1622
 
 
1623
 
if test x$FILE_MAN_SUFFIX = x    ; then
1624
 
    case $host_os in
1625
 
        solaris*)       FILE_MAN_SUFFIX=4  ;;
1626
 
        *)              FILE_MAN_SUFFIX=5  ;;
1627
 
    esac
1628
 
fi
1629
 
if test x$FILE_MAN_DIR = x    ; then
1630
 
    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1631
 
fi
1632
 
 
1633
 
if test x$MISC_MAN_SUFFIX = x    ; then
1634
 
    case $host_os in
1635
 
        solaris*)       MISC_MAN_SUFFIX=5  ;;
1636
 
        *)              MISC_MAN_SUFFIX=7  ;;
1637
 
    esac
1638
 
fi
1639
 
if test x$MISC_MAN_DIR = x    ; then
1640
 
    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1641
 
fi
1642
 
 
1643
 
if test x$DRIVER_MAN_SUFFIX = x    ; then
1644
 
    case $host_os in
1645
 
        solaris*)       DRIVER_MAN_SUFFIX=7  ;;
1646
 
        *)              DRIVER_MAN_SUFFIX=4  ;;
1647
 
    esac
1648
 
fi
1649
 
if test x$DRIVER_MAN_DIR = x    ; then
1650
 
    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1651
 
fi
1652
 
 
1653
 
if test x$ADMIN_MAN_SUFFIX = x    ; then
1654
 
    case $host_os in
1655
 
        solaris*)       ADMIN_MAN_SUFFIX=1m ;;
1656
 
        *)              ADMIN_MAN_SUFFIX=8  ;;
1657
 
    esac
1658
 
fi
1659
 
if test x$ADMIN_MAN_DIR = x    ; then
1660
 
    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1661
 
fi
1662
 
 
1663
 
 
1664
 
AC_SUBST([APP_MAN_SUFFIX])
1665
 
AC_SUBST([LIB_MAN_SUFFIX])
1666
 
AC_SUBST([FILE_MAN_SUFFIX])
1667
 
AC_SUBST([MISC_MAN_SUFFIX])
1668
 
AC_SUBST([DRIVER_MAN_SUFFIX])
1669
 
AC_SUBST([ADMIN_MAN_SUFFIX])
1670
 
AC_SUBST([APP_MAN_DIR])
1671
 
AC_SUBST([LIB_MAN_DIR])
1672
 
AC_SUBST([FILE_MAN_DIR])
1673
 
AC_SUBST([MISC_MAN_DIR])
1674
 
AC_SUBST([DRIVER_MAN_DIR])
1675
 
AC_SUBST([ADMIN_MAN_DIR])
1676
 
]) # XORG_MANPAGE_SECTIONS
1677
 
 
1678
 
# XORG_CHECK_LINUXDOC
1679
 
# -------------------
1680
 
# Minimum version: 1.0.0
1681
 
#
1682
 
# Defines the variable MAKE_TEXT if the necessary tools and
1683
 
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1684
 
# Whether or not the necessary tools and files are found can be checked
1685
 
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1686
 
AC_DEFUN([XORG_CHECK_LINUXDOC],[
1687
 
if test x$XORG_SGML_PATH = x ; then
1688
 
    XORG_SGML_PATH=$prefix/share/sgml
1689
 
fi
1690
 
HAVE_DEFS_ENT=
1691
 
 
1692
 
if test x"$cross_compiling" = x"yes" ; then
1693
 
  HAVE_DEFS_ENT=no
1694
 
else
1695
 
  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1696
 
fi
1697
 
 
1698
 
AC_PATH_PROG(LINUXDOC, linuxdoc)
1699
 
AC_PATH_PROG(PS2PDF, ps2pdf)
1700
 
 
1701
 
AC_MSG_CHECKING([Whether to build documentation])
1702
 
 
1703
 
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1704
 
   BUILDDOC=yes
1705
 
else
1706
 
   BUILDDOC=no
1707
 
fi
1708
 
 
1709
 
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1710
 
 
1711
 
AC_MSG_RESULT([$BUILDDOC])
1712
 
 
1713
 
AC_MSG_CHECKING([Whether to build pdf documentation])
1714
 
 
1715
 
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1716
 
   BUILDPDFDOC=yes
1717
 
else
1718
 
   BUILDPDFDOC=no
1719
 
fi
1720
 
 
1721
 
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1722
 
 
1723
 
AC_MSG_RESULT([$BUILDPDFDOC])
1724
 
 
1725
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1726
 
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1727
 
MAKE_PDF="$PS2PDF"
1728
 
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1729
 
 
1730
 
AC_SUBST(MAKE_TEXT)
1731
 
AC_SUBST(MAKE_PS)
1732
 
AC_SUBST(MAKE_PDF)
1733
 
AC_SUBST(MAKE_HTML)
1734
 
]) # XORG_CHECK_LINUXDOC
1735
 
 
1736
 
# XORG_CHECK_DOCBOOK
1737
 
# -------------------
1738
 
# Minimum version: 1.0.0
1739
 
#
1740
 
# Checks for the ability to build output formats from SGML DocBook source.
1741
 
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1742
 
# indicates whether the necessary tools and files are found and, if set,
1743
 
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1744
 
AC_DEFUN([XORG_CHECK_DOCBOOK],[
1745
 
if test x$XORG_SGML_PATH = x ; then
1746
 
    XORG_SGML_PATH=$prefix/share/sgml
1747
 
fi
1748
 
HAVE_DEFS_ENT=
1749
 
BUILDTXTDOC=no
1750
 
BUILDPDFDOC=no
1751
 
BUILDPSDOC=no
1752
 
BUILDHTMLDOC=no
1753
 
 
1754
 
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1755
 
 
1756
 
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1757
 
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1758
 
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1759
 
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1760
 
 
1761
 
AC_MSG_CHECKING([Whether to build text documentation])
1762
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1763
 
   test x$BUILD_TXTDOC != xno; then
1764
 
        BUILDTXTDOC=yes
1765
 
fi
1766
 
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1767
 
AC_MSG_RESULT([$BUILDTXTDOC])
1768
 
 
1769
 
AC_MSG_CHECKING([Whether to build PDF documentation])
1770
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1771
 
   test x$BUILD_PDFDOC != xno; then
1772
 
        BUILDPDFDOC=yes
1773
 
fi
1774
 
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1775
 
AC_MSG_RESULT([$BUILDPDFDOC])
1776
 
 
1777
 
AC_MSG_CHECKING([Whether to build PostScript documentation])
1778
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1779
 
   test x$BUILD_PSDOC != xno; then
1780
 
        BUILDPSDOC=yes
1781
 
fi
1782
 
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1783
 
AC_MSG_RESULT([$BUILDPSDOC])
1784
 
 
1785
 
AC_MSG_CHECKING([Whether to build HTML documentation])
1786
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1787
 
   test x$BUILD_HTMLDOC != xno; then
1788
 
        BUILDHTMLDOC=yes
1789
 
fi
1790
 
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1791
 
AC_MSG_RESULT([$BUILDHTMLDOC])
1792
 
 
1793
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1794
 
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1795
 
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1796
 
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1797
 
 
1798
 
AC_SUBST(MAKE_TEXT)
1799
 
AC_SUBST(MAKE_PS)
1800
 
AC_SUBST(MAKE_PDF)
1801
 
AC_SUBST(MAKE_HTML)
1802
 
]) # XORG_CHECK_DOCBOOK
1803
 
 
1804
 
# XORG_CHECK_MALLOC_ZERO
1805
 
# ----------------------
1806
 
# Minimum version: 1.0.0
1807
 
#
1808
 
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1809
 
# malloc(0) returns NULL.  Packages should add one of these cflags to
1810
 
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1811
 
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1812
 
AC_ARG_ENABLE(malloc0returnsnull,
1813
 
        AC_HELP_STRING([--enable-malloc0returnsnull],
1814
 
                       [malloc(0) returns NULL (default: auto)]),
1815
 
        [MALLOC_ZERO_RETURNS_NULL=$enableval],
1816
 
        [MALLOC_ZERO_RETURNS_NULL=auto])
1817
 
 
1818
 
AC_MSG_CHECKING([whether malloc(0) returns NULL])
1819
 
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1820
 
        AC_RUN_IFELSE([
1821
 
char *malloc();
1822
 
char *realloc();
1823
 
char *calloc();
1824
 
main() {
1825
 
    char *m0, *r0, *c0, *p;
1826
 
    m0 = malloc(0);
1827
 
    p = malloc(10);
1828
 
    r0 = realloc(p,0);
1829
 
    c0 = calloc(0);
1830
 
    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1831
 
}],
1832
 
                [MALLOC_ZERO_RETURNS_NULL=yes],
1833
 
                [MALLOC_ZERO_RETURNS_NULL=no])
1834
 
fi
1835
 
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1836
 
 
1837
 
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1838
 
        MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1839
 
        XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1840
 
        XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1841
 
else
1842
 
        MALLOC_ZERO_CFLAGS=""
1843
 
        XMALLOC_ZERO_CFLAGS=""
1844
 
        XTMALLOC_ZERO_CFLAGS=""
1845
 
fi
1846
 
 
1847
 
AC_SUBST([MALLOC_ZERO_CFLAGS])
1848
 
AC_SUBST([XMALLOC_ZERO_CFLAGS])
1849
 
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1850
 
]) # XORG_CHECK_MALLOC_ZERO
1851
 
 
1852
 
# XORG_WITH_LINT()
1853
 
# ----------------
1854
 
# Minimum version: 1.1.0
1855
 
#
1856
 
# Sets up flags for source checkers such as lint and sparse if --with-lint
1857
 
# is specified.   (Use --with-lint=sparse for sparse.)
1858
 
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1859
 
# Sets $LINT_FLAGS to flags to pass to source checker
1860
 
# Sets LINT automake conditional if enabled (default: disabled)
1861
 
#
1862
 
AC_DEFUN([XORG_WITH_LINT],[
1863
 
 
1864
 
# Allow checking code with lint, sparse, etc.
1865
 
AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1866
 
                [Use a lint-style source code checker (default: disabled)])],
1867
 
                [use_lint=$withval], [use_lint=no])
1868
 
if test "x$use_lint" = "xyes" ; then
1869
 
        LINT="lint"
1870
 
else
1871
 
        LINT="$use_lint"
1872
 
fi
1873
 
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1874
 
    case $LINT in
1875
 
        lint|*/lint)
1876
 
            case $host_os in
1877
 
                solaris*)
1878
 
                        LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1879
 
                        ;;
1880
 
            esac
1881
 
            ;;
1882
 
    esac
1883
 
fi
1884
 
 
1885
 
AC_SUBST(LINT)
1886
 
AC_SUBST(LINT_FLAGS)
1887
 
AM_CONDITIONAL(LINT, [test x$LINT != xno])
1888
 
 
1889
 
]) # XORG_WITH_LINT
1890
 
 
1891
 
# XORG_LINT_LIBRARY(LIBNAME)
1892
 
# --------------------------
1893
 
# Minimum version: 1.1.0
1894
 
#
1895
 
# Sets up flags for building lint libraries for checking programs that call
1896
 
# functions in the library.
1897
 
# Disabled by default, enable with --enable-lint-library
1898
 
# Sets: 
1899
 
#       @LINTLIB@               - name of lint library file to make
1900
 
#       MAKE_LINT_LIB           - automake conditional
1901
 
#
1902
 
 
1903
 
AC_DEFUN([XORG_LINT_LIBRARY],[
1904
 
AC_REQUIRE([XORG_WITH_LINT])
1905
 
# Build lint "library" for more indepth checks of programs calling this library
1906
 
AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1907
 
        [Create lint library (default: disabled)])],
1908
 
        [make_lint_lib=$enableval], [make_lint_lib=no])
1909
 
if test "x$make_lint_lib" != "xno" ; then
1910
 
        if test "x$LINT" = "xno" ; then
1911
 
                AC_MSG_ERROR([Cannot make lint library without --with-lint])
1912
 
        fi
1913
 
        if test "x$make_lint_lib" = "xyes" ; then
1914
 
                LINTLIB=llib-l$1.ln
1915
 
        else
1916
 
                LINTLIB=$make_lint_lib
1917
 
        fi
1918
 
fi
1919
 
AC_SUBST(LINTLIB)
1920
 
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1921
 
 
1922
 
]) # XORG_LINT_LIBRARY
1923
 
 
1924
 
# XORG_CWARNFLAGS
1925
 
# ---------------
1926
 
# Minimum version: 1.2.0
1927
 
#
1928
 
# Defines CWARNFLAGS to enable C compiler warnings.
1929
 
#
1930
 
AC_DEFUN([XORG_CWARNFLAGS], [
1931
 
AC_REQUIRE([AC_PROG_CC])
1932
 
if  test "x$GCC" = xyes ; then
1933
 
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1934
 
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1935
 
-Wbad-function-cast"
1936
 
    case `gcc -dumpversion` in
1937
 
    3.4.* | 4.*)
1938
 
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1939
 
        ;;
1940
 
    esac
1941
 
else
1942
 
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1943
 
    if test "x$SUNCC" = "xyes"; then
1944
 
        CWARNFLAGS="-v"
1945
 
    fi
1946
 
fi
1947
 
AC_SUBST(CWARNFLAGS)
1948
 
]) # XORG_CWARNFLAGS
1949
 
dnl Copyright 2005 Red Hat, Inc
1950
 
dnl
1951
 
dnl Permission to use, copy, modify, distribute, and sell this software and its
1952
 
dnl documentation for any purpose is hereby granted without fee, provided that
1953
 
dnl the above copyright notice appear in all copies and that both that
1954
 
dnl copyright notice and this permission notice appear in supporting
1955
 
dnl documentation.
1956
 
dnl
1957
 
dnl The above copyright notice and this permission notice shall be included
1958
 
dnl in all copies or substantial portions of the Software.
1959
 
dnl
1960
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1961
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1962
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1963
 
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1964
 
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1965
 
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1966
 
dnl OTHER DEALINGS IN THE SOFTWARE.
1967
 
dnl
1968
 
dnl Except as contained in this notice, the name of the copyright holders shall
1969
 
dnl not be used in advertising or otherwise to promote the sale, use or
1970
 
dnl other dealings in this Software without prior written authorization
1971
 
dnl from the copyright holders.
1972
 
dnl
1973
 
 
1974
 
# XORG_RELEASE_VERSION
1975
 
# --------------------
1976
 
# Adds --with/without-release-string and changes the PACKAGE and
1977
 
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1978
 
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1979
 
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1980
 
 
1981
 
AC_DEFUN([XORG_RELEASE_VERSION],[
1982
 
        AC_ARG_WITH(release-version,
1983
 
                        AC_HELP_STRING([--with-release-version=STRING],
1984
 
                                [Use release version string in package name]),
1985
 
                        [RELEASE_VERSION="$withval"],
1986
 
                        [RELEASE_VERSION=""])
1987
 
        if test "x$RELEASE_VERSION" != "x"; then
1988
 
                PACKAGE="$PACKAGE-$RELEASE_VERSION"
1989
 
                PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1990
 
                AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1991
 
        fi
1992
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1993
 
                [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1994
 
                [Major version of this package])
1995
 
        PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1996
 
        if test "x$PVM" = "x"; then
1997
 
                PVM="0"
1998
 
        fi
1999
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2000
 
                [$PVM],
2001
 
                [Minor version of this package])
2002
 
        PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2003
 
        if test "x$PVP" = "x"; then
2004
 
                PVP="0"
2005
 
        fi
2006
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2007
 
                [$PVP],
2008
 
                [Patch version of this package])
2009
 
])
2010
 
 
2011
 
# XORG_CHANGELOG()
2012
 
# ----------------
2013
 
# Minimum version: 1.2.0
2014
 
#
2015
 
# Defines the variable CHANGELOG_CMD as the command to generate
2016
 
# ChangeLog from git.
2017
 
#
2018
 
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
2019
 
#
2020
 
AC_DEFUN([XORG_CHANGELOG], [
2021
 
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
2022
 
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
2023
 
echo 'git directory not found: installing possibly empty changelog.' >&2)"
2024
 
AC_SUBST([CHANGELOG_CMD])
2025
 
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
2026
 
]) # XORG_CHANGELOG
2027