~ubuntu-branches/ubuntu/precise/x11proto-core/precise-updates

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2010-07-07 18:21:51 UTC
  • mfrom: (3.1.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20100707182151-fhn7hhccvashd99z
Tags: 7.0.17-1
* Get rid of the x-dev transitional package.
* Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
  good reason.  Thanks, Colin Watson!
* Remove myself from Uploaders
* New upstream release.
* Bump xutils-dev build-dep for xorg-macros.
* Update debian/copyright.
* Bump Standards-Version to 3.9.0, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.11 -*- 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
4
# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
13
13
 
14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
 
m4_if(m4_defn([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
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
23
 
24
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
25
#
 
26
# This program is free software; you can redistribute it and/or modify
 
27
# it under the terms of the GNU General Public License as published by
 
28
# the Free Software Foundation; either version 2 of the License, or
 
29
# (at your option) any later version.
 
30
#
 
31
# This program is distributed in the hope that it will be useful, but
 
32
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
33
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
34
# General Public License for more details.
 
35
#
 
36
# You should have received a copy of the GNU General Public License
 
37
# along with this program; if not, write to the Free Software
 
38
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
39
#
 
40
# As a special exception to the GNU General Public License, if you
 
41
# distribute this file as part of a program that contains a
 
42
# configuration script generated by Autoconf, you may include it under
 
43
# the same distribution terms that you use for the rest of that program.
 
44
 
 
45
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
46
# ----------------------------------
 
47
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
48
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
49
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
50
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 
51
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
52
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
53
fi
 
54
if test -n "$PKG_CONFIG"; then
 
55
        _pkg_min_version=m4_default([$1], [0.9.0])
 
56
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
57
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
58
                AC_MSG_RESULT([yes])
 
59
        else
 
60
                AC_MSG_RESULT([no])
 
61
                PKG_CONFIG=""
 
62
        fi
 
63
                
 
64
fi[]dnl
 
65
])# PKG_PROG_PKG_CONFIG
 
66
 
 
67
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
68
#
 
69
# Check to see whether a particular set of modules exists.  Similar
 
70
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
71
#
 
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
 
76
# --------------------------------------------------------------
 
77
AC_DEFUN([PKG_CHECK_EXISTS],
 
78
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
79
if test -n "$PKG_CONFIG" && \
 
80
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
81
  m4_ifval([$2], [$2], [:])
 
82
m4_ifvaln([$3], [else
 
83
  $3])dnl
 
84
fi])
 
85
 
 
86
 
 
87
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
88
# ---------------------------------------------
 
89
m4_define([_PKG_CONFIG],
 
90
[if test -n "$PKG_CONFIG"; then
 
91
    if test -n "$$1"; then
 
92
        pkg_cv_[]$1="$$1"
 
93
    else
 
94
        PKG_CHECK_EXISTS([$3],
 
95
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
96
                         [pkg_failed=yes])
 
97
    fi
 
98
else
 
99
        pkg_failed=untried
 
100
fi[]dnl
 
101
])# _PKG_CONFIG
 
102
 
 
103
# _PKG_SHORT_ERRORS_SUPPORTED
 
104
# -----------------------------
 
105
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
106
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
107
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
108
        _pkg_short_errors_supported=yes
 
109
else
 
110
        _pkg_short_errors_supported=no
 
111
fi[]dnl
 
112
])# _PKG_SHORT_ERRORS_SUPPORTED
 
113
 
 
114
 
 
115
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
116
# [ACTION-IF-NOT-FOUND])
 
117
#
 
118
#
 
119
# Note that if there is a possibility the first call to
 
120
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
121
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
122
#
 
123
#
 
124
# --------------------------------------------------------------
 
125
AC_DEFUN([PKG_CHECK_MODULES],
 
126
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
127
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
128
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
129
 
 
130
pkg_failed=no
 
131
AC_MSG_CHECKING([for $1])
 
132
 
 
133
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
134
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
135
 
 
136
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
137
and $1[]_LIBS to avoid the need to call pkg-config.
 
138
See the pkg-config man page for more details.])
 
139
 
 
140
if test $pkg_failed = yes; then
 
141
        _PKG_SHORT_ERRORS_SUPPORTED
 
142
        if test $_pkg_short_errors_supported = yes; then
 
143
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
 
144
        else 
 
145
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
146
        fi
 
147
        # Put the nasty error message in config.log where it belongs
 
148
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
149
 
 
150
        ifelse([$4], , [AC_MSG_ERROR(dnl
 
151
[Package requirements ($2) were not met:
 
152
 
 
153
$$1_PKG_ERRORS
 
154
 
 
155
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
156
installed software in a non-standard prefix.
 
157
 
 
158
_PKG_TEXT
 
159
])],
 
160
                [AC_MSG_RESULT([no])
 
161
                $4])
 
162
elif test $pkg_failed = untried; then
 
163
        ifelse([$4], , [AC_MSG_FAILURE(dnl
 
164
[The pkg-config script could not be found or is too old.  Make sure it
 
165
is in your PATH or set the PKG_CONFIG environment variable to the full
 
166
path to pkg-config.
 
167
 
 
168
_PKG_TEXT
 
169
 
 
170
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
 
171
                [$4])
 
172
else
 
173
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
174
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
175
        AC_MSG_RESULT([yes])
 
176
        ifelse([$3], , :, [$3])
 
177
fi[]dnl
 
178
])# PKG_CHECK_MODULES
 
179
 
 
180
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
 
181
dnl
 
182
dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
 
183
dnl 
 
184
dnl Permission is hereby granted, free of charge, to any person obtaining a
 
185
dnl copy of this software and associated documentation files (the "Software"),
 
186
dnl to deal in the Software without restriction, including without limitation
 
187
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
188
dnl and/or sell copies of the Software, and to permit persons to whom the
 
189
dnl Software is furnished to do so, subject to the following conditions:
 
190
dnl
 
191
dnl The above copyright notice and this permission notice (including the next
 
192
dnl paragraph) shall be included in all copies or substantial portions of the
 
193
dnl Software.
 
194
dnl
 
195
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
196
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
197
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
198
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
199
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
200
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
201
dnl DEALINGS IN THE SOFTWARE.
 
202
 
 
203
# XORG_MACROS_VERSION(required-version)
 
204
# -------------------------------------
 
205
# Minimum version: 1.1.0
 
206
#
 
207
# If you're using a macro added in Version 1.1 or newer, include this in
 
208
# your configure.ac with the minimum required version, such as:
 
209
# XORG_MACROS_VERSION(1.1)
 
210
#
 
211
# To ensure that this macro is defined, also add:
 
212
# m4_ifndef([XORG_MACROS_VERSION],
 
213
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
 
214
#
 
215
#
 
216
# See the "minimum version" comment for each macro you use to see what 
 
217
# version you require.
 
218
m4_defun([XORG_MACROS_VERSION],[
 
219
m4_define([vers_have], [1.7.0])
 
220
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
 
221
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
 
222
m4_if(m4_cmp(maj_have, maj_needed), 0,,
 
223
    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
 
224
m4_if(m4_version_compare(vers_have, [$1]), -1,
 
225
    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
 
226
m4_undefine([vers_have])
 
227
m4_undefine([maj_have])
 
228
m4_undefine([maj_needed])
 
229
]) # XORG_MACROS_VERSION
 
230
 
 
231
# XORG_PROG_RAWCPP()
 
232
# ------------------
 
233
# Minimum version: 1.0.0
 
234
#
 
235
# Find cpp program and necessary flags for use in pre-processing text files
 
236
# such as man pages and config files
 
237
AC_DEFUN([XORG_PROG_RAWCPP],[
 
238
AC_REQUIRE([AC_PROG_CPP])
 
239
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
 
240
   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
 
241
 
 
242
# Check for flag to avoid builtin definitions - assumes unix is predefined,
 
243
# which is not the best choice for supporting other OS'es, but covers most
 
244
# of the ones we need for now.
 
245
AC_MSG_CHECKING([if $RAWCPP requires -undef])
 
246
AC_LANG_CONFTEST([Does cpp redefine unix ?])
 
247
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
 
248
        AC_MSG_RESULT([no])
 
249
else
 
250
        if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
 
251
                RAWCPPFLAGS=-undef
 
252
                AC_MSG_RESULT([yes])
 
253
        # under Cygwin unix is still defined even with -undef
 
254
        elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
 
255
                RAWCPPFLAGS="-undef -ansi"
 
256
                AC_MSG_RESULT([yes, with -ansi])
 
257
        else
 
258
                AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
 
259
        fi
 
260
fi
 
261
rm -f conftest.$ac_ext
 
262
 
 
263
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
 
264
AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
 
265
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
 
266
        AC_MSG_RESULT([no])
 
267
else
 
268
        if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
 
269
                RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
 
270
                AC_MSG_RESULT([yes])
 
271
        else
 
272
                AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
 
273
        fi
 
274
fi
 
275
rm -f conftest.$ac_ext
 
276
AC_SUBST(RAWCPPFLAGS)
 
277
]) # XORG_PROG_RAWCPP
 
278
 
 
279
# XORG_MANPAGE_SECTIONS()
 
280
# -----------------------
 
281
# Minimum version: 1.0.0
 
282
#
 
283
# Determine which sections man pages go in for the different man page types
 
284
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
 
285
# Not sure if there's any better way than just hardcoding by OS name.
 
286
# Override default settings by setting environment variables
 
287
 
 
288
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
 
289
AC_REQUIRE([AC_CANONICAL_HOST])
 
290
 
 
291
if test x$APP_MAN_SUFFIX = x    ; then
 
292
    APP_MAN_SUFFIX=1
 
293
fi
 
294
if test x$APP_MAN_DIR = x    ; then
 
295
    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
 
296
fi
 
297
 
 
298
if test x$LIB_MAN_SUFFIX = x    ; then
 
299
    LIB_MAN_SUFFIX=3
 
300
fi
 
301
if test x$LIB_MAN_DIR = x    ; then
 
302
    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
 
303
fi
 
304
 
 
305
if test x$FILE_MAN_SUFFIX = x    ; then
 
306
    case $host_os in
 
307
        solaris*)       FILE_MAN_SUFFIX=4  ;;
 
308
        *)              FILE_MAN_SUFFIX=5  ;;
 
309
    esac
 
310
fi
 
311
if test x$FILE_MAN_DIR = x    ; then
 
312
    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
 
313
fi
 
314
 
 
315
if test x$MISC_MAN_SUFFIX = x    ; then
 
316
    case $host_os in
 
317
        solaris*)       MISC_MAN_SUFFIX=5  ;;
 
