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'.])])
22
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
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.
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.
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.
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.
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])
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
65
])# PKG_PROG_PKG_CONFIG
67
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
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.
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], [:])
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
94
PKG_CHECK_EXISTS([$3],
95
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
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
110
_pkg_short_errors_supported=no
112
])# _PKG_SHORT_ERRORS_SUPPORTED
115
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116
# [ACTION-IF-NOT-FOUND])
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
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
131
AC_MSG_CHECKING([for $1])
133
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
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.])
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"`
145
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
147
# Put the nasty error message in config.log where it belongs
148
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150
ifelse([$4], , [AC_MSG_ERROR(dnl
151
[Package requirements ($2) were not met:
155
Consider adjusting the PKG_CONFIG_PATH environment variable if you
156
installed software in a non-standard prefix.
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
170
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
173
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
176
ifelse([$3], , :, [$3])
178
])# PKG_CHECK_MODULES
180
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
182
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
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:
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
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.
203
# XORG_MACROS_VERSION(required-version)
204
# -------------------------------------
205
# Minimum version: 1.1.0
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)
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
# 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
233
# Minimum version: 1.0.0
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])
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
250
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
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])
258
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
261
rm -f conftest.$ac_ext
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
268
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
269
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
272
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
275
rm -f conftest.$ac_ext
276
AC_SUBST(RAWCPPFLAGS)
277
]) # XORG_PROG_RAWCPP
279
# XORG_MANPAGE_SECTIONS()
280
# -----------------------
281
# Minimum version: 1.0.0
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
288
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
289
AC_REQUIRE([AC_CANONICAL_HOST])
291
if test x$APP_MAN_SUFFIX = x ; then
294
if test x$APP_MAN_DIR = x ; then
295
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
298
if test x$LIB_MAN_SUFFIX = x ; then
301
if test x$LIB_MAN_DIR = x ; then
302
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
305
if test x$FILE_MAN_SUFFIX = x ; then
307
solaris*) FILE_MAN_SUFFIX=4 ;;
308
*) FILE_MAN_SUFFIX=5 ;;
311
if test x$FILE_MAN_DIR = x ; then
312
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
315
if test x$MISC_MAN_SUFFIX = x ; then
317
solaris*) MISC_MAN_SUFFIX=5 ;;
318
*) MISC_MAN_SUFFIX=7 ;;
321
if test x$MISC_MAN_DIR = x ; then
322
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
325
if test x$DRIVER_MAN_SUFFIX = x ; then
327
solaris*) DRIVER_MAN_SUFFIX=7 ;;
328
*) DRIVER_MAN_SUFFIX=4 ;;
331
if test x$DRIVER_MAN_DIR = x ; then
332
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
335
if test x$ADMIN_MAN_SUFFIX = x ; then
337
solaris*) ADMIN_MAN_SUFFIX=1m ;;
338
*) ADMIN_MAN_SUFFIX=8 ;;
341
if test x$ADMIN_MAN_DIR = x ; then
342
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
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
360
# XORG_CHECK_SGML_DOCTOOLS
361
# ------------------------
362
# Minimum version: 1.7.0
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])
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])
376
if test "x$XORG_SGML_PATH" != "x" ; then
377
AC_MSG_RESULT([$XORG_SGML_PATH])
382
AC_SUBST(XORG_SGML_PATH)
383
]) # XORG_CHECK_SGML_DOCTOOLS
385
# XORG_CHECK_LINUXDOC
386
# -------------------
387
# Minimum version: 1.0.0
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])
396
AC_PATH_PROG(LINUXDOC, linuxdoc)
397
AC_PATH_PROG(PS2PDF, ps2pdf)
399
AC_MSG_CHECKING([whether to build documentation])
401
if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
407
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
409
AC_MSG_RESULT([$BUILDDOC])
411
AC_MSG_CHECKING([whether to build pdf documentation])
413
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
419
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
421
AC_MSG_RESULT([$BUILDPDFDOC])
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"
426
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
432
]) # XORG_CHECK_LINUXDOC
435
# -------------------
436
# Minimum version: 1.0.0
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])
450
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
451
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
452
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
453
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
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
460
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
461
AC_MSG_RESULT([$BUILDTXTDOC])
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
468
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
469
AC_MSG_RESULT([$BUILDPDFDOC])
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
476
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
477
AC_MSG_RESULT([$BUILDPSDOC])
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
484
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
485
AC_MSG_RESULT([$BUILDHTMLDOC])
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"
496
]) # XORG_CHECK_DOCBOOK
498
# XORG_WITH_XMLTO([MIN-VERSION])
500
# Minimum version: 1.5.0
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.
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
515
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
517
AC_DEFUN([XORG_WITH_XMLTO],[
518
AC_ARG_VAR([XMLTO], [Path to xmlto command])
520
AS_HELP_STRING([--with-xmlto],
521
[Use xmlto to regenerate documentation (default: yes, if installed)]),
522
[use_xmlto=$withval], [use_xmlto=auto])
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])
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])
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])
544
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
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])
557
AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
560
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
563
# XORG_WITH_ASCIIDOC([MIN-VERSION])
565
# Minimum version: 1.5.0
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.
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
580
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
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])
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])
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])
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])
609
AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
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])
622
AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
625
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
626
]) # XORG_WITH_ASCIIDOC
628
# XORG_WITH_DOXYGEN([MIN-VERSION])
629
# --------------------------------
630
# Minimum version: 1.5.0
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.
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
645
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
647
AC_DEFUN([XORG_WITH_DOXYGEN],[
648
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
650
AS_HELP_STRING([--with-doxygen],
651
[Use doxygen to regenerate documentation (default: yes, if installed)]),
652
[use_doxygen=$withval], [use_doxygen=auto])
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])
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])
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])
674
AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
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])
687
AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
690
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
691
]) # XORG_WITH_DOXYGEN
695
# Minimum version: 1.6.0
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.
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
712
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
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.
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.
722
AC_DEFUN([XORG_WITH_GROFF],[
723
AC_ARG_VAR([GROFF], [Path to groff command])
725
AS_HELP_STRING([--with-groff],
726
[Use groff to regenerate documentation (default: yes, if installed)]),
727
[use_groff=$withval], [use_groff=auto])
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])
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])
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])
749
AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
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
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
766
AC_MSG_RESULT([$groff_mm_works])
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])
775
# Minimum version: 1.6.0
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.
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
790
# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
792
AC_DEFUN([XORG_WITH_FOP],[
793
AC_ARG_VAR([FOP], [Path to fop command])
795
AS_HELP_STRING([--with-fop],
796
[Use fop to regenerate documentation (default: yes, if installed)]),
797
[use_fop=$withval], [use_fop=auto])
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])
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])
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])
819
AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
821
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
826
# Minimum version: 1.6.0
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.
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
841
# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
843
AC_DEFUN([XORG_WITH_PS2PDF],[
844
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
846
AS_HELP_STRING([--with-ps2pdf],
847
[Use ps2pdf to regenerate documentation (default: yes, if installed)]),
848
[use_ps2pdf=$withval], [use_ps2pdf=auto])
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])
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])
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])
870
AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
872
AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
873
]) # XORG_WITH_PS2PDF
875
# XORG_ENABLE_DOCS (enable_docs=yes)
877
# Minimum version: 1.6.0
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.
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
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.
898
AC_DEFUN([XORG_ENABLE_DOCS],[
900
if test "x$default" = x ; then
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
912
# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
914
# Minimum version: 1.6.0
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.
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
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.
933
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
935
if test "x$devel_default" = x ; then
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
947
# XORG_ENABLE_SPECS (enable_specs=yes)
949
# Minimum version: 1.6.0
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.
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
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.
968
AC_DEFUN([XORG_ENABLE_SPECS],[
970
if test "x$spec_default" = x ; then
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
982
# XORG_CHECK_MALLOC_ZERO
983
# ----------------------
984
# Minimum version: 1.0.0
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])
996
AC_MSG_CHECKING([whether malloc(0) returns NULL])
997
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1003
char *m0, *r0, *c0, *p;
1008
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1010
[MALLOC_ZERO_RETURNS_NULL=yes],
1011
[MALLOC_ZERO_RETURNS_NULL=no],
1012
[MALLOC_ZERO_RETURNS_NULL=yes])
1014
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
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"
1021
MALLOC_ZERO_CFLAGS=""
1022
XMALLOC_ZERO_CFLAGS=""
1023
XTMALLOC_ZERO_CFLAGS=""
1026
AC_SUBST([MALLOC_ZERO_CFLAGS])
1027
AC_SUBST([XMALLOC_ZERO_CFLAGS])
1028
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1029
]) # XORG_CHECK_MALLOC_ZERO
1033
# Minimum version: 1.1.0
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)
1041
AC_DEFUN([XORG_WITH_LINT],[
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
1052
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1057
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1065
AC_SUBST(LINT_FLAGS)
1066
AM_CONDITIONAL(LINT, [test x$LINT != xno])
1070
# XORG_LINT_LIBRARY(LIBNAME)
1071
# --------------------------
1072
# Minimum version: 1.1.0
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
1078
# @LINTLIB@ - name of lint library file to make
1079
# MAKE_LINT_LIB - automake conditional
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])
1092
if test "x$make_lint_lib" = "xyes" ; then
1095
LINTLIB=$make_lint_lib
1099
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1101
]) # XORG_LINT_LIBRARY
1105
# Minimum version: 1.2.0
1107
# Defines CWARNFLAGS to enable C compiler warnings.
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
1117
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1121
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1122
if test "x$SUNCC" = "xyes"; then
1126
AC_SUBST(CWARNFLAGS)
1127
]) # XORG_CWARNFLAGS
1129
# XORG_STRICT_OPTION
1130
# -----------------------
1131
# Minimum version: 1.3.0
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])
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"
1154
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1155
AC_SUBST([CWARNFLAGS])
1156
]) # XORG_STRICT_OPTION
1158
# XORG_DEFAULT_OPTIONS
1159
# --------------------
1160
# Minimum version: 1.3.0
1162
# Defines default options for X.Org modules.
1164
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1167
XORG_RELEASE_VERSION
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
1177
# Minimum version: 1.4.0
1179
# Defines the variable INSTALL_CMD as the command to copy
1180
# INSTALL from $prefix/share/util-macros.
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])
1191
dnl Copyright 2005 Red Hat, Inc
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
1199
dnl The above copyright notice and this permission notice shall be included
1200
dnl in all copies or substantial portions of the Software.
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.
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.
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.
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])
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
1241
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
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
1248
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1250
[Patch version of this package])
1255
# Minimum version: 1.2.0
1257
# Defines the variable CHANGELOG_CMD as the command to generate
1258
# ChangeLog from git.
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])
22
1269
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
24
1271
# This file is free software; the Free Software Foundation
949
2263
AC_SUBST([am__untar])
950
2264
]) # _AM_PROG_TAR
952
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
954
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
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.
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.
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.
981
# XORG_MACROS_VERSION(required-version)
982
# -------------------------------------
983
# Minimum version: 1.1.0
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)
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])])
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
1009
# XORG_PROG_RAWCPP()
1010
# ------------------
1011
# Minimum version: 1.0.0
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])
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
1028
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
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])
1036
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
1039
rm -f conftest.$ac_ext
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
1046
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1047
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1048
AC_MSG_RESULT([yes])
1050
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
1053
rm -f conftest.$ac_ext
1054
AC_SUBST(RAWCPPFLAGS)
1055
]) # XORG_PROG_RAWCPP
1057
# XORG_MANPAGE_SECTIONS()
1058
# -----------------------
1059
# Minimum version: 1.0.0
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
1066
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1067
AC_REQUIRE([AC_CANONICAL_HOST])
1069
if test x$APP_MAN_SUFFIX = x ; then
1072
if test x$APP_MAN_DIR = x ; then
1073
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1076
if test x$LIB_MAN_SUFFIX = x ; then
1079
if test x$LIB_MAN_DIR = x ; then
1080
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1083
if test x$FILE_MAN_SUFFIX = x ; then
1085
solaris*) FILE_MAN_SUFFIX=4 ;;
1086
*) FILE_MAN_SUFFIX=5 ;;
1089
if test x$FILE_MAN_DIR = x ; then
1090
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1093
if test x$MISC_MAN_SUFFIX = x ; then
1095
solaris*) MISC_MAN_SUFFIX=5 ;;
1096
*) MISC_MAN_SUFFIX=7 ;;
1099
if test x$MISC_MAN_DIR = x ; then
1100
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1103
if test x$DRIVER_MAN_SUFFIX = x ; then
1105
solaris*) DRIVER_MAN_SUFFIX=7 ;;
1106
*) DRIVER_MAN_SUFFIX=4 ;;
1109
if test x$DRIVER_MAN_DIR = x ; then
1110
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1113
if test x$ADMIN_MAN_SUFFIX = x ; then
1115
solaris*) ADMIN_MAN_SUFFIX=1m ;;
1116
*) ADMIN_MAN_SUFFIX=8 ;;
1119
if test x$ADMIN_MAN_DIR = x ; then
1120
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
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
1138
# XORG_CHECK_LINUXDOC
1139
# -------------------
1140
# Minimum version: 1.0.0
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
1152
if test x"$cross_compiling" = x"yes" ; then
1155
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1158
AC_PATH_PROG(LINUXDOC, linuxdoc)
1159
AC_PATH_PROG(PS2PDF, ps2pdf)
1161
AC_MSG_CHECKING([Whether to build documentation])
1163
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1169
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1171
AC_MSG_RESULT([$BUILDDOC])
1173
AC_MSG_CHECKING([Whether to build pdf documentation])
1175
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1181
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1183
AC_MSG_RESULT([$BUILDPDFDOC])
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"
1188
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
1194
]) # XORG_CHECK_LINUXDOC
1196
# XORG_CHECK_DOCBOOK
1197
# -------------------
1198
# Minimum version: 1.0.0
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
1214
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1216
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1217
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1218
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1219
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
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
1226
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1227
AC_MSG_RESULT([$BUILDTXTDOC])
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
1234
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1235
AC_MSG_RESULT([$BUILDPDFDOC])
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
1242
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1243
AC_MSG_RESULT([$BUILDPSDOC])
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
1250
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1251
AC_MSG_RESULT([$BUILDHTMLDOC])
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"
1262
]) # XORG_CHECK_DOCBOOK
1264
# XORG_CHECK_MALLOC_ZERO
1265
# ----------------------
1266
# Minimum version: 1.0.0
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])
1278
AC_MSG_CHECKING([whether malloc(0) returns NULL])
1279
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1285
char *m0, *r0, *c0, *p;
1290
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1292
[MALLOC_ZERO_RETURNS_NULL=yes],
1293
[MALLOC_ZERO_RETURNS_NULL=no])
1295
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
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"
1302
MALLOC_ZERO_CFLAGS=""
1303
XMALLOC_ZERO_CFLAGS=""
1304
XTMALLOC_ZERO_CFLAGS=""
1307
AC_SUBST([MALLOC_ZERO_CFLAGS])
1308
AC_SUBST([XMALLOC_ZERO_CFLAGS])
1309
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1310
]) # XORG_CHECK_MALLOC_ZERO
1314
# Minimum version: 1.1.0
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)
1322
AC_DEFUN([XORG_WITH_LINT],[
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
1333
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1338
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1346
AC_SUBST(LINT_FLAGS)
1347
AM_CONDITIONAL(LINT, [test x$LINT != xno])
1351
# XORG_LINT_LIBRARY(LIBNAME)
1352
# --------------------------
1353
# Minimum version: 1.1.0
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
1359
# @LINTLIB@ - name of lint library file to make
1360
# MAKE_LINT_LIB - automake conditional
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])
1373
if test "x$make_lint_lib" = "xyes" ; then
1376
LINTLIB=$make_lint_lib
1380
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1382
]) # XORG_LINT_LIBRARY
1386
# Minimum version: 1.2.0
1388
# Defines CWARNFLAGS to enable C compiler warnings.
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
1398
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1402
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1403
if test "x$SUNCC" = "xyes"; then
1407
AC_SUBST(CWARNFLAGS)
1408
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1409
]) # XORG_CWARNFLAGS
1411
# XORG_STRICT_OPTION
1412
# -----------------------
1413
# Minimum version: 1.3.0
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])
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"
1436
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1437
AC_SUBST([CWARNFLAGS])
1438
]) # XORG_STRICT_OPTION
1440
# XORG_DEFAULT_OPTIONS
1441
# --------------------
1442
# Minimum version: 1.3.0
1444
# Defines default options for X.Org modules.
1446
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1449
XORG_RELEASE_VERSION
1451
XORG_MANPAGE_SECTIONS
1452
]) # XORG_DEFAULT_OPTIONS
1453
dnl Copyright 2005 Red Hat, Inc
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
1461
dnl The above copyright notice and this permission notice shall be included
1462
dnl in all copies or substantial portions of the Software.
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.
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.
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.
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])
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
1503
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
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
1510
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1512
[Patch version of this package])
1517
# Minimum version: 1.2.0
1519
# Defines the variable CHANGELOG_CMD as the command to generate
1520
# ChangeLog from git.
1522
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
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'])