8125
8143
])# PKG_CHECK_MODULES
8145
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8147
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
8149
dnl Permission is hereby granted, free of charge, to any person obtaining a
8150
dnl copy of this software and associated documentation files (the "Software"),
8151
dnl to deal in the Software without restriction, including without limitation
8152
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8153
dnl and/or sell copies of the Software, and to permit persons to whom the
8154
dnl Software is furnished to do so, subject to the following conditions:
8156
dnl The above copyright notice and this permission notice (including the next
8157
dnl paragraph) shall be included in all copies or substantial portions of the
8160
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8161
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8162
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
8163
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8164
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8165
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8166
dnl DEALINGS IN THE SOFTWARE.
8168
# XORG_MACROS_VERSION(required-version)
8169
# -------------------------------------
8170
# Minimum version: 1.1.0
8172
# If you're using a macro added in Version 1.1 or newer, include this in
8173
# your configure.ac with the minimum required version, such as:
8174
# XORG_MACROS_VERSION(1.1)
8176
# To ensure that this macro is defined, also add:
8177
# m4_ifndef([XORG_MACROS_VERSION],
8178
# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8181
# See the "minimum version" comment for each macro you use to see what
8182
# version you require.
8183
m4_defun([XORG_MACROS_VERSION],[
8184
m4_define([vers_have], [1.5.0])
8185
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8186
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8187
m4_if(m4_cmp(maj_have, maj_needed), 0,,
8188
[m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8189
m4_if(m4_version_compare(vers_have, [$1]), -1,
8190
[m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8191
m4_undefine([vers_have])
8192
m4_undefine([maj_have])
8193
m4_undefine([maj_needed])
8194
]) # XORG_MACROS_VERSION
8196
# XORG_PROG_RAWCPP()
8197
# ------------------
8198
# Minimum version: 1.0.0
8200
# Find cpp program and necessary flags for use in pre-processing text files
8201
# such as man pages and config files
8202
AC_DEFUN([XORG_PROG_RAWCPP],[
8203
AC_REQUIRE([AC_PROG_CPP])
8204
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
8205
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8207
# Check for flag to avoid builtin definitions - assumes unix is predefined,
8208
# which is not the best choice for supporting other OS'es, but covers most
8209
# of the ones we need for now.
8210
AC_MSG_CHECKING([if $RAWCPP requires -undef])
8211
AC_LANG_CONFTEST([Does cpp redefine unix ?])
8212
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8215
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8217
AC_MSG_RESULT([yes])
8218
# under Cygwin unix is still defined even with -undef
8219
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8220
RAWCPPFLAGS="-undef -ansi"
8221
AC_MSG_RESULT([yes, with -ansi])
8223
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
8226
rm -f conftest.$ac_ext
8228
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
8229
AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
8230
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
8233
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
8234
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8235
AC_MSG_RESULT([yes])
8237
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
8240
rm -f conftest.$ac_ext
8241
AC_SUBST(RAWCPPFLAGS)
8242
]) # XORG_PROG_RAWCPP
8244
# XORG_MANPAGE_SECTIONS()
8245
# -----------------------
8246
# Minimum version: 1.0.0
8248
# Determine which sections man pages go in for the different man page types
8249
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8250
# Not sure if there's any better way than just hardcoding by OS name.
8251
# Override default settings by setting environment variables
8253
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
8254
AC_REQUIRE([AC_CANONICAL_HOST])
8256
if test x$APP_MAN_SUFFIX = x ; then
8259
if test x$APP_MAN_DIR = x ; then
8260
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8263
if test x$LIB_MAN_SUFFIX = x ; then
8266
if test x$LIB_MAN_DIR = x ; then
8267
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8270
if test x$FILE_MAN_SUFFIX = x ; then
8272
solaris*) FILE_MAN_SUFFIX=4 ;;
8273
*) FILE_MAN_SUFFIX=5 ;;
8276
if test x$FILE_MAN_DIR = x ; then
8277
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8280
if test x$MISC_MAN_SUFFIX = x ; then
8282
solaris*) MISC_MAN_SUFFIX=5 ;;
8283
*) MISC_MAN_SUFFIX=7 ;;
8286
if test x$MISC_MAN_DIR = x ; then
8287
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8290
if test x$DRIVER_MAN_SUFFIX = x ; then
8292
solaris*) DRIVER_MAN_SUFFIX=7 ;;
8293
*) DRIVER_MAN_SUFFIX=4 ;;
8296
if test x$DRIVER_MAN_DIR = x ; then
8297
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
8300
if test x$ADMIN_MAN_SUFFIX = x ; then
8302
solaris*) ADMIN_MAN_SUFFIX=1m ;;
8303
*) ADMIN_MAN_SUFFIX=8 ;;
8306
if test x$ADMIN_MAN_DIR = x ; then
8307
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8311
AC_SUBST([APP_MAN_SUFFIX])
8312
AC_SUBST([LIB_MAN_SUFFIX])
8313
AC_SUBST([FILE_MAN_SUFFIX])
8314
AC_SUBST([MISC_MAN_SUFFIX])
8315
AC_SUBST([DRIVER_MAN_SUFFIX])
8316
AC_SUBST([ADMIN_MAN_SUFFIX])
8317
AC_SUBST([APP_MAN_DIR])
8318
AC_SUBST([LIB_MAN_DIR])
8319
AC_SUBST([FILE_MAN_DIR])
8320
AC_SUBST([MISC_MAN_DIR])
8321
AC_SUBST([DRIVER_MAN_DIR])
8322
AC_SUBST([ADMIN_MAN_DIR])
8323
]) # XORG_MANPAGE_SECTIONS
8325
# XORG_CHECK_LINUXDOC
8326
# -------------------
8327
# Minimum version: 1.0.0
8329
# Defines the variable MAKE_TEXT if the necessary tools and
8330
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
8331
# Whether or not the necessary tools and files are found can be checked
8332
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
8333
AC_DEFUN([XORG_CHECK_LINUXDOC],[
8334
if test x$XORG_SGML_PATH = x ; then
8335
XORG_SGML_PATH=$prefix/share/sgml
8339
if test x"$cross_compiling" = x"yes" ; then
8342
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
8345
AC_PATH_PROG(LINUXDOC, linuxdoc)
8346
AC_PATH_PROG(PS2PDF, ps2pdf)
8348
AC_MSG_CHECKING([Whether to build documentation])
8350
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
8356
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
8358
AC_MSG_RESULT([$BUILDDOC])
8360
AC_MSG_CHECKING([Whether to build pdf documentation])
8362
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
8368
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8370
AC_MSG_RESULT([$BUILDPDFDOC])
8372
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
8373
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8375
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
8381
]) # XORG_CHECK_LINUXDOC
8383
# XORG_CHECK_DOCBOOK
8384
# -------------------
8385
# Minimum version: 1.0.0
8387
# Checks for the ability to build output formats from SGML DocBook source.
8388
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8389
# indicates whether the necessary tools and files are found and, if set,
8390
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8391
AC_DEFUN([XORG_CHECK_DOCBOOK],[
8392
if test x$XORG_SGML_PATH = x ; then
8393
XORG_SGML_PATH=$prefix/share/sgml
8401
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
8403
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
8404
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8405
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
8406
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
8408
AC_MSG_CHECKING([Whether to build text documentation])
8409
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
8410
test x$BUILD_TXTDOC != xno; then
8413
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8414
AC_MSG_RESULT([$BUILDTXTDOC])
8416
AC_MSG_CHECKING([Whether to build PDF documentation])
8417
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
8418
test x$BUILD_PDFDOC != xno; then
8421
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8422
AC_MSG_RESULT([$BUILDPDFDOC])
8424
AC_MSG_CHECKING([Whether to build PostScript documentation])
8425
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
8426
test x$BUILD_PSDOC != xno; then
8429
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8430
AC_MSG_RESULT([$BUILDPSDOC])
8432
AC_MSG_CHECKING([Whether to build HTML documentation])
8433
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
8434
test x$BUILD_HTMLDOC != xno; then
8437
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8438
AC_MSG_RESULT([$BUILDHTMLDOC])
8440
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8441
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8442
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8443
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
8449
]) # XORG_CHECK_DOCBOOK
8453
# Minimum version: 1.5.0
8455
# Documentation tools are not always available on all platforms and sometimes
8456
# not at the appropriate level. This macro enables a module to test for the
8457
# presence of the tool and obtain it's path in separate variables. Coupled with
8458
# the --with-xmlto option, it allows maximum flexibilty in making decisions
8459
# as whether or not to use the xmlto package.
8461
# Interface to module:
8462
# HAVE_XMLTO: used in makefiles to conditionally generate documentation
8463
# XMLTO: returns the path of the xmlto program found
8464
# returns the path set by the user in the environment
8465
# --with-xmlto: 'yes' user instructs the module to use xmlto
8466
# 'no' user instructs the module not to use xmlto
8468
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
8470
AC_DEFUN([XORG_WITH_XMLTO],[
8471
AC_ARG_VAR([XMLTO], [Path to xmlto command])
8473
AS_HELP_STRING([--with-xmlto],
8474
[Use xmlto to regenerate documentation (default: yes, if installed)]),
8475
[use_xmlto=$withval], [use_xmlto=auto])
8477
if test "x$use_xmlto" = x"auto"; then
8478
AC_PATH_PROG([XMLTO], [xmlto])
8479
if test "x$XMLTO" = "x"; then
8480
AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
8485
elif test "x$use_xmlto" = x"yes" ; then
8486
AC_PATH_PROG([XMLTO], [xmlto])
8487
if test "x$XMLTO" = "x"; then
8488
AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
8491
elif test "x$use_xmlto" = x"no" ; then
8492
if test "x$XMLTO" != "x"; then
8493
AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
8497
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
8499
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
8500
]) # XORG_CHECK_XMLTO
8502
# XORG_WITH_ASCIIDOC
8504
# Minimum version: 1.5.0
8506
# Documentation tools are not always available on all platforms and sometimes
8507
# not at the appropriate level. This macro enables a module to test for the
8508
# presence of the tool and obtain it's path in separate variables. Coupled with
8509
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
8510
# as whether or not to use the asciidoc package.
8512
# Interface to module:
8513
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
8514
# ASCIIDOC: returns the path of the asciidoc program found
8515
# returns the path set by the user in the environment
8516
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
8517
# 'no' user instructs the module not to use asciidoc
8519
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
8521
AC_DEFUN([XORG_WITH_ASCIIDOC],[
8522
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
8523
AC_ARG_WITH(asciidoc,
8524
AS_HELP_STRING([--with-asciidoc],
8525
[Use asciidoc to regenerate documentation (default: yes, if installed)]),
8526
[use_asciidoc=$withval], [use_asciidoc=auto])
8528
if test "x$use_asciidoc" = x"auto"; then
8529
AC_PATH_PROG([ASCIIDOC], [asciidoc])
8530
if test "x$ASCIIDOC" = "x"; then
8531
AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
8536
elif test "x$use_asciidoc" = x"yes" ; then
8537
AC_PATH_PROG([ASCIIDOC], [asciidoc])
8538
if test "x$ASCIIDOC" = "x"; then
8539
AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
8542
elif test "x$use_asciidoc" = x"no" ; then
8543
if test "x$ASCIIDOC" != "x"; then
8544
AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
8548
AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
8550
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
8551
]) # XORG_CHECK_ASCIIDOC
8555
# Minimum version: 1.5.0
8557
# Documentation tools are not always available on all platforms and sometimes
8558
# not at the appropriate level. This macro enables a module to test for the
8559
# presence of the tool and obtain it's path in separate variables. Coupled with
8560
# the --with-doxygen option, it allows maximum flexibilty in making decisions
8561
# as whether or not to use the doxygen package.
8563
# Interface to module:
8564
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
8565
# DOXYGEN: returns the path of the doxygen program found
8566
# returns the path set by the user in the environment
8567
# --with-doxygen: 'yes' user instructs the module to use doxygen
8568
# 'no' user instructs the module not to use doxygen
8570
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
8572
AC_DEFUN([XORG_WITH_DOXYGEN],[
8573
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
8574
AC_ARG_WITH(doxygen,
8575
AS_HELP_STRING([--with-doxygen],
8576
[Use doxygen to regenerate documentation (default: yes, if installed)]),
8577
[use_doxygen=$withval], [use_doxygen=auto])
8579
if test "x$use_doxygen" = x"auto"; then
8580
AC_PATH_PROG([DOXYGEN], [doxygen])
8581
if test "x$DOXYGEN" = "x"; then
8582
AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
8587
elif test "x$use_doxygen" = x"yes" ; then
8588
AC_PATH_PROG([DOXYGEN], [doxygen])
8589
if test "x$DOXYGEN" = "x"; then
8590
AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
8593
elif test "x$use_doxygen" = x"no" ; then
8594
if test "x$DOXYGEN" != "x"; then
8595
AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
8599
AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
8601
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
8602
]) # XORG_CHECK_DOXYGEN
8604
# XORG_CHECK_MALLOC_ZERO
8605
# ----------------------
8606
# Minimum version: 1.0.0
8608
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
8609
# malloc(0) returns NULL. Packages should add one of these cflags to
8610
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
8611
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
8612
AC_ARG_ENABLE(malloc0returnsnull,
8613
AS_HELP_STRING([--enable-malloc0returnsnull],
8614
[malloc(0) returns NULL (default: auto)]),
8615
[MALLOC_ZERO_RETURNS_NULL=$enableval],
8616
[MALLOC_ZERO_RETURNS_NULL=auto])
8618
AC_MSG_CHECKING([whether malloc(0) returns NULL])
8619
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
8625
char *m0, *r0, *c0, *p;
8630
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
8632
[MALLOC_ZERO_RETURNS_NULL=yes],
8633
[MALLOC_ZERO_RETURNS_NULL=no],
8634
[MALLOC_ZERO_RETURNS_NULL=yes])
8636
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
8638
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
8639
MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
8640
XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
8641
XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
8643
MALLOC_ZERO_CFLAGS=""
8644
XMALLOC_ZERO_CFLAGS=""
8645
XTMALLOC_ZERO_CFLAGS=""
8648
AC_SUBST([MALLOC_ZERO_CFLAGS])
8649
AC_SUBST([XMALLOC_ZERO_CFLAGS])
8650
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
8651
]) # XORG_CHECK_MALLOC_ZERO
8655
# Minimum version: 1.1.0
8657
# Sets up flags for source checkers such as lint and sparse if --with-lint
8658
# is specified. (Use --with-lint=sparse for sparse.)
8659
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
8660
# Sets $LINT_FLAGS to flags to pass to source checker
8661
# Sets LINT automake conditional if enabled (default: disabled)
8663
AC_DEFUN([XORG_WITH_LINT],[
8665
# Allow checking code with lint, sparse, etc.
8666
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
8667
[Use a lint-style source code checker (default: disabled)])],
8668
[use_lint=$withval], [use_lint=no])
8669
if test "x$use_lint" = "xyes" ; then
8674
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
8679
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
8687
AC_SUBST(LINT_FLAGS)
8688
AM_CONDITIONAL(LINT, [test x$LINT != xno])
8692
# XORG_LINT_LIBRARY(LIBNAME)
8693
# --------------------------
8694
# Minimum version: 1.1.0
8696
# Sets up flags for building lint libraries for checking programs that call
8697
# functions in the library.
8698
# Disabled by default, enable with --enable-lint-library
8700
# @LINTLIB@ - name of lint library file to make
8701
# MAKE_LINT_LIB - automake conditional
8704
AC_DEFUN([XORG_LINT_LIBRARY],[
8705
AC_REQUIRE([XORG_WITH_LINT])
8706
# Build lint "library" for more indepth checks of programs calling this library
8707
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
8708
[Create lint library (default: disabled)])],
8709
[make_lint_lib=$enableval], [make_lint_lib=no])
8710
if test "x$make_lint_lib" != "xno" ; then
8711
if test "x$LINT" = "xno" ; then
8712
AC_MSG_ERROR([Cannot make lint library without --with-lint])
8714
if test "x$make_lint_lib" = "xyes" ; then
8717
LINTLIB=$make_lint_lib
8721
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
8723
]) # XORG_LINT_LIBRARY
8727
# Minimum version: 1.2.0
8729
# Defines CWARNFLAGS to enable C compiler warnings.
8731
AC_DEFUN([XORG_CWARNFLAGS], [
8732
AC_REQUIRE([AC_PROG_CC])
8733
if test "x$GCC" = xyes ; then
8734
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
8735
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
8736
-Wbad-function-cast"
8737
case `$CC -dumpversion` in
8739
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
8743
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
8744
if test "x$SUNCC" = "xyes"; then
8748
AC_SUBST(CWARNFLAGS)
8749
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8750
]) # XORG_CWARNFLAGS
8752
# XORG_STRICT_OPTION
8753
# -----------------------
8754
# Minimum version: 1.3.0
8756
# Add configure option to enable strict compilation
8757
AC_DEFUN([XORG_STRICT_OPTION], [
8758
AC_REQUIRE([AC_PROG_CC])
8759
AC_REQUIRE([AC_PROG_CC_C99])
8760
AC_REQUIRE([XORG_CWARNFLAGS])
8762
AC_ARG_ENABLE(strict-compilation,
8763
AS_HELP_STRING([--enable-strict-compilation],
8764
[Enable all warnings from compiler and make them errors (default: disabled)]),
8765
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
8766
if test "x$STRICT_COMPILE" = "xyes"; then
8767
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
8768
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
8769
if test "x$GCC" = xyes ; then
8770
STRICT_CFLAGS="-pedantic -Werror"
8771
elif test "x$SUNCC" = "xyes"; then
8772
STRICT_CFLAGS="-errwarn"
8773
elif test "x$INTELCC" = "xyes"; then
8774
STRICT_CFLAGS="-Werror"
8777
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
8778
AC_SUBST([CWARNFLAGS])
8779
]) # XORG_STRICT_OPTION
8781
# XORG_DEFAULT_OPTIONS
8782
# --------------------
8783
# Minimum version: 1.3.0
8785
# Defines default options for X.Org modules.
8787
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
8790
XORG_RELEASE_VERSION
8793
XORG_MANPAGE_SECTIONS
8794
]) # XORG_DEFAULT_OPTIONS
8798
# Minimum version: 1.4.0
8800
# Defines the variable INSTALL_CMD as the command to copy
8801
# INSTALL from $prefix/share/util-macros.
8803
AC_DEFUN([XORG_INSTALL], [
8804
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8805
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
8806
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
8807
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
8808
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
8809
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
8810
AC_SUBST([INSTALL_CMD])
8812
dnl Copyright 2005 Red Hat, Inc
8814
dnl Permission to use, copy, modify, distribute, and sell this software and its
8815
dnl documentation for any purpose is hereby granted without fee, provided that
8816
dnl the above copyright notice appear in all copies and that both that
8817
dnl copyright notice and this permission notice appear in supporting
8820
dnl The above copyright notice and this permission notice shall be included
8821
dnl in all copies or substantial portions of the Software.
8823
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8824
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8825
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8826
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8827
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8828
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8829
dnl OTHER DEALINGS IN THE SOFTWARE.
8831
dnl Except as contained in this notice, the name of the copyright holders shall
8832
dnl not be used in advertising or otherwise to promote the sale, use or
8833
dnl other dealings in this Software without prior written authorization
8834
dnl from the copyright holders.
8837
# XORG_RELEASE_VERSION
8838
# --------------------
8839
# Adds --with/without-release-string and changes the PACKAGE and
8840
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
8841
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
8842
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
8844
AC_DEFUN([XORG_RELEASE_VERSION],[
8845
AC_ARG_WITH(release-version,
8846
AS_HELP_STRING([--with-release-version=STRING],
8847
[Use release version string in package name]),
8848
[RELEASE_VERSION="$withval"],
8849
[RELEASE_VERSION=""])
8850
if test "x$RELEASE_VERSION" != "x"; then
8851
PACKAGE="$PACKAGE-$RELEASE_VERSION"
8852
PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
8853
AC_MSG_NOTICE([Building with package name set to $PACKAGE])
8855
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
8856
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
8857
[Major version of this package])
8858
PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
8859
if test "x$PVM" = "x"; then
8862
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
8864
[Minor version of this package])
8865
PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
8866
if test "x$PVP" = "x"; then
8869
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
8871
[Patch version of this package])
8876
# Minimum version: 1.2.0
8878
# Defines the variable CHANGELOG_CMD as the command to generate
8879
# ChangeLog from git.
8882
AC_DEFUN([XORG_CHANGELOG], [
8883
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
8884
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
8885
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
8886
echo 'git directory not found: installing possibly empty changelog.' >&2)"
8887
AC_SUBST([CHANGELOG_CMD])
8890
dnl Copyright 2005 Red Hat, Inc
8892
dnl Permission to use, copy, modify, distribute, and sell this software and its
8893
dnl documentation for any purpose is hereby granted without fee, provided that
8894
dnl the above copyright notice appear in all copies and that both that
8895
dnl copyright notice and this permission notice appear in supporting
8898
dnl The above copyright notice and this permission notice shall be included
8899
dnl in all copies or substantial portions of the Software.
8901
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8902
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8903
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8904
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8905
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8906
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8907
dnl OTHER DEALINGS IN THE SOFTWARE.
8909
dnl Except as contained in this notice, the name of the copyright holders shall
8910
dnl not be used in advertising or otherwise to promote the sale, use or
8911
dnl other dealings in this Software without prior written authorization
8912
dnl from the copyright holders.
8915
# XORG_DRIVER_CHECK_EXT()
8916
# --------------------------
8917
# Checks for the $1 define in xorg-server.h (from the sdk). If it
8918
# is defined, then add $1 to $REQUIRED_MODULES.
8920
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
8921
SAVE_CFLAGS="$CFLAGS"
8922
CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
8923
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8924
#include "xorg-server.h"
8926
#error $1 not defined
8931
CFLAGS="$SAVE_CFLAGS"
8932
AC_MSG_CHECKING([if $1 is defined])
8933
AC_MSG_RESULT([$_EXT_CHECK])
8934
if test "$_EXT_CHECK" != no; then
8935
REQUIRED_MODULES="$REQUIRED_MODULES $2"
8127
8939
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8129
8941
# This file is free software; the Free Software Foundation
9106
9945
AC_SUBST([am__untar])
9107
9946
]) # _AM_PROG_TAR
9109
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9111
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
9113
dnl Permission is hereby granted, free of charge, to any person obtaining a
9114
dnl copy of this software and associated documentation files (the
9115
dnl "Software"), to deal in the Software without restriction, including
9116
dnl without limitation the rights to use, copy, modify, merge, publish,
9117
dnl distribute, and/or sell copies of the Software, and to permit persons
9118
dnl to whom the Software is furnished to do so, provided that the above
9119
dnl copyright notice(s) and this permission notice appear in all copies of
9120
dnl the Software and that both the above copyright notice(s) and this
9121
dnl permission notice appear in supporting documentation.
9123
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9124
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9125
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9126
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9127
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9128
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9129
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9130
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9131
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9133
dnl Except as contained in this notice, the name of a copyright holder
9134
dnl shall not be used in advertising or otherwise to promote the sale, use
9135
dnl or other dealings in this Software without prior written authorization
9136
dnl of the copyright holder.
9138
# XORG_MACROS_VERSION(required-version)
9139
# -------------------------------------
9140
# Minimum version: 1.1.0
9142
# If you're using a macro added in Version 1.1 or newer, include this in
9143
# your configure.ac with the minimum required version, such as:
9144
# XORG_MACROS_VERSION(1.1)
9146
# To ensure that this macro is defined, also add:
9147
# m4_ifndef([XORG_MACROS_VERSION],
9148
# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9151
# See the "minimum version" comment for each macro you use to see what
9152
# version you require.
9153
m4_defun([XORG_MACROS_VERSION],[
9154
m4_define([vers_have], [1.3.0])
9155
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9156
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9157
m4_if(m4_cmp(maj_have, maj_needed), 0,,
9158
[m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9159
m4_if(m4_version_compare(vers_have, [$1]), -1,
9160
[m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9161
m4_undefine([vers_have])
9162
m4_undefine([maj_have])
9163
m4_undefine([maj_needed])
9164
]) # XORG_MACROS_VERSION
9166
# XORG_PROG_RAWCPP()
9167
# ------------------
9168
# Minimum version: 1.0.0
9170
# Find cpp program and necessary flags for use in pre-processing text files
9171
# such as man pages and config files
9172
AC_DEFUN([XORG_PROG_RAWCPP],[
9173
AC_REQUIRE([AC_PROG_CPP])
9174
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9175
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9177
# Check for flag to avoid builtin definitions - assumes unix is predefined,
9178
# which is not the best choice for supporting other OS'es, but covers most
9179
# of the ones we need for now.
9180
AC_MSG_CHECKING([if $RAWCPP requires -undef])
9181
AC_LANG_CONFTEST([Does cpp redefine unix ?])
9182
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9185
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9187
AC_MSG_RESULT([yes])
9188
# under Cygwin unix is still defined even with -undef
9189
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9190
RAWCPPFLAGS="-undef -ansi"
9191
AC_MSG_RESULT([yes, with -ansi])
9193
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
9196
rm -f conftest.$ac_ext
9198
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9199
AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
9200
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
9203
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
9204
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9205
AC_MSG_RESULT([yes])
9207
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
9210
rm -f conftest.$ac_ext
9211
AC_SUBST(RAWCPPFLAGS)
9212
]) # XORG_PROG_RAWCPP
9214
# XORG_MANPAGE_SECTIONS()
9215
# -----------------------
9216
# Minimum version: 1.0.0
9218
# Determine which sections man pages go in for the different man page types
9219
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9220
# Not sure if there's any better way than just hardcoding by OS name.
9221
# Override default settings by setting environment variables
9223
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9224
AC_REQUIRE([AC_CANONICAL_HOST])
9226
if test x$APP_MAN_SUFFIX = x ; then
9229
if test x$APP_MAN_DIR = x ; then
9230
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9233
if test x$LIB_MAN_SUFFIX = x ; then
9236
if test x$LIB_MAN_DIR = x ; then
9237
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9240
if test x$FILE_MAN_SUFFIX = x ; then
9242
solaris*) FILE_MAN_SUFFIX=4 ;;
9243
*) FILE_MAN_SUFFIX=5 ;;
9246
if test x$FILE_MAN_DIR = x ; then
9247
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9250
if test x$MISC_MAN_SUFFIX = x ; then
9252
solaris*) MISC_MAN_SUFFIX=5 ;;
9253
*) MISC_MAN_SUFFIX=7 ;;
9256
if test x$MISC_MAN_DIR = x ; then
9257
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9260
if test x$DRIVER_MAN_SUFFIX = x ; then
9262
solaris*) DRIVER_MAN_SUFFIX=7 ;;
9263
*) DRIVER_MAN_SUFFIX=4 ;;
9266
if test x$DRIVER_MAN_DIR = x ; then
9267
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9270
if test x$ADMIN_MAN_SUFFIX = x ; then
9272
solaris*) ADMIN_MAN_SUFFIX=1m ;;
9273
*) ADMIN_MAN_SUFFIX=8 ;;
9276
if test x$ADMIN_MAN_DIR = x ; then
9277
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9281
AC_SUBST([APP_MAN_SUFFIX])
9282
AC_SUBST([LIB_MAN_SUFFIX])
9283
AC_SUBST([FILE_MAN_SUFFIX])
9284
AC_SUBST([MISC_MAN_SUFFIX])
9285
AC_SUBST([DRIVER_MAN_SUFFIX])
9286
AC_SUBST([ADMIN_MAN_SUFFIX])
9287
AC_SUBST([APP_MAN_DIR])
9288
AC_SUBST([LIB_MAN_DIR])
9289
AC_SUBST([FILE_MAN_DIR])
9290
AC_SUBST([MISC_MAN_DIR])
9291
AC_SUBST([DRIVER_MAN_DIR])
9292
AC_SUBST([ADMIN_MAN_DIR])
9293
]) # XORG_MANPAGE_SECTIONS
9295
# XORG_CHECK_LINUXDOC
9296
# -------------------
9297
# Minimum version: 1.0.0
9299
# Defines the variable MAKE_TEXT if the necessary tools and
9300
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9301
# Whether or not the necessary tools and files are found can be checked
9302
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9303
AC_DEFUN([XORG_CHECK_LINUXDOC],[
9304
if test x$XORG_SGML_PATH = x ; then
9305
XORG_SGML_PATH=$prefix/share/sgml
9309
if test x"$cross_compiling" = x"yes" ; then
9312
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9315
AC_PATH_PROG(LINUXDOC, linuxdoc)
9316
AC_PATH_PROG(PS2PDF, ps2pdf)
9318
AC_MSG_CHECKING([Whether to build documentation])
9320
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
9326
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9328
AC_MSG_RESULT([$BUILDDOC])
9330
AC_MSG_CHECKING([Whether to build pdf documentation])
9332
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
9338
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9340
AC_MSG_RESULT([$BUILDPDFDOC])
9342
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
9343
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9345
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
9351
]) # XORG_CHECK_LINUXDOC
9353
# XORG_CHECK_DOCBOOK
9354
# -------------------
9355
# Minimum version: 1.0.0
9357
# Checks for the ability to build output formats from SGML DocBook source.
9358
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9359
# indicates whether the necessary tools and files are found and, if set,
9360
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9361
AC_DEFUN([XORG_CHECK_DOCBOOK],[
9362
if test x$XORG_SGML_PATH = x ; then
9363
XORG_SGML_PATH=$prefix/share/sgml
9371
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9373
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
9374
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9375
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
9376
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9378
AC_MSG_CHECKING([Whether to build text documentation])
9379
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
9380
test x$BUILD_TXTDOC != xno; then
9383
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9384
AC_MSG_RESULT([$BUILDTXTDOC])
9386
AC_MSG_CHECKING([Whether to build PDF documentation])
9387
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
9388
test x$BUILD_PDFDOC != xno; then
9391
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9392
AC_MSG_RESULT([$BUILDPDFDOC])
9394
AC_MSG_CHECKING([Whether to build PostScript documentation])
9395
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
9396
test x$BUILD_PSDOC != xno; then
9399
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9400
AC_MSG_RESULT([$BUILDPSDOC])
9402
AC_MSG_CHECKING([Whether to build HTML documentation])
9403
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
9404
test x$BUILD_HTMLDOC != xno; then
9407
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9408
AC_MSG_RESULT([$BUILDHTMLDOC])
9410
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9411
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9412
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9413
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9419
]) # XORG_CHECK_DOCBOOK
9421
# XORG_CHECK_MALLOC_ZERO
9422
# ----------------------
9423
# Minimum version: 1.0.0
9425
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
9426
# malloc(0) returns NULL. Packages should add one of these cflags to
9427
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
9428
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
9429
AC_ARG_ENABLE(malloc0returnsnull,
9430
AS_HELP_STRING([--enable-malloc0returnsnull],
9431
[malloc(0) returns NULL (default: auto)]),
9432
[MALLOC_ZERO_RETURNS_NULL=$enableval],
9433
[MALLOC_ZERO_RETURNS_NULL=auto])
9435
AC_MSG_CHECKING([whether malloc(0) returns NULL])
9436
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
9442
char *m0, *r0, *c0, *p;
9447
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
9449
[MALLOC_ZERO_RETURNS_NULL=yes],
9450
[MALLOC_ZERO_RETURNS_NULL=no])
9452
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9454
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
9455
MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
9456
XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
9457
XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
9459
MALLOC_ZERO_CFLAGS=""
9460
XMALLOC_ZERO_CFLAGS=""
9461
XTMALLOC_ZERO_CFLAGS=""
9464
AC_SUBST([MALLOC_ZERO_CFLAGS])
9465
AC_SUBST([XMALLOC_ZERO_CFLAGS])
9466
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
9467
]) # XORG_CHECK_MALLOC_ZERO
9471
# Minimum version: 1.1.0
9473
# Sets up flags for source checkers such as lint and sparse if --with-lint
9474
# is specified. (Use --with-lint=sparse for sparse.)
9475
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
9476
# Sets $LINT_FLAGS to flags to pass to source checker
9477
# Sets LINT automake conditional if enabled (default: disabled)
9479
AC_DEFUN([XORG_WITH_LINT],[
9481
# Allow checking code with lint, sparse, etc.
9482
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
9483
[Use a lint-style source code checker (default: disabled)])],
9484
[use_lint=$withval], [use_lint=no])
9485
if test "x$use_lint" = "xyes" ; then
9490
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
9495
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
9503
AC_SUBST(LINT_FLAGS)
9504
AM_CONDITIONAL(LINT, [test x$LINT != xno])
9508
# XORG_LINT_LIBRARY(LIBNAME)
9509
# --------------------------
9510
# Minimum version: 1.1.0
9512
# Sets up flags for building lint libraries for checking programs that call
9513
# functions in the library.
9514
# Disabled by default, enable with --enable-lint-library
9516
# @LINTLIB@ - name of lint library file to make
9517
# MAKE_LINT_LIB - automake conditional
9520
AC_DEFUN([XORG_LINT_LIBRARY],[
9521
AC_REQUIRE([XORG_WITH_LINT])
9522
# Build lint "library" for more indepth checks of programs calling this library
9523
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
9524
[Create lint library (default: disabled)])],
9525
[make_lint_lib=$enableval], [make_lint_lib=no])
9526
if test "x$make_lint_lib" != "xno" ; then
9527
if test "x$LINT" = "xno" ; then
9528
AC_MSG_ERROR([Cannot make lint library without --with-lint])
9530
if test "x$make_lint_lib" = "xyes" ; then
9533
LINTLIB=$make_lint_lib
9537
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9539
]) # XORG_LINT_LIBRARY
9543
# Minimum version: 1.2.0
9545
# Defines CWARNFLAGS to enable C compiler warnings.
9547
AC_DEFUN([XORG_CWARNFLAGS], [
9548
AC_REQUIRE([AC_PROG_CC])
9549
if test "x$GCC" = xyes ; then
9550
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
9551
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
9552
-Wbad-function-cast"
9553
case `$CC -dumpversion` in
9555
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
9559
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9560
if test "x$SUNCC" = "xyes"; then
9564
AC_SUBST(CWARNFLAGS)
9565
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9566
]) # XORG_CWARNFLAGS
9568
# XORG_STRICT_OPTION
9569
# -----------------------
9570
# Minimum version: 1.3.0
9572
# Add configure option to enable strict compilation
9573
AC_DEFUN([XORG_STRICT_OPTION], [
9574
AC_REQUIRE([AC_PROG_CC])
9575
AC_REQUIRE([AC_PROG_CC_C99])
9576
AC_REQUIRE([XORG_CWARNFLAGS])
9578
AC_ARG_ENABLE(strict-compilation,
9579
AS_HELP_STRING([--enable-strict-compilation],
9580
[Enable all warnings from compiler and make them errors (default: disabled)]),
9581
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9582
if test "x$STRICT_COMPILE" = "xyes"; then
9583
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9584
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9585
if test "x$GCC" = xyes ; then
9586
STRICT_CFLAGS="-pedantic -Werror"
9587
elif test "x$SUNCC" = "xyes"; then
9588
STRICT_CFLAGS="-errwarn"
9589
elif test "x$INTELCC" = "xyes"; then
9590
STRICT_CFLAGS="-Werror"
9593
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9594
AC_SUBST([CWARNFLAGS])
9595
]) # XORG_STRICT_OPTION
9597
# XORG_DEFAULT_OPTIONS
9598
# --------------------
9599
# Minimum version: 1.3.0
9601
# Defines default options for X.Org modules.
9603
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
9606
XORG_RELEASE_VERSION
9608
XORG_MANPAGE_SECTIONS
9609
]) # XORG_DEFAULT_OPTIONS
9610
dnl Copyright 2005 Red Hat, Inc
9612
dnl Permission to use, copy, modify, distribute, and sell this software and its
9613
dnl documentation for any purpose is hereby granted without fee, provided that
9614
dnl the above copyright notice appear in all copies and that both that
9615
dnl copyright notice and this permission notice appear in supporting
9618
dnl The above copyright notice and this permission notice shall be included
9619
dnl in all copies or substantial portions of the Software.
9621
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9622
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9623
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9624
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9625
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9626
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9627
dnl OTHER DEALINGS IN THE SOFTWARE.
9629
dnl Except as contained in this notice, the name of the copyright holders shall
9630
dnl not be used in advertising or otherwise to promote the sale, use or
9631
dnl other dealings in this Software without prior written authorization
9632
dnl from the copyright holders.
9635
# XORG_RELEASE_VERSION
9636
# --------------------
9637
# Adds --with/without-release-string and changes the PACKAGE and
9638
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
9639
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
9640
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
9642
AC_DEFUN([XORG_RELEASE_VERSION],[
9643
AC_ARG_WITH(release-version,
9644
AS_HELP_STRING([--with-release-version=STRING],
9645
[Use release version string in package name]),
9646
[RELEASE_VERSION="$withval"],
9647
[RELEASE_VERSION=""])
9648
if test "x$RELEASE_VERSION" != "x"; then
9649
PACKAGE="$PACKAGE-$RELEASE_VERSION"
9650
PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
9651
AC_MSG_NOTICE([Building with package name set to $PACKAGE])
9653
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
9654
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
9655
[Major version of this package])
9656
PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
9657
if test "x$PVM" = "x"; then
9660
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
9662
[Minor version of this package])
9663
PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
9664
if test "x$PVP" = "x"; then
9667
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
9669
[Patch version of this package])
9674
# Minimum version: 1.2.0
9676
# Defines the variable CHANGELOG_CMD as the command to generate
9677
# ChangeLog from git.
9679
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
9681
AC_DEFUN([XORG_CHANGELOG], [
9682
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
9683
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
9684
echo 'git directory not found: installing possibly empty changelog.' >&2)"
9685
AC_SUBST([CHANGELOG_CMD])
9686
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
9689
dnl Copyright 2005 Red Hat, Inc
9691
dnl Permission to use, copy, modify, distribute, and sell this software and its
9692
dnl documentation for any purpose is hereby granted without fee, provided that
9693
dnl the above copyright notice appear in all copies and that both that
9694
dnl copyright notice and this permission notice appear in supporting
9697
dnl The above copyright notice and this permission notice shall be included
9698
dnl in all copies or substantial portions of the Software.
9700
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9701
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9702
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9703
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9704
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9705
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9706
dnl OTHER DEALINGS IN THE SOFTWARE.
9708
dnl Except as contained in this notice, the name of the copyright holders shall
9709
dnl not be used in advertising or otherwise to promote the sale, use or
9710
dnl other dealings in this Software without prior written authorization
9711
dnl from the copyright holders.
9714
# XORG_DRIVER_CHECK_EXT()
9715
# --------------------------
9716
# Checks for the $1 define in xorg-server.h (from the sdk). If it
9717
# is defined, then add $1 to $REQUIRED_MODULES.
9719
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
9720
SAVE_CFLAGS="$CFLAGS"
9721
CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
9722
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9723
#include "xorg-server.h"
9725
#error $1 not defined
9730
CFLAGS="$SAVE_CFLAGS"
9731
AC_MSG_CHECKING([if $1 is defined])
9732
AC_MSG_RESULT([$_EXT_CHECK])
9733
if test "$_EXT_CHECK" != no; then
9734
REQUIRED_MODULES="$REQUIRED_MODULES $2"