318
        *)              MISC_MAN_SUFFIX=7  ;;
 
319
    esac
 
320
fi
 
321
if test x$MISC_MAN_DIR = x    ; then
 
322
    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
 
323
fi
 
324
 
 
325
if test x$DRIVER_MAN_SUFFIX = x    ; then
 
326
    case $host_os in
 
327
        solaris*)       DRIVER_MAN_SUFFIX=7  ;;
 
328
        *)              DRIVER_MAN_SUFFIX=4  ;;
 
329
    esac
 
330
fi
 
331
if test x$DRIVER_MAN_DIR = x    ; then
 
332
    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
 
333
fi
 
334
 
 
335
if test x$ADMIN_MAN_SUFFIX = x    ; then
 
336
    case $host_os in
 
337
        solaris*)       ADMIN_MAN_SUFFIX=1m ;;
 
338
        *)              ADMIN_MAN_SUFFIX=8  ;;
 
339
    esac
 
340
fi
 
341
if test x$ADMIN_MAN_DIR = x    ; then
 
342
    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
 
343
fi
 
344
 
 
345
 
 
346
AC_SUBST([APP_MAN_SUFFIX])
 
347
AC_SUBST([LIB_MAN_SUFFIX])
 
348
AC_SUBST([FILE_MAN_SUFFIX])
 
349
AC_SUBST([MISC_MAN_SUFFIX])
 
350
AC_SUBST([DRIVER_MAN_SUFFIX])
 
351
AC_SUBST([ADMIN_MAN_SUFFIX])
 
352
AC_SUBST([APP_MAN_DIR])
 
353
AC_SUBST([LIB_MAN_DIR])
 
354
AC_SUBST([FILE_MAN_DIR])
 
355
AC_SUBST([MISC_MAN_DIR])
 
356
AC_SUBST([DRIVER_MAN_DIR])
 
357
AC_SUBST([ADMIN_MAN_DIR])
 
358
]) # XORG_MANPAGE_SECTIONS
 
359
 
 
360
# XORG_CHECK_SGML_DOCTOOLS
 
361
# ------------------------
 
362
# Minimum version: 1.7.0
 
363
#
 
364
# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
 
365
# provided by xorg-sgml-doctools, if installed.
 
366
AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
 
367
AC_MSG_CHECKING([for X.Org SGML entities])
 
368
XORG_SGML_PATH=
 
369
PKG_CHECK_EXISTS([xorg-sgml-doctools],
 
370
    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
 
371
    [if test x"$cross_compiling" != x"yes" ; then
 
372
        AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
 
373
                      [XORG_SGML_PATH=$prefix/share/sgml])
 
374
     fi])
 
375
 
 
376
if test "x$XORG_SGML_PATH" != "x" ; then
 
377
   AC_MSG_RESULT([$XORG_SGML_PATH])
 
378
else
 
379
   AC_MSG_RESULT([no])
 
380
fi
 
381
 
 
382
AC_SUBST(XORG_SGML_PATH)
 
383
]) # XORG_CHECK_SGML_DOCTOOLS
 
384
 
 
385
# XORG_CHECK_LINUXDOC
 
386
# -------------------
 
387
# Minimum version: 1.0.0
 
388
#
 
389
# Defines the variable MAKE_TEXT if the necessary tools and
 
390
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
 
391
# Whether or not the necessary tools and files are found can be checked
 
392
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
 
393
AC_DEFUN([XORG_CHECK_LINUXDOC],[
 
394
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
 
395
 
 
396
AC_PATH_PROG(LINUXDOC, linuxdoc)
 
397
AC_PATH_PROG(PS2PDF, ps2pdf)
 
398
 
 
399
AC_MSG_CHECKING([whether to build documentation])
 
400
 
 
401
if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
 
402
   BUILDDOC=yes
 
403
else
 
404
   BUILDDOC=no
 
405
fi
 
406
 
 
407
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
 
408
 
 
409
AC_MSG_RESULT([$BUILDDOC])
 
410
 
 
411
AC_MSG_CHECKING([whether to build pdf documentation])
 
412
 
 
413
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
 
414
   BUILDPDFDOC=yes
 
415
else
 
416
   BUILDPDFDOC=no
 
417
fi
 
418
 
 
419
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
 
420
 
 
421
AC_MSG_RESULT([$BUILDPDFDOC])
 
422
 
 
423
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
 
424
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
 
425
MAKE_PDF="$PS2PDF"
 
426
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
 
427
 
 
428
AC_SUBST(MAKE_TEXT)
 
429
AC_SUBST(MAKE_PS)
 
430
AC_SUBST(MAKE_PDF)
 
431
AC_SUBST(MAKE_HTML)
 
432
]) # XORG_CHECK_LINUXDOC
 
433
 
 
434
# XORG_CHECK_DOCBOOK
 
435
# -------------------
 
436
# Minimum version: 1.0.0
 
437
#
 
438
# Checks for the ability to build output formats from SGML DocBook source.
 
439
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
 
440
# indicates whether the necessary tools and files are found and, if set,
 
441
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
 
442
AC_DEFUN([XORG_CHECK_DOCBOOK],[
 
443
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
 
444
 
 
445
BUILDTXTDOC=no
 
446
BUILDPDFDOC=no
 
447
BUILDPSDOC=no
 
448
BUILDHTMLDOC=no
 
449
 
 
450
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
 
451
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
 
452
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
 
453
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
 
454
 
 
455
AC_MSG_CHECKING([whether to build text documentation])
 
456
if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
 
457
   test x$BUILD_TXTDOC != xno; then
 
458
        BUILDTXTDOC=yes
 
459
fi
 
460
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
 
461
AC_MSG_RESULT([$BUILDTXTDOC])
 
462
 
 
463
AC_MSG_CHECKING([whether to build PDF documentation])
 
464
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
 
465
   test x$BUILD_PDFDOC != xno; then
 
466
        BUILDPDFDOC=yes
 
467
fi
 
468
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
 
469
AC_MSG_RESULT([$BUILDPDFDOC])
 
470
 
 
471
AC_MSG_CHECKING([whether to build PostScript documentation])
 
472
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
 
473
   test x$BUILD_PSDOC != xno; then
 
474
        BUILDPSDOC=yes
 
475
fi
 
476
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
 
477
AC_MSG_RESULT([$BUILDPSDOC])
 
478
 
 
479
AC_MSG_CHECKING([whether to build HTML documentation])
 
480
if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
 
481
   test x$BUILD_HTMLDOC != xno; then
 
482
        BUILDHTMLDOC=yes
 
483
fi
 
484
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
 
485
AC_MSG_RESULT([$BUILDHTMLDOC])
 
486
 
 
487
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
 
488
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
 
489
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
 
490
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
 
491
 
 
492
AC_SUBST(MAKE_TEXT)
 
493
AC_SUBST(MAKE_PS)
 
494
AC_SUBST(MAKE_PDF)
 
495
AC_SUBST(MAKE_HTML)
 
496
]) # XORG_CHECK_DOCBOOK
 
497
 
 
498
# XORG_WITH_XMLTO([MIN-VERSION])
 
499
# ----------------
 
500
# Minimum version: 1.5.0
 
501
#
 
502
# Documentation tools are not always available on all platforms and sometimes
 
503
# not at the appropriate level. This macro enables a module to test for the
 
504
# presence of the tool and obtain it's path in separate variables. Coupled with
 
505
# the --with-xmlto option, it allows maximum flexibilty in making decisions
 
506
# as whether or not to use the xmlto package.
 
507
#
 
508
# Interface to module:
 
509
# HAVE_XMLTO:   used in makefiles to conditionally generate documentation
 
510
# XMLTO:        returns the path of the xmlto program found
 
511
#               returns the path set by the user in the environment
 
512
# --with-xmlto: 'yes' user instructs the module to use xmlto
 
513
#               'no' user instructs the module not to use xmlto
 
514
#
 
515
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
 
516
#
 
517
AC_DEFUN([XORG_WITH_XMLTO],[
 
518
AC_ARG_VAR([XMLTO], [Path to xmlto command])
 
519
AC_ARG_WITH(xmlto,
 
520
        AS_HELP_STRING([--with-xmlto],
 
521
           [Use xmlto to regenerate documentation (default: yes, if installed)]),
 
522
           [use_xmlto=$withval], [use_xmlto=auto])
 
523
 
 
524
if test "x$use_xmlto" = x"auto"; then
 
525
   AC_PATH_PROG([XMLTO], [xmlto])
 
526
   if test "x$XMLTO" = "x"; then
 
527
        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
 
528
        have_xmlto=no
 
529
   else
 
530
        have_xmlto=yes
 
531
   fi
 
532
elif test "x$use_xmlto" = x"yes" ; then
 
533
   AC_PATH_PROG([XMLTO], [xmlto])
 
534
   if test "x$XMLTO" = "x"; then
 
535
        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
 
536
   fi
 
537
   have_xmlto=yes
 
538
elif test "x$use_xmlto" = x"no" ; then
 
539
   if test "x$XMLTO" != "x"; then
 
540
      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
 
541
   fi
 
542
   have_xmlto=no
 
543
else
 
544
   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
 
545
fi
 
546
m4_ifval([$1],
 
547
[if test "$have_xmlto" = yes; then
 
548
    # scrape the xmlto version
 
549
    AC_MSG_CHECKING([the xmlto version])
 
550
    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
 
551
    AC_MSG_RESULT([$xmlto_version])
 
552
    AS_VERSION_COMPARE([$xmlto_version], [$1],
 
553
        [if test "x$use_xmlto" = xauto; then
 
554
            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
 
555
            have_xmlto=no
 
556
        else
 
557
            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
 
558
        fi])
 
559
fi])
 
560
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
 
561
]) # XORG_WITH_XMLTO
 
562
 
 
563
# XORG_WITH_ASCIIDOC([MIN-VERSION])
 
564
# ----------------
 
565
# Minimum version: 1.5.0
 
566
#
 
567
# Documentation tools are not always available on all platforms and sometimes
 
568
# not at the appropriate level. This macro enables a module to test for the
 
569
# presence of the tool and obtain it's path in separate variables. Coupled with
 
570
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
 
571
# as whether or not to use the asciidoc package.
 
572
#
 
573
# Interface to module:
 
574
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
 
575
# ASCIIDOC:      returns the path of the asciidoc program found
 
576
#                returns the path set by the user in the environment
 
577
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
 
578
#                 'no' user instructs the module not to use asciidoc
 
579
#
 
580
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
 
581
#
 
582
AC_DEFUN([XORG_WITH_ASCIIDOC],[
 
583
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
 
584
AC_ARG_WITH(asciidoc,
 
585
        AS_HELP_STRING([--with-asciidoc],
 
586
           [Use asciidoc to regenerate documentation (default: yes, if installed)]),
 
587
           [use_asciidoc=$withval], [use_asciidoc=auto])
 
588
 
 
589
if test "x$use_asciidoc" = x"auto"; then
 
590
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
 
591
   if test "x$ASCIIDOC" = "x"; then
 
592
        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
 
593
        have_asciidoc=no
 
594
   else
 
595
        have_asciidoc=yes
 
596
   fi
 
597
elif test "x$use_asciidoc" = x"yes" ; then
 
598
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
 
599
   if test "x$ASCIIDOC" = "x"; then
 
600
        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
 
601
   fi
 
602
   have_asciidoc=yes
 
603
elif test "x$use_asciidoc" = x"no" ; then
 
604
   if test "x$ASCIIDOC" != "x"; then
 
605
      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
 
606
   fi
 
607
   have_asciidoc=no
 
608
else
 
609
   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
 
610
fi
 
611
m4_ifval([$1],
 
612
[if test "$have_asciidoc" = yes; then
 
613
    # scrape the asciidoc version
 
614
    AC_MSG_CHECKING([the asciidoc version])
 
615
    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
 
616
    AC_MSG_RESULT([$asciidoc_version])
 
617
    AS_VERSION_COMPARE([$asciidoc_version], [$1],
 
618
        [if test "x$use_asciidoc" = xauto; then
 
619
            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
 
620
            have_asciidoc=no
 
621
        else
 
622
            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
 
623
        fi])
 
624
fi])
 
625
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
 
626
]) # XORG_WITH_ASCIIDOC
 
627
 
 
628
# XORG_WITH_DOXYGEN([MIN-VERSION])
 
629
# --------------------------------
 
630
# Minimum version: 1.5.0
 
631
#
 
632
# Documentation tools are not always available on all platforms and sometimes
 
633
# not at the appropriate level. This macro enables a module to test for the
 
634
# presence of the tool and obtain it's path in separate variables. Coupled with
 
635
# the --with-doxygen option, it allows maximum flexibilty in making decisions
 
636
# as whether or not to use the doxygen package.
 
637
#
 
638
# Interface to module:
 
639
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
 
640
# DOXYGEN:       returns the path of the doxygen program found
 
641
#                returns the path set by the user in the environment
 
642
# --with-doxygen: 'yes' user instructs the module to use doxygen
 
643
#                 'no' user instructs the module not to use doxygen
 
644
#
 
645
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
 
646
#
 
647
AC_DEFUN([XORG_WITH_DOXYGEN],[
 
648
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
 
649
AC_ARG_WITH(doxygen,
 
650
        AS_HELP_STRING([--with-doxygen],
 
651
           [Use doxygen to regenerate documentation (default: yes, if installed)]),
 
652
           [use_doxygen=$withval], [use_doxygen=auto])
 
653
 
 
654
if test "x$use_doxygen" = x"auto"; then
 
655
   AC_PATH_PROG([DOXYGEN], [doxygen])
 
656
   if test "x$DOXYGEN" = "x"; then
 
657
        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
 
658
        have_doxygen=no
 
659
   else
 
660
        have_doxygen=yes
 
661
   fi
 
662
elif test "x$use_doxygen" = x"yes" ; then
 
663
   AC_PATH_PROG([DOXYGEN], [doxygen])
 
664
   if test "x$DOXYGEN" = "x"; then
 
665
        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
 
666
   fi
 
667
   have_doxygen=yes
 
668
elif test "x$use_doxygen" = x"no" ; then
 
669
   if test "x$DOXYGEN" != "x"; then
 
670
      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
 
671
   fi
 
672
   have_doxygen=no
 
673
else
 
674
   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
 
675
fi
 
676
m4_ifval([$1],
 
677
[if test "$have_doxygen" = yes; then
 
678
    # scrape the doxygen version
 
679
    AC_MSG_CHECKING([the doxygen version])
 
680
    doxygen_version=`$DOXYGEN --version 2>/dev/null`
 
681
    AC_MSG_RESULT([$doxygen_version])
 
682
    AS_VERSION_COMPARE([$doxygen_version], [$1],
 
683
        [if test "x$use_doxygen" = xauto; then
 
684
            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
 
685
            have_doxygen=no
 
686
        else
 
687
            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
 
688
        fi])
 
689
fi])
 
690
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
 
691
]) # XORG_WITH_DOXYGEN
 
692
 
 
693
# XORG_WITH_GROFF
 
694
# ----------------
 
695
# Minimum version: 1.6.0
 
696
#
 
697
# Documentation tools are not always available on all platforms and sometimes
 
698
# not at the appropriate level. This macro enables a module to test for the
 
699
# presence of the tool and obtain it's path in separate variables. Coupled with
 
700
# the --with-groff option, it allows maximum flexibilty in making decisions
 
701
# as whether or not to use the groff package.
 
702
#
 
703
# Interface to module:
 
704
# HAVE_GROFF:    used in makefiles to conditionally generate documentation
 
705
# HAVE_GROFF_MM: the memorandum macros (-mm) package
 
706
# HAVE_GROFF_MS: the -ms macros package
 
707
# GROFF:         returns the path of the groff program found
 
708
#                returns the path set by the user in the environment
 
709
# --with-groff:  'yes' user instructs the module to use groff
 
710
#                'no' user instructs the module not to use groff
 
711
#
 
712
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
 
713
#
 
714
# OS and distros often splits groff in a basic and full package, the former
 
715
# having the groff program and the later having devices, fonts and macros
 
716
# Checking for the groff executable is not enough.
 
717
#
 
718
# If macros are missing, we cannot assume that groff is useless, so we don't
 
719
# unset HAVE_GROFF or GROFF env variables.
 
720
# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
 
721
#
 
722
AC_DEFUN([XORG_WITH_GROFF],[
 
723
AC_ARG_VAR([GROFF], [Path to groff command])
 
724
AC_ARG_WITH(groff,
 
725
        AS_HELP_STRING([--with-groff],
 
726
           [Use groff to regenerate documentation (default: yes, if installed)]),
 
727
           [use_groff=$withval], [use_groff=auto])
 
728
 
 
729
if test "x$use_groff" = x"auto"; then
 
730
   AC_PATH_PROG([GROFF], [groff])
 
731
   if test "x$GROFF" = "x"; then
 
732
        AC_MSG_WARN([groff not found - documentation targets will be skipped])
 
733
        have_groff=no
 
734
   else
 
735
        have_groff=yes
 
736
   fi
 
737
elif test "x$use_groff" = x"yes" ; then
 
738
   AC_PATH_PROG([GROFF], [groff])
 
739
   if test "x$GROFF" = "x"; then
 
740
        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
 
741
   fi
 
742
   have_groff=yes
 
743
elif test "x$use_groff" = x"no" ; then
 
744
   if test "x$GROFF" != "x"; then
 
745
      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
 
746
   fi
 
747
   have_groff=no
 
748
else
 
749
   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
 
750
fi
 
751
# We have groff, test for the presence of the macro packages
 
752
if test "x$have_groff" = x"yes"; then
 
753
    AC_MSG_CHECKING([for ${GROFF} -ms macros])
 
754
    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
 
755
        groff_ms_works=yes
 
756
    else
 
757
        groff_ms_works=no
 
758
    fi
 
759
    AC_MSG_RESULT([$groff_ms_works])
 
760
    AC_MSG_CHECKING([for ${GROFF} -mm macros])
 
761
    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
 
762
        groff_mm_works=yes
 
763
    else
 
764
        groff_mm_works=no
 
765
    fi
 
766
    AC_MSG_RESULT([$groff_mm_works])
 
767
fi
 
768
AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
 
769
AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
 
770
AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
 
771
]) # XORG_WITH_GROFF
 
772
 
 
773
# XORG_WITH_FOP
 
774
# ----------------
 
775
# Minimum version: 1.6.0
 
776
#
 
777
# Documentation tools are not always available on all platforms and sometimes
 
778
# not at the appropriate level. This macro enables a module to test for the
 
779
# presence of the tool and obtain it's path in separate variables. Coupled with
 
780
# the --with-fop option, it allows maximum flexibilty in making decisions
 
781
# as whether or not to use the fop package.
 
782
#
 
783
# Interface to module:
 
784
# HAVE_FOP:     used in makefiles to conditionally generate documentation
 
785
# FOP:          returns the path of the fop program found
 
786
#               returns the path set by the user in the environment
 
787
# --with-fop:   'yes' user instructs the module to use fop
 
788
#               'no' user instructs the module not to use fop
 
789
#
 
790
# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
 
791
#
 
792
AC_DEFUN([XORG_WITH_FOP],[
 
793
AC_ARG_VAR([FOP], [Path to fop command])
 
794
AC_ARG_WITH(fop,
 
795
        AS_HELP_STRING([--with-fop],
 
796
           [Use fop to regenerate documentation (default: yes, if installed)]),
 
797
           [use_fop=$withval], [use_fop=auto])
 
798
 
 
799
if test "x$use_fop" = x"auto"; then
 
800
   AC_PATH_PROG([FOP], [fop])
 
801
   if test "x$FOP" = "x"; then
 
802
        AC_MSG_WARN([fop not found - documentation targets will be skipped])
 
803
        have_fop=no
 
804
   else
 
805
        have_fop=yes
 
806
   fi
 
807
elif test "x$use_fop" = x"yes" ; then
 
808
   AC_PATH_PROG([FOP], [fop])
 
809
   if test "x$FOP" = "x"; then
 
810
        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
 
811
   fi
 
812
   have_fop=yes
 
813
elif test "x$use_fop" = x"no" ; then
 
814
   if test "x$FOP" != "x"; then
 
815
      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
 
816
   fi
 
817
   have_fop=no
 
818
else
 
819
   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
 
820
fi
 
821
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
 
822
]) # XORG_WITH_FOP
 
823
 
 
824
# XORG_WITH_PS2PDF
 
825
# ----------------
 
826
# Minimum version: 1.6.0
 
827
#
 
828
# Documentation tools are not always available on all platforms and sometimes
 
829
# not at the appropriate level. This macro enables a module to test for the
 
830
# presence of the tool and obtain it's path in separate variables. Coupled with
 
831
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
 
832
# as whether or not to use the ps2pdf package.
 
833
#
 
834
# Interface to module:
 
835
# HAVE_PS2PDF:  used in makefiles to conditionally generate documentation
 
836
# PS2PDF:       returns the path of the ps2pdf program found
 
837
#               returns the path set by the user in the environment
 
838
# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
 
839
#                'no' user instructs the module not to use ps2pdf
 
840
#
 
841
# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
 
842
#
 
843
AC_DEFUN([XORG_WITH_PS2PDF],[
 
844
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
 
845
AC_ARG_WITH(ps2pdf,
 
846
        AS_HELP_STRING([--with-ps2pdf],
 
847
           [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
 
848
           [use_ps2pdf=$withval], [use_ps2pdf=auto])
 
849
 
 
850
if test "x$use_ps2pdf" = x"auto"; then
 
851
   AC_PATH_PROG([PS2PDF], [ps2pdf])
 
852
   if test "x$PS2PDF" = "x"; then
 
853
        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
 
854
        have_ps2pdf=no
 
855
   else
 
856
        have_ps2pdf=yes
 
857
   fi
 
858
elif test "x$use_ps2pdf" = x"yes" ; then
 
859
   AC_PATH_PROG([PS2PDF], [ps2pdf])
 
860
   if test "x$PS2PDF" = "x"; then
 
861
        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
 
862
   fi
 
863
   have_ps2pdf=yes
 
864
elif test "x$use_ps2pdf" = x"no" ; then
 
865
   if test "x$PS2PDF" != "x"; then
 
866
      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
 
867
   fi
 
868
   have_ps2pdf=no
 
869
else
 
870
   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
 
871
fi
 
872
AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
 
873
]) # XORG_WITH_PS2PDF
 
874
 
 
875
# XORG_ENABLE_DOCS (enable_docs=yes)
 
876
# ----------------
 
877
# Minimum version: 1.6.0
 
878
#
 
879
# Documentation tools are not always available on all platforms and sometimes
 
880
# not at the appropriate level. This macro enables a builder to skip all
 
881
# documentation targets except traditional man pages.
 
882
# Combined with the specific tool checking macros XORG_WITH_*, it provides
 
883
# maximum flexibilty in controlling documentation building.
 
884
# Refer to:
 
885
# XORG_WITH_XMLTO         --with-xmlto
 
886
# XORG_WITH_ASCIIDOC      --with-asciidoc
 
887
# XORG_WITH_DOXYGEN       --with-doxygen
 
888
# XORG_WITH_FOP           --with-fop
 
889
# XORG_WITH_GROFF         --with-groff
 
890
# XORG_WITH_PS2PDF        --with-ps2pdf
 
891
#
 
892
# Interface to module:
 
893
# ENABLE_DOCS:    used in makefiles to conditionally generate documentation
 
894
# --enable-docs: 'yes' user instructs the module to generate docs
 
895
#                'no' user instructs the module not to generate docs
 
896
# parm1:        specify the default value, yes or no.
 
897
#
 
898
AC_DEFUN([XORG_ENABLE_DOCS],[
 
899
default=$1
 
900
if test "x$default" = x ; then
 
901
  default="yes"
 
902
fi
 
903
AC_ARG_ENABLE(docs,
 
904
        AS_HELP_STRING([--enable-docs],
 
905
           [Enable building the documentation (default: yes)]),
 
906
           [build_docs=$enableval], [build_docs=$default])
 
907
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
 
908
AC_MSG_CHECKING([whether to build documentation])
 
909
AC_MSG_RESULT([$build_docs])
 
910
]) # XORG_ENABLE_DOCS
 
911
 
 
912
# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
 
913
# ----------------
 
914
# Minimum version: 1.6.0
 
915
#
 
916
# This macro enables a builder to skip all developer documentation.
 
917
# Combined with the specific tool checking macros XORG_WITH_*, it provides
 
918
# maximum flexibilty in controlling documentation building.
 
919
# Refer to:
 
920
# XORG_WITH_XMLTO         --with-xmlto
 
921
# XORG_WITH_ASCIIDOC      --with-asciidoc
 
922
# XORG_WITH_DOXYGEN       --with-doxygen
 
923
# XORG_WITH_FOP           --with-fop
 
924
# XORG_WITH_GROFF         --with-groff
 
925
# XORG_WITH_PS2PDF        --with-ps2pdf
 
926
#
 
927
# Interface to module:
 
928
# ENABLE_DEVEL_DOCS:    used in makefiles to conditionally generate developer docs
 
929
# --enable-devel-docs:  'yes' user instructs the module to generate developer docs
 
930
#                       'no' user instructs the module not to generate developer docs
 
931
# parm1:                specify the default value, yes or no.
 
932
#
 
933
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
 
934
devel_default=$1
 
935
if test "x$devel_default" = x ; then
 
936
  devel_default="yes"
 
937
fi
 
938
AC_ARG_ENABLE(devel-docs,
 
939
        AS_HELP_STRING([--enable-devel-docs],
 
940
           [Enable building the developer documentation (default: yes)]),
 
941
           [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
 
942
AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
 
943
AC_MSG_CHECKING([whether to build developer documentation])
 
944
AC_MSG_RESULT([$build_devel_docs])
 
945
]) # XORG_ENABLE_DEVEL_DOCS
 
946
 
 
947
# XORG_ENABLE_SPECS (enable_specs=yes)
 
948
# ----------------
 
949
# Minimum version: 1.6.0
 
950
#
 
951
# This macro enables a builder to skip all functional specification targets.
 
952
# Combined with the specific tool checking macros XORG_WITH_*, it provides
 
953
# maximum flexibilty in controlling documentation building.
 
954
# Refer to:
 
955
# XORG_WITH_XMLTO         --with-xmlto
 
956
# XORG_WITH_ASCIIDOC      --with-asciidoc
 
957
# XORG_WITH_DOXYGEN       --with-doxygen
 
958
# XORG_WITH_FOP           --with-fop
 
959
# XORG_WITH_GROFF         --with-groff
 
960
# XORG_WITH_PS2PDF        --with-ps2pdf
 
961
#
 
962
# Interface to module:
 
963
# ENABLE_SPECS:         used in makefiles to conditionally generate specs
 
964
# --enable-specs:       'yes' user instructs the module to generate specs
 
965
#                       'no' user instructs the module not to generate specs
 
966
# parm1:                specify the default value, yes or no.
 
967
#
 
968
AC_DEFUN([XORG_ENABLE_SPECS],[
 
969
spec_default=$1
 
970
if test "x$spec_default" = x ; then
 
971
  spec_default="yes"
 
972
fi
 
973
AC_ARG_ENABLE(specs,
 
974
        AS_HELP_STRING([--enable-specs],
 
975
           [Enable building the specs (default: yes)]),
 
976
           [build_specs=$enableval], [build_specs=$spec_default])
 
977
AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
 
978
AC_MSG_CHECKING([whether to build functional specifications])
 
979
AC_MSG_RESULT([$build_specs])
 
980
]) # XORG_ENABLE_SPECS
 
981
 
 
982
# XORG_CHECK_MALLOC_ZERO
 
983
# ----------------------
 
984
# Minimum version: 1.0.0
 
985
#
 
986
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
 
987
# malloc(0) returns NULL.  Packages should add one of these cflags to
 
988
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
 
989
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
 
990
AC_ARG_ENABLE(malloc0returnsnull,
 
991
        AS_HELP_STRING([--enable-malloc0returnsnull],
 
992
                       [malloc(0) returns NULL (default: auto)]),
 
993
        [MALLOC_ZERO_RETURNS_NULL=$enableval],
 
994
        [MALLOC_ZERO_RETURNS_NULL=auto])
 
995
 
 
996
AC_MSG_CHECKING([whether malloc(0) returns NULL])
 
997
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
 
998
        AC_RUN_IFELSE([
 
999
char *malloc();
 
1000
char *realloc();
 
1001
char *calloc();
 
1002
main() {
 
1003
    char *m0, *r0, *c0, *p;
 
1004
    m0 = malloc(0);
 
1005
    p = malloc(10);
 
1006
    r0 = realloc(p,0);
 
1007
    c0 = calloc(0);
 
1008
    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
 
1009
}],
 
1010
                [MALLOC_ZERO_RETURNS_NULL=yes],
 
1011
                [MALLOC_ZERO_RETURNS_NULL=no],
 
1012
                [MALLOC_ZERO_RETURNS_NULL=yes])
 
1013
fi
 
1014
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
 
1015
 
 
1016
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
 
1017
        MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
 
1018
        XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
 
1019
        XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
 
1020
else
 
1021
        MALLOC_ZERO_CFLAGS=""
 
1022
        XMALLOC_ZERO_CFLAGS=""
 
1023
        XTMALLOC_ZERO_CFLAGS=""
 
1024
fi
 
1025
 
 
1026
AC_SUBST([MALLOC_ZERO_CFLAGS])
 
1027
AC_SUBST([XMALLOC_ZERO_CFLAGS])
 
1028
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
 
1029
]) # XORG_CHECK_MALLOC_ZERO
 
1030
 
 
1031
# XORG_WITH_LINT()
 
1032
# ----------------
 
1033
# Minimum version: 1.1.0
 
1034
#
 
1035
# Sets up flags for source checkers such as lint and sparse if --with-lint
 
1036
# is specified.   (Use --with-lint=sparse for sparse.)
 
1037
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
 
1038
# Sets $LINT_FLAGS to flags to pass to source checker
 
1039
# Sets LINT automake conditional if enabled (default: disabled)
 
1040
#
 
1041
AC_DEFUN([XORG_WITH_LINT],[
 
1042
 
 
1043
# Allow checking code with lint, sparse, etc.
 
1044
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
 
1045
                [Use a lint-style source code checker (default: disabled)])],
 
1046
                [use_lint=$withval], [use_lint=no])
 
1047
if test "x$use_lint" = "xyes" ; then
 
1048
        LINT="lint"
 
1049
else
 
1050
        LINT="$use_lint"
 
1051
fi
 
1052
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
 
1053
    case $LINT in
 
1054
        lint|*/lint)
 
1055
            case $host_os in
 
1056
                solaris*)
 
1057
                        LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
 
1058
                        ;;
 
1059
            esac
 
1060
            ;;
 
1061
    esac
 
1062
fi
 
1063
 
 
1064
AC_SUBST(LINT)
 
1065
AC_SUBST(LINT_FLAGS)
 
1066
AM_CONDITIONAL(LINT, [test x$LINT != xno])
 
1067
 
 
1068
]) # XORG_WITH_LINT
 
1069
 
 
1070
# XORG_LINT_LIBRARY(LIBNAME)
 
1071
# --------------------------
 
1072
# Minimum version: 1.1.0
 
1073
#
 
1074
# Sets up flags for building lint libraries for checking programs that call
 
1075
# functions in the library.
 
1076
# Disabled by default, enable with --enable-lint-library
 
1077
# Sets: 
 
1078
#       @LINTLIB@               - name of lint library file to make
 
1079
#       MAKE_LINT_LIB           - automake conditional
 
1080
#
 
1081
 
 
1082
AC_DEFUN([XORG_LINT_LIBRARY],[
 
1083
AC_REQUIRE([XORG_WITH_LINT])
 
1084
# Build lint "library" for more indepth checks of programs calling this library
 
1085
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
 
1086
        [Create lint library (default: disabled)])],
 
1087
        [make_lint_lib=$enableval], [make_lint_lib=no])
 
1088
if test "x$make_lint_lib" != "xno" ; then
 
1089
        if test "x$LINT" = "xno" ; then
 
1090
                AC_MSG_ERROR([Cannot make lint library without --with-lint])
 
1091
        fi
 
1092
        if test "x$make_lint_lib" = "xyes" ; then
 
1093
                LINTLIB=llib-l$1.ln
 
1094
        else
 
1095
                LINTLIB=$make_lint_lib
 
1096
        fi
 
1097
fi
 
1098
AC_SUBST(LINTLIB)
 
1099
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
 
1100
 
 
1101
]) # XORG_LINT_LIBRARY
 
1102
 
 
1103
# XORG_CWARNFLAGS
 
1104
# ---------------
 
1105
# Minimum version: 1.2.0
 
1106
#
 
1107
# Defines CWARNFLAGS to enable C compiler warnings.
 
1108
#
 
1109
AC_DEFUN([XORG_CWARNFLAGS], [
 
1110
AC_REQUIRE([AC_PROG_CC])
 
1111
if  test "x$GCC" = xyes ; then
 
1112
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
 
1113
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
 
1114
-Wbad-function-cast -Wformat=2"
 
1115
    case `$CC -dumpversion` in
 
1116
    3.4.* | 4.*)
 
1117
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
 
1118
        ;;
 
1119
    esac
 
1120
else
 
1121
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
1122
    if test "x$SUNCC" = "xyes"; then
 
1123
        CWARNFLAGS="-v"
 
1124
    fi
 
1125
fi
 
1126
AC_SUBST(CWARNFLAGS)
 
1127
]) # XORG_CWARNFLAGS
 
1128
 
 
1129
# XORG_STRICT_OPTION
 
1130
# -----------------------
 
1131
# Minimum version: 1.3.0
 
1132
#
 
1133
# Add configure option to enable strict compilation
 
1134
AC_DEFUN([XORG_STRICT_OPTION], [
 
1135
AC_REQUIRE([AC_PROG_CC])
 
1136
AC_REQUIRE([AC_PROG_CC_C99])
 
1137
AC_REQUIRE([XORG_CWARNFLAGS])
 
1138
 
 
1139
AC_ARG_ENABLE(strict-compilation,
 
1140
                          AS_HELP_STRING([--enable-strict-compilation],
 
1141
                          [Enable all warnings from compiler and make them errors (default: disabled)]),
 
1142
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
 
1143
if test "x$STRICT_COMPILE" = "xyes"; then
 
1144
        AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
1145
        AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
 
1146
        if test "x$GCC" = xyes ; then
 
1147
                STRICT_CFLAGS="-pedantic -Werror"
 
1148
        elif test "x$SUNCC" = "xyes"; then
 
1149
                STRICT_CFLAGS="-errwarn"
 
1150
    elif test "x$INTELCC" = "xyes"; then
 
1151
                STRICT_CFLAGS="-Werror"
 
1152
        fi
 
1153
fi
 
1154
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
 
1155
AC_SUBST([CWARNFLAGS])
 
1156
]) # XORG_STRICT_OPTION
 
1157
 
 
1158
# XORG_DEFAULT_OPTIONS
 
1159
# --------------------
 
1160
# Minimum version: 1.3.0
 
1161
#
 
1162
# Defines default options for X.Org modules.
 
1163
#
 
1164
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
 
1165
XORG_CWARNFLAGS
 
1166
XORG_STRICT_OPTION
 
1167
XORG_RELEASE_VERSION
 
1168
XORG_CHANGELOG
 
1169
XORG_INSTALL
 
1170
XORG_MANPAGE_SECTIONS
 
1171
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
 
1172
    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
 
1173
]) # XORG_DEFAULT_OPTIONS
 
1174
 
 
1175
# XORG_INSTALL()
 
1176
# ----------------
 
1177
# Minimum version: 1.4.0
 
1178
#
 
1179
# Defines the variable INSTALL_CMD as the command to copy
 
1180
# INSTALL from $prefix/share/util-macros.
 
1181
#
 
1182
AC_DEFUN([XORG_INSTALL], [
 
1183
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1184
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
 
1185
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
 
1186
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
 
1187
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
 
1188
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
 
1189
AC_SUBST([INSTALL_CMD])
 
1190
]) # XORG_INSTALL
 
1191
dnl Copyright 2005 Red Hat, Inc
 
1192
dnl
 
1193
dnl Permission to use, copy, modify, distribute, and sell this software and its
 
1194
dnl documentation for any purpose is hereby granted without fee, provided that
 
1195
dnl the above copyright notice appear in all copies and that both that
 
1196
dnl copyright notice and this permission notice appear in supporting
 
1197
dnl documentation.
 
1198
dnl
 
1199
dnl The above copyright notice and this permission notice shall be included
 
1200
dnl in all copies or substantial portions of the Software.
 
1201
dnl
 
1202
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
1203
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
1204
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
1205
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
1206
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
1207
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
1208
dnl OTHER DEALINGS IN THE SOFTWARE.
 
1209
dnl
 
1210
dnl Except as contained in this notice, the name of the copyright holders shall
 
1211
dnl not be used in advertising or otherwise to promote the sale, use or
 
1212
dnl other dealings in this Software without prior written authorization
 
1213
dnl from the copyright holders.
 
1214
dnl
 
1215
 
 
1216
# XORG_RELEASE_VERSION
 
1217
# --------------------
 
1218
# Adds --with/without-release-string and changes the PACKAGE and
 
1219
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
 
1220
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
 
1221
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
 
1222
 
 
1223
AC_DEFUN([XORG_RELEASE_VERSION],[
 
1224
        AC_ARG_WITH(release-version,
 
1225
                        AS_HELP_STRING([--with-release-version=STRING],
 
1226
                                [Use release version string in package name]),
 
1227
                        [RELEASE_VERSION="$withval"],
 
1228
                        [RELEASE_VERSION=""])
 
1229
        if test "x$RELEASE_VERSION" != "x"; then
 
1230
                PACKAGE="$PACKAGE-$RELEASE_VERSION"
 
1231
                PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
 
1232
                AC_MSG_NOTICE([Building with package name set to $PACKAGE])
 
1233
        fi
 
1234
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
 
1235
                [`echo $PACKAGE_VERSION | cut -d . -f 1`],
 
1236
                [Major version of this package])
 
1237
        PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
 
1238
        if test "x$PVM" = "x"; then
 
1239
                PVM="0"
 
1240
        fi
 
1241
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
 
1242
                [$PVM],
 
1243
                [Minor version of this package])
 
1244
        PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
 
1245
        if test "x$PVP" = "x"; then
 
1246
                PVP="0"
 
1247
        fi
 
1248
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
 
1249
                [$PVP],
 
1250
                [Patch version of this package])
 
1251
])
 
1252
 
 
1253
# XORG_CHANGELOG()
 
1254
# ----------------
 
1255
# Minimum version: 1.2.0
 
1256
#
 
1257
# Defines the variable CHANGELOG_CMD as the command to generate
 
1258
# ChangeLog from git.
 
1259
#
 
1260
#
 
1261
AC_DEFUN([XORG_CHANGELOG], [
 
1262
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
 
1263
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
 
1264
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
 
1265
echo 'git directory not found: installing possibly empty changelog.' >&2)"
 
1266
AC_SUBST([CHANGELOG_CMD])
 
1267
]) # XORG_CHANGELOG
 
1268
 
22
1269
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23
1270
#
24
1271
# This file is free software; the Free Software Foundation
34
1281
[am__api_version='1.11'
35
1282
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36
1283
dnl require some minimum version.  Point them to the right macro.
37
 
m4_if([$1], [1.11], [],
 
1284
m4_if([$1], [1.11.1], [],
38
1285
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39
1286
])
40
1287
 
50
1297
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51
1298
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52
1299
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53
 
[AM_AUTOMAKE_VERSION([1.11])dnl
 
1300
[AM_AUTOMAKE_VERSION([1.11.1])dnl
54
1301
m4_ifndef([AC_AUTOCONF_VERSION],
55
1302
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56
1303
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
587
1834
rmdir .tst 2>/dev/null
588
1835
AC_SUBST([am__leading_dot])])
589
1836
 
 
1837
# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 
1838
# From Jim Meyering
 
1839
 
 
1840
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 
1841
# Free Software Foundation, Inc.
 
1842
#
 
1843
# This file is free software; the Free Software Foundation
 
1844
# gives unlimited permission to copy and/or distribute it,
 
1845
# with or without modifications, as long as this notice is preserved.
 
1846
 
 
1847
# serial 5
 
1848
 
 
1849
# AM_MAINTAINER_MODE([DEFAULT-MODE])
 
1850
# ----------------------------------
 
1851
# Control maintainer-specific portions of Makefiles.
 
1852
# Default is to disable them, unless `enable' is passed literally.
 
1853
# For symmetry, `disable' may be passed as well.  Anyway, the user
 
1854
# can override the default with the --enable/--disable switch.
 
1855
AC_DEFUN([AM_MAINTAINER_MODE],
 
1856
[m4_case(m4_default([$1], [disable]),
 
1857
       [enable], [m4_define([am_maintainer_other], [disable])],
 
1858
       [disable], [m4_define([am_maintainer_other], [enable])],
 
1859
       [m4_define([am_maintainer_other], [enable])
 
1860
        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
 
1861
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
 
1862
  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
 
1863
  AC_ARG_ENABLE([maintainer-mode],
 
1864
[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
 
1865
                          (and sometimes confusing) to the casual installer],
 
1866
      [USE_MAINTAINER_MODE=$enableval],
 
1867
      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
 
1868
  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
 
1869
  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
 
1870
  MAINT=$MAINTAINER_MODE_TRUE
 
1871
  AC_SUBST([MAINT])dnl
 
1872
]
 
1873
)
 
1874
 
 
1875
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
 
1876
 
590
1877
# Check to see how 'make' treats includes.                  -*- Autoconf -*-
591
1878
 
592
1879
# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
806
2093
fi
807
2094
AC_MSG_RESULT(yes)])
808
2095
 
 
2096
# Copyright (C) 2009  Free Software Foundation, Inc.
 
2097
#
 
2098
# This file is free software; the Free Software Foundation
 
2099
# gives unlimited permission to copy and/or distribute it,
 
2100
# with or without modifications, as long as this notice is preserved.
 
2101
 
 
2102
# serial 1
 
2103
 
 
2104
# AM_SILENT_RULES([DEFAULT])
 
2105
# --------------------------
 
2106
# Enable less verbose build rules; with the default set to DEFAULT
 
2107
# (`yes' being less verbose, `no' or empty being verbose).
 
2108
AC_DEFUN([AM_SILENT_RULES],
 
2109
[AC_ARG_ENABLE([silent-rules],
 
2110
[  --enable-silent-rules          less verbose build output (undo: `make V=1')
 
2111
  --disable-silent-rules         verbose build output (undo: `make V=0')])
 
2112
case $enable_silent_rules in
 
2113
yes) AM_DEFAULT_VERBOSITY=0;;
 
2114
no)  AM_DEFAULT_VERBOSITY=1;;
 
2115
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 
2116
esac
 
2117
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 
2118
AM_BACKSLASH='\'
 
2119
AC_SUBST([AM_BACKSLASH])dnl
 
2120
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 
2121
])
 
2122
 
809
2123
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
810
2124
#
811
2125
# This file is free software; the Free Software Foundation
949
2263
AC_SUBST([am__untar])
950
2264
]) # _AM_PROG_TAR
951
2265
 
952
 
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
953
 
dnl
954
 
dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
955
 
dnl 
956
 
dnl Permission is hereby granted, free of charge, to any person obtaining a
957
 
dnl copy of this software and associated documentation files (the
958
 
dnl "Software"), to deal in the Software without restriction, including
959
 
dnl without limitation the rights to use, copy, modify, merge, publish,
960
 
dnl distribute, and/or sell copies of the Software, and to permit persons
961
 
dnl to whom the Software is furnished to do so, provided that the above
962
 
dnl copyright notice(s) and this permission notice appear in all copies of
963
 
dnl the Software and that both the above copyright notice(s) and this
964
 
dnl permission notice appear in supporting documentation.
965
 
dnl
966
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
967
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
968
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
969
 
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
970
 
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
971
 
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
972
 
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
973
 
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
974
 
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
975
 
dnl
976
 
dnl Except as contained in this notice, the name of a copyright holder
977
 
dnl shall not be used in advertising or otherwise to promote the sale, use
978
 
dnl or other dealings in this Software without prior written authorization
979
 
dnl of the copyright holder.
980
 
 
981
 
# XORG_MACROS_VERSION(required-version)
982
 
# -------------------------------------
983
 
# Minimum version: 1.1.0
984
 
#
985
 
# If you're using a macro added in Version 1.1 or newer, include this in
986
 
# your configure.ac with the minimum required version, such as:
987
 
# XORG_MACROS_VERSION(1.1)
988
 
#
989
 
# To ensure that this macro is defined, also add:
990
 
# m4_ifndef([XORG_MACROS_VERSION],
991
 
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
992
 
#
993
 
#
994
 
# See the "minimum version" comment for each macro you use to see what 
995
 
# version you require.
996
 
m4_defun([XORG_MACROS_VERSION],[
997
 
m4_define([vers_have], [1.3.0])
998
 
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
999
 
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1000
 
m4_if(m4_cmp(maj_have, maj_needed), 0,,
1001
 
    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1002
 
m4_if(m4_version_compare(vers_have, [$1]), -1,
1003
 
    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1004
 
m4_undefine([vers_have])
1005
 
m4_undefine([maj_have])
1006
 
m4_undefine([maj_needed])
1007
 
]) # XORG_MACROS_VERSION
1008
 
 
1009
 
# XORG_PROG_RAWCPP()
1010
 
# ------------------
1011
 
# Minimum version: 1.0.0
1012
 
#
1013
 
# Find cpp program and necessary flags for use in pre-processing text files
1014
 
# such as man pages and config files
1015
 
AC_DEFUN([XORG_PROG_RAWCPP],[
1016
 
AC_REQUIRE([AC_PROG_CPP])
1017
 
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1018
 
   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1019
 
 
1020
 
# Check for flag to avoid builtin definitions - assumes unix is predefined,
1021
 
# which is not the best choice for supporting other OS'es, but covers most
1022
 
# of the ones we need for now.
1023
 
AC_MSG_CHECKING([if $RAWCPP requires -undef])
1024
 
AC_LANG_CONFTEST([Does cpp redefine unix ?])
1025
 
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1026
 
        AC_MSG_RESULT([no])
1027
 
else
1028
 
        if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1029
 
                RAWCPPFLAGS=-undef
1030
 
                AC_MSG_RESULT([yes])
1031
 
        # under Cygwin unix is still defined even with -undef
1032
 
        elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1033
 
                RAWCPPFLAGS="-undef -ansi"
1034
 
                AC_MSG_RESULT([yes, with -ansi])
1035
 
        else
1036
 
                AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1037
 
        fi
1038
 
fi
1039
 
rm -f conftest.$ac_ext
1040
 
 
1041
 
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1042
 
AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1043
 
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1044
 
        AC_MSG_RESULT([no])
1045
 
else
1046
 
        if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1047
 
                RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1048
 
                AC_MSG_RESULT([yes])
1049
 
        else
1050
 
                AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1051
 
        fi
1052
 
fi
1053
 
rm -f conftest.$ac_ext
1054
 
AC_SUBST(RAWCPPFLAGS)
1055
 
]) # XORG_PROG_RAWCPP
1056
 
 
1057
 
# XORG_MANPAGE_SECTIONS()
1058
 
# -----------------------
1059
 
# Minimum version: 1.0.0
1060
 
#
1061
 
# Determine which sections man pages go in for the different man page types
1062
 
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1063
 
# Not sure if there's any better way than just hardcoding by OS name.
1064
 
# Override default settings by setting environment variables
1065
 
 
1066
 
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1067
 
AC_REQUIRE([AC_CANONICAL_HOST])
1068
 
 
1069
 
if test x$APP_MAN_SUFFIX = x    ; then
1070
 
    APP_MAN_SUFFIX=1
1071
 
fi
1072
 
if test x$APP_MAN_DIR = x    ; then
1073
 
    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1074
 
fi
1075
 
 
1076
 
if test x$LIB_MAN_SUFFIX = x    ; then
1077
 
    LIB_MAN_SUFFIX=3
1078
 
fi
1079
 
if test x$LIB_MAN_DIR = x    ; then
1080
 
    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1081
 
fi
1082
 
 
1083
 
if test x$FILE_MAN_SUFFIX = x    ; then
1084
 
    case $host_os in
1085
 
        solaris*)       FILE_MAN_SUFFIX=4  ;;
1086
 
        *)              FILE_MAN_SUFFIX=5  ;;
1087
 
    esac
1088
 
fi
1089
 
if test x$FILE_MAN_DIR = x    ; then
1090
 
    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1091
 
fi
1092
 
 
1093
 
if test x$MISC_MAN_SUFFIX = x    ; then
1094
 
    case $host_os in
1095
 
        solaris*)       MISC_MAN_SUFFIX=5  ;;
1096
 
        *)              MISC_MAN_SUFFIX=7  ;;
1097
 
    esac
1098
 
fi
1099
 
if test x$MISC_MAN_DIR = x    ; then
1100
 
    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1101
 
fi
1102
 
 
1103
 
if test x$DRIVER_MAN_SUFFIX = x    ; then
1104
 
    case $host_os in
1105
 
        solaris*)       DRIVER_MAN_SUFFIX=7  ;;
1106
 
        *)              DRIVER_MAN_SUFFIX=4  ;;
1107
 
    esac
1108
 
fi
1109
 
if test x$DRIVER_MAN_DIR = x    ; then
1110
 
    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1111
 
fi
1112
 
 
1113
 
if test x$ADMIN_MAN_SUFFIX = x    ; then
1114
 
    case $host_os in
1115
 
        solaris*)       ADMIN_MAN_SUFFIX=1m ;;
1116
 
        *)              ADMIN_MAN_SUFFIX=8  ;;
1117
 
    esac
1118
 
fi
1119
 
if test x$ADMIN_MAN_DIR = x    ; then
1120
 
    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1121
 
fi
1122
 
 
1123
 
 
1124
 
AC_SUBST([APP_MAN_SUFFIX])
1125
 
AC_SUBST([LIB_MAN_SUFFIX])
1126
 
AC_SUBST([FILE_MAN_SUFFIX])
1127
 
AC_SUBST([MISC_MAN_SUFFIX])
1128
 
AC_SUBST([DRIVER_MAN_SUFFIX])
1129
 
AC_SUBST([ADMIN_MAN_SUFFIX])
1130
 
AC_SUBST([APP_MAN_DIR])
1131
 
AC_SUBST([LIB_MAN_DIR])
1132
 
AC_SUBST([FILE_MAN_DIR])
1133
 
AC_SUBST([MISC_MAN_DIR])
1134
 
AC_SUBST([DRIVER_MAN_DIR])
1135
 
AC_SUBST([ADMIN_MAN_DIR])
1136
 
]) # XORG_MANPAGE_SECTIONS
1137
 
 
1138
 
# XORG_CHECK_LINUXDOC
1139
 
# -------------------
1140
 
# Minimum version: 1.0.0
1141
 
#
1142
 
# Defines the variable MAKE_TEXT if the necessary tools and
1143
 
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1144
 
# Whether or not the necessary tools and files are found can be checked
1145
 
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1146
 
AC_DEFUN([XORG_CHECK_LINUXDOC],[
1147
 
if test x$XORG_SGML_PATH = x ; then
1148
 
    XORG_SGML_PATH=$prefix/share/sgml
1149
 
fi
1150
 
HAVE_DEFS_ENT=
1151
 
 
1152
 
if test x"$cross_compiling" = x"yes" ; then
1153
 
  HAVE_DEFS_ENT=no
1154
 
else
1155
 
  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1156
 
fi
1157
 
 
1158
 
AC_PATH_PROG(LINUXDOC, linuxdoc)
1159
 
AC_PATH_PROG(PS2PDF, ps2pdf)
1160
 
 
1161
 
AC_MSG_CHECKING([Whether to build documentation])
1162
 
 
1163
 
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1164
 
   BUILDDOC=yes
1165
 
else
1166
 
   BUILDDOC=no
1167
 
fi
1168
 
 
1169
 
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1170
 
 
1171
 
AC_MSG_RESULT([$BUILDDOC])
1172
 
 
1173
 
AC_MSG_CHECKING([Whether to build pdf documentation])
1174
 
 
1175
 
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1176
 
   BUILDPDFDOC=yes
1177
 
else
1178
 
   BUILDPDFDOC=no
1179
 
fi
1180
 
 
1181
 
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1182
 
 
1183
 
AC_MSG_RESULT([$BUILDPDFDOC])
1184
 
 
1185
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1186
 
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1187
 
MAKE_PDF="$PS2PDF"
1188
 
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1189
 
 
1190
 
AC_SUBST(MAKE_TEXT)
1191
 
AC_SUBST(MAKE_PS)
1192
 
AC_SUBST(MAKE_PDF)
1193
 
AC_SUBST(MAKE_HTML)
1194
 
]) # XORG_CHECK_LINUXDOC
1195
 
 
1196
 
# XORG_CHECK_DOCBOOK
1197
 
# -------------------
1198
 
# Minimum version: 1.0.0
1199
 
#
1200
 
# Checks for the ability to build output formats from SGML DocBook source.
1201
 
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1202
 
# indicates whether the necessary tools and files are found and, if set,
1203
 
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1204
 
AC_DEFUN([XORG_CHECK_DOCBOOK],[
1205
 
if test x$XORG_SGML_PATH = x ; then
1206
 
    XORG_SGML_PATH=$prefix/share/sgml
1207
 
fi
1208
 
HAVE_DEFS_ENT=
1209
 
BUILDTXTDOC=no
1210
 
BUILDPDFDOC=no
1211
 
BUILDPSDOC=no
1212
 
BUILDHTMLDOC=no
1213
 
 
1214
 
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1215
 
 
1216
 
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1217
 
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1218
 
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1219
 
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1220
 
 
1221
 
AC_MSG_CHECKING([Whether to build text documentation])
1222
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1223
 
   test x$BUILD_TXTDOC != xno; then
1224
 
        BUILDTXTDOC=yes
1225
 
fi
1226
 
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1227
 
AC_MSG_RESULT([$BUILDTXTDOC])
1228
 
 
1229
 
AC_MSG_CHECKING([Whether to build PDF documentation])
1230
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1231
 
   test x$BUILD_PDFDOC != xno; then
1232
 
        BUILDPDFDOC=yes
1233
 
fi
1234
 
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1235
 
AC_MSG_RESULT([$BUILDPDFDOC])
1236
 
 
1237
 
AC_MSG_CHECKING([Whether to build PostScript documentation])
1238
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1239
 
   test x$BUILD_PSDOC != xno; then
1240
 
        BUILDPSDOC=yes
1241
 
fi
1242
 
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1243
 
AC_MSG_RESULT([$BUILDPSDOC])
1244
 
 
1245
 
AC_MSG_CHECKING([Whether to build HTML documentation])
1246
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1247
 
   test x$BUILD_HTMLDOC != xno; then
1248
 
        BUILDHTMLDOC=yes
1249
 
fi
1250
 
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1251
 
AC_MSG_RESULT([$BUILDHTMLDOC])
1252
 
 
1253
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1254
 
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1255
 
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1256
 
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1257
 
 
1258
 
AC_SUBST(MAKE_TEXT)
1259
 
AC_SUBST(MAKE_PS)
1260
 
AC_SUBST(MAKE_PDF)
1261
 
AC_SUBST(MAKE_HTML)
1262
 
]) # XORG_CHECK_DOCBOOK
1263
 
 
1264
 
# XORG_CHECK_MALLOC_ZERO
1265
 
# ----------------------
1266
 
# Minimum version: 1.0.0
1267
 
#
1268
 
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1269
 
# malloc(0) returns NULL.  Packages should add one of these cflags to
1270
 
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1271
 
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1272
 
AC_ARG_ENABLE(malloc0returnsnull,
1273
 
        AS_HELP_STRING([--enable-malloc0returnsnull],
1274
 
                       [malloc(0) returns NULL (default: auto)]),
1275
 
        [MALLOC_ZERO_RETURNS_NULL=$enableval],
1276
 
        [MALLOC_ZERO_RETURNS_NULL=auto])
1277
 
 
1278
 
AC_MSG_CHECKING([whether malloc(0) returns NULL])
1279
 
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1280
 
        AC_RUN_IFELSE([
1281
 
char *malloc();
1282
 
char *realloc();
1283
 
char *calloc();
1284
 
main() {
1285
 
    char *m0, *r0, *c0, *p;
1286
 
    m0 = malloc(0);
1287
 
    p = malloc(10);
1288
 
    r0 = realloc(p,0);
1289
 
    c0 = calloc(0);
1290
 
    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1291
 
}],
1292
 
                [MALLOC_ZERO_RETURNS_NULL=yes],
1293
 
                [MALLOC_ZERO_RETURNS_NULL=no])
1294
 
fi
1295
 
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1296
 
 
1297
 
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1298
 
        MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1299
 
        XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1300
 
        XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1301
 
else
1302
 
        MALLOC_ZERO_CFLAGS=""
1303
 
        XMALLOC_ZERO_CFLAGS=""
1304
 
        XTMALLOC_ZERO_CFLAGS=""
1305
 
fi
1306
 
 
1307
 
AC_SUBST([MALLOC_ZERO_CFLAGS])
1308
 
AC_SUBST([XMALLOC_ZERO_CFLAGS])
1309
 
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1310
 
]) # XORG_CHECK_MALLOC_ZERO
1311
 
 
1312
 
# XORG_WITH_LINT()
1313
 
# ----------------
1314
 
# Minimum version: 1.1.0
1315
 
#
1316
 
# Sets up flags for source checkers such as lint and sparse if --with-lint
1317
 
# is specified.   (Use --with-lint=sparse for sparse.)
1318
 
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1319
 
# Sets $LINT_FLAGS to flags to pass to source checker
1320
 
# Sets LINT automake conditional if enabled (default: disabled)
1321
 
#
1322
 
AC_DEFUN([XORG_WITH_LINT],[
1323
 
 
1324
 
# Allow checking code with lint, sparse, etc.
1325
 
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1326
 
                [Use a lint-style source code checker (default: disabled)])],
1327
 
                [use_lint=$withval], [use_lint=no])
1328
 
if test "x$use_lint" = "xyes" ; then
1329
 
        LINT="lint"
1330
 
else
1331
 
        LINT="$use_lint"
1332
 
fi
1333
 
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1334
 
    case $LINT in
1335
 
        lint|*/lint)
1336
 
            case $host_os in
1337
 
                solaris*)
1338
 
                        LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1339
 
                        ;;
1340
 
            esac
1341
 
            ;;
1342
 
    esac
1343
 
fi
1344
 
 
1345
 
AC_SUBST(LINT)
1346
 
AC_SUBST(LINT_FLAGS)
1347
 
AM_CONDITIONAL(LINT, [test x$LINT != xno])
1348
 
 
1349
 
]) # XORG_WITH_LINT
1350
 
 
1351
 
# XORG_LINT_LIBRARY(LIBNAME)
1352
 
# --------------------------
1353
 
# Minimum version: 1.1.0
1354
 
#
1355
 
# Sets up flags for building lint libraries for checking programs that call
1356
 
# functions in the library.
1357
 
# Disabled by default, enable with --enable-lint-library
1358
 
# Sets: 
1359
 
#       @LINTLIB@               - name of lint library file to make
1360
 
#       MAKE_LINT_LIB           - automake conditional
1361
 
#
1362
 
 
1363
 
AC_DEFUN([XORG_LINT_LIBRARY],[
1364
 
AC_REQUIRE([XORG_WITH_LINT])
1365
 
# Build lint "library" for more indepth checks of programs calling this library
1366
 
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1367
 
        [Create lint library (default: disabled)])],
1368
 
        [make_lint_lib=$enableval], [make_lint_lib=no])
1369
 
if test "x$make_lint_lib" != "xno" ; then
1370
 
        if test "x$LINT" = "xno" ; then
1371
 
                AC_MSG_ERROR([Cannot make lint library without --with-lint])
1372
 
        fi
1373
 
        if test "x$make_lint_lib" = "xyes" ; then
1374
 
                LINTLIB=llib-l$1.ln
1375
 
        else
1376
 
                LINTLIB=$make_lint_lib
1377
 
        fi
1378
 
fi
1379
 
AC_SUBST(LINTLIB)
1380
 
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1381
 
 
1382
 
]) # XORG_LINT_LIBRARY
1383
 
 
1384
 
# XORG_CWARNFLAGS
1385
 
# ---------------
1386
 
# Minimum version: 1.2.0
1387
 
#
1388
 
# Defines CWARNFLAGS to enable C compiler warnings.
1389
 
#
1390
 
AC_DEFUN([XORG_CWARNFLAGS], [
1391
 
AC_REQUIRE([AC_PROG_CC])
1392
 
if  test "x$GCC" = xyes ; then
1393
 
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1394
 
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1395
 
-Wbad-function-cast"
1396
 
    case `$CC -dumpversion` in
1397
 
    3.4.* | 4.*)
1398
 
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1399
 
        ;;
1400
 
    esac
1401
 
else
1402
 
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1403
 
    if test "x$SUNCC" = "xyes"; then
1404
 
        CWARNFLAGS="-v"
1405
 
    fi
1406
 
fi
1407
 
AC_SUBST(CWARNFLAGS)
1408
 
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1409
 
]) # XORG_CWARNFLAGS
1410
 
 
1411
 
# XORG_STRICT_OPTION
1412
 
# -----------------------
1413
 
# Minimum version: 1.3.0
1414
 
#
1415
 
# Add configure option to enable strict compilation
1416
 
AC_DEFUN([XORG_STRICT_OPTION], [
1417
 
AC_REQUIRE([AC_PROG_CC])
1418
 
AC_REQUIRE([AC_PROG_CC_C99])
1419
 
AC_REQUIRE([XORG_CWARNFLAGS])
1420
 
 
1421
 
AC_ARG_ENABLE(strict-compilation,
1422
 
                          AS_HELP_STRING([--enable-strict-compilation],
1423
 
                          [Enable all warnings from compiler and make them errors (default: disabled)]),
1424
 
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1425
 
if test "x$STRICT_COMPILE" = "xyes"; then
1426
 
        AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1427
 
        AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1428
 
        if test "x$GCC" = xyes ; then
1429
 
                STRICT_CFLAGS="-pedantic -Werror"
1430
 
        elif test "x$SUNCC" = "xyes"; then
1431
 
                STRICT_CFLAGS="-errwarn"
1432
 
    elif test "x$INTELCC" = "xyes"; then
1433
 
                STRICT_CFLAGS="-Werror"
1434
 
        fi
1435
 
fi
1436
 
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1437
 
AC_SUBST([CWARNFLAGS])
1438
 
]) # XORG_STRICT_OPTION
1439
 
 
1440
 
# XORG_DEFAULT_OPTIONS
1441
 
# --------------------
1442
 
# Minimum version: 1.3.0
1443
 
#
1444
 
# Defines default options for X.Org modules.
1445
 
#
1446
 
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1447
 
XORG_CWARNFLAGS
1448
 
XORG_STRICT_OPTION
1449
 
XORG_RELEASE_VERSION
1450
 
XORG_CHANGELOG
1451
 
XORG_MANPAGE_SECTIONS
1452
 
]) # XORG_DEFAULT_OPTIONS
1453
 
dnl Copyright 2005 Red Hat, Inc
1454
 
dnl
1455
 
dnl Permission to use, copy, modify, distribute, and sell this software and its
1456
 
dnl documentation for any purpose is hereby granted without fee, provided that
1457
 
dnl the above copyright notice appear in all copies and that both that
1458
 
dnl copyright notice and this permission notice appear in supporting
1459
 
dnl documentation.
1460
 
dnl
1461
 
dnl The above copyright notice and this permission notice shall be included
1462
 
dnl in all copies or substantial portions of the Software.
1463
 
dnl
1464
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1465
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1466
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1467
 
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1468
 
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1469
 
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1470
 
dnl OTHER DEALINGS IN THE SOFTWARE.
1471
 
dnl
1472
 
dnl Except as contained in this notice, the name of the copyright holders shall
1473
 
dnl not be used in advertising or otherwise to promote the sale, use or
1474
 
dnl other dealings in this Software without prior written authorization
1475
 
dnl from the copyright holders.
1476
 
dnl
1477
 
 
1478
 
# XORG_RELEASE_VERSION
1479
 
# --------------------
1480
 
# Adds --with/without-release-string and changes the PACKAGE and
1481
 
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1482
 
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1483
 
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1484
 
 
1485
 
AC_DEFUN([XORG_RELEASE_VERSION],[
1486
 
        AC_ARG_WITH(release-version,
1487
 
                        AS_HELP_STRING([--with-release-version=STRING],
1488
 
                                [Use release version string in package name]),
1489
 
                        [RELEASE_VERSION="$withval"],
1490
 
                        [RELEASE_VERSION=""])
1491
 
        if test "x$RELEASE_VERSION" != "x"; then
1492
 
                PACKAGE="$PACKAGE-$RELEASE_VERSION"
1493
 
                PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1494
 
                AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1495
 
        fi
1496
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1497
 
                [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1498
 
                [Major version of this package])
1499
 
        PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1500
 
        if test "x$PVM" = "x"; then
1501
 
                PVM="0"
1502
 
        fi
1503
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1504
 
                [$PVM],
1505
 
                [Minor version of this package])
1506
 
        PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1507
 
        if test "x$PVP" = "x"; then
1508
 
                PVP="0"
1509
 
        fi
1510
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1511
 
                [$PVP],
1512
 
                [Patch version of this package])
1513
 
])
1514
 
 
1515
 
# XORG_CHANGELOG()
1516
 
# ----------------
1517
 
# Minimum version: 1.2.0
1518
 
#
1519
 
# Defines the variable CHANGELOG_CMD as the command to generate
1520
 
# ChangeLog from git.
1521
 
#
1522
 
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1523
 
#
1524
 
AC_DEFUN([XORG_CHANGELOG], [
1525
 
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1526
 
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1527
 
echo 'git directory not found: installing possibly empty changelog.' >&2)"
1528
 
AC_SUBST([CHANGELOG_CMD])
1529
 
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1530
 
]) # XORG_CHANGELOG
1531