14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
m4_if(AC_AUTOCONF_VERSION, [2.61],,
17
[m4_warning([this file was generated for autoconf 2.61.
16
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17
[m4_warning([this file was generated for autoconf 2.63.
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
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
22
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
24
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
26
dnl Permission is hereby granted, free of charge, to any person obtaining a
27
dnl copy of this software and associated documentation files (the
28
dnl "Software"), to deal in the Software without restriction, including
29
dnl without limitation the rights to use, copy, modify, merge, publish,
30
dnl distribute, and/or sell copies of the Software, and to permit persons
31
dnl to whom the Software is furnished to do so, provided that the above
32
dnl copyright notice(s) and this permission notice appear in all copies of
33
dnl the Software and that both the above copyright notice(s) and this
34
dnl permission notice appear in supporting documentation.
36
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
37
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
39
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
40
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
41
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
42
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
43
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
44
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
46
dnl Except as contained in this notice, the name of a copyright holder
47
dnl shall not be used in advertising or otherwise to promote the sale, use
48
dnl or other dealings in this Software without prior written authorization
49
dnl of the copyright holder.
51
# XORG_MACROS_VERSION(required-version)
52
# -------------------------------------
53
# Minimum version: 1.1.0
55
# If you're using a macro added in Version 1.1 or newer, include this in
56
# your configure.ac with the minimum required version, such as:
57
# XORG_MACROS_VERSION(1.1)
59
# To force at least a version with this macro defined, also add:
60
# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
63
# See the "minimum version" comment for each macro you use to see what
64
# version you require.
65
AC_DEFUN([XORG_MACROS_VERSION],[
66
[XORG_MACROS_needed_version=$1
67
XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
68
XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
69
AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
70
[XORG_MACROS_version=1.2.1
71
XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
72
XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
73
if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
74
AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
76
if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
77
AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
79
AC_MSG_RESULT([yes, $XORG_MACROS_version])
80
]) # XORG_MACROS_VERSION
84
# Minimum version: 1.0.0
86
# Find cpp program and necessary flags for use in pre-processing text files
87
# such as man pages and config files
88
AC_DEFUN([XORG_PROG_RAWCPP],[
89
AC_REQUIRE([AC_PROG_CPP])
90
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
91
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
93
# Check for flag to avoid builtin definitions - assumes unix is predefined,
94
# which is not the best choice for supporting other OS'es, but covers most
95
# of the ones we need for now.
96
AC_MSG_CHECKING([if $RAWCPP requires -undef])
97
AC_LANG_CONFTEST([Does cpp redefine unix ?])
98
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
101
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
104
# under Cygwin unix is still defined even with -undef
105
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
106
RAWCPPFLAGS="-undef -ansi"
107
AC_MSG_RESULT([yes, with -ansi])
109
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
112
rm -f conftest.$ac_ext
114
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
115
AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
116
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
119
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
120
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
123
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
126
rm -f conftest.$ac_ext
127
AC_SUBST(RAWCPPFLAGS)
128
]) # XORG_PROG_RAWCPP
130
# XORG_MANPAGE_SECTIONS()
131
# -----------------------
132
# Minimum version: 1.0.0
134
# Determine which sections man pages go in for the different man page types
135
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
136
# Not sure if there's any better way than just hardcoding by OS name.
137
# Override default settings by setting environment variables
139
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
140
AC_REQUIRE([AC_CANONICAL_HOST])
142
if test x$APP_MAN_SUFFIX = x ; then
145
if test x$APP_MAN_DIR = x ; then
146
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
149
if test x$LIB_MAN_SUFFIX = x ; then
152
if test x$LIB_MAN_DIR = x ; then
153
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
156
if test x$FILE_MAN_SUFFIX = x ; then
158
solaris*) FILE_MAN_SUFFIX=4 ;;
159
*) FILE_MAN_SUFFIX=5 ;;
162
if test x$FILE_MAN_DIR = x ; then
163
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
166
if test x$MISC_MAN_SUFFIX = x ; then
168
solaris*) MISC_MAN_SUFFIX=5 ;;
169
*) MISC_MAN_SUFFIX=7 ;;
172
if test x$MISC_MAN_DIR = x ; then
173
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
176
if test x$DRIVER_MAN_SUFFIX = x ; then
178
solaris*) DRIVER_MAN_SUFFIX=7 ;;
179
*) DRIVER_MAN_SUFFIX=4 ;;
182
if test x$DRIVER_MAN_DIR = x ; then
183
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
186
if test x$ADMIN_MAN_SUFFIX = x ; then
188
solaris*) ADMIN_MAN_SUFFIX=1m ;;
189
*) ADMIN_MAN_SUFFIX=8 ;;
192
if test x$ADMIN_MAN_DIR = x ; then
193
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
197
AC_SUBST([APP_MAN_SUFFIX])
198
AC_SUBST([LIB_MAN_SUFFIX])
199
AC_SUBST([FILE_MAN_SUFFIX])
200
AC_SUBST([MISC_MAN_SUFFIX])
201
AC_SUBST([DRIVER_MAN_SUFFIX])
202
AC_SUBST([ADMIN_MAN_SUFFIX])
203
AC_SUBST([APP_MAN_DIR])
204
AC_SUBST([LIB_MAN_DIR])
205
AC_SUBST([FILE_MAN_DIR])
206
AC_SUBST([MISC_MAN_DIR])
207
AC_SUBST([DRIVER_MAN_DIR])
208
AC_SUBST([ADMIN_MAN_DIR])
209
]) # XORG_MANPAGE_SECTIONS
211
# XORG_CHECK_LINUXDOC
212
# -------------------
213
# Minimum version: 1.0.0
215
# Defines the variable MAKE_TEXT if the necessary tools and
216
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
217
# Whether or not the necessary tools and files are found can be checked
218
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
219
AC_DEFUN([XORG_CHECK_LINUXDOC],[
220
if test x$XORG_SGML_PATH = x ; then
221
XORG_SGML_PATH=$prefix/share/sgml
225
if test x"$cross_compiling" = x"yes" ; then
228
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
231
AC_PATH_PROG(LINUXDOC, linuxdoc)
232
AC_PATH_PROG(PS2PDF, ps2pdf)
234
AC_MSG_CHECKING([Whether to build documentation])
236
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
242
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
244
AC_MSG_RESULT([$BUILDDOC])
246
AC_MSG_CHECKING([Whether to build pdf documentation])
248
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
254
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
256
AC_MSG_RESULT([$BUILDPDFDOC])
258
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
259
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
261
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
267
]) # XORG_CHECK_LINUXDOC
270
# -------------------
271
# Minimum version: 1.0.0
273
# Checks for the ability to build output formats from SGML DocBook source.
274
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
275
# indicates whether the necessary tools and files are found and, if set,
276
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
277
AC_DEFUN([XORG_CHECK_DOCBOOK],[
278
if test x$XORG_SGML_PATH = x ; then
279
XORG_SGML_PATH=$prefix/share/sgml
287
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
289
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
290
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
291
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
292
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
294
AC_MSG_CHECKING([Whether to build text documentation])
295
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
296
test x$BUILD_TXTDOC != xno; then
299
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
300
AC_MSG_RESULT([$BUILDTXTDOC])
302
AC_MSG_CHECKING([Whether to build PDF documentation])
303
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
304
test x$BUILD_PDFDOC != xno; then
307
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
308
AC_MSG_RESULT([$BUILDPDFDOC])
310
AC_MSG_CHECKING([Whether to build PostScript documentation])
311
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
312
test x$BUILD_PSDOC != xno; then
315
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
316
AC_MSG_RESULT([$BUILDPSDOC])
318
AC_MSG_CHECKING([Whether to build HTML documentation])
319
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
320
test x$BUILD_HTMLDOC != xno; then
323
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
324
AC_MSG_RESULT([$BUILDHTMLDOC])
326
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
327
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
328
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
329
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
335
]) # XORG_CHECK_DOCBOOK
337
# XORG_CHECK_MALLOC_ZERO
338
# ----------------------
339
# Minimum version: 1.0.0
341
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
342
# malloc(0) returns NULL. Packages should add one of these cflags to
343
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
344
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
345
AC_ARG_ENABLE(malloc0returnsnull,
346
AC_HELP_STRING([--enable-malloc0returnsnull],
347
[malloc(0) returns NULL (default: auto)]),
348
[MALLOC_ZERO_RETURNS_NULL=$enableval],
349
[MALLOC_ZERO_RETURNS_NULL=auto])
351
AC_MSG_CHECKING([whether malloc(0) returns NULL])
352
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
358
char *m0, *r0, *c0, *p;
363
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
365
[MALLOC_ZERO_RETURNS_NULL=yes],
366
[MALLOC_ZERO_RETURNS_NULL=no])
368
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
370
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
371
MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
372
XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
373
XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
375
MALLOC_ZERO_CFLAGS=""
376
XMALLOC_ZERO_CFLAGS=""
377
XTMALLOC_ZERO_CFLAGS=""
380
AC_SUBST([MALLOC_ZERO_CFLAGS])
381
AC_SUBST([XMALLOC_ZERO_CFLAGS])
382
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
383
]) # XORG_CHECK_MALLOC_ZERO
387
# Minimum version: 1.1.0
389
# Sets up flags for source checkers such as lint and sparse if --with-lint
390
# is specified. (Use --with-lint=sparse for sparse.)
391
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
392
# Sets $LINT_FLAGS to flags to pass to source checker
393
# Sets LINT automake conditional if enabled (default: disabled)
395
AC_DEFUN([XORG_WITH_LINT],[
397
# Allow checking code with lint, sparse, etc.
398
AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
399
[Use a lint-style source code checker (default: disabled)])],
400
[use_lint=$withval], [use_lint=no])
401
if test "x$use_lint" = "xyes" ; then
406
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
411
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
420
AM_CONDITIONAL(LINT, [test x$LINT != xno])
424
# XORG_LINT_LIBRARY(LIBNAME)
425
# --------------------------
426
# Minimum version: 1.1.0
428
# Sets up flags for building lint libraries for checking programs that call
429
# functions in the library.
430
# Disabled by default, enable with --enable-lint-library
432
# @LINTLIB@ - name of lint library file to make
433
# MAKE_LINT_LIB - automake conditional
436
AC_DEFUN([XORG_LINT_LIBRARY],[
437
AC_REQUIRE([XORG_WITH_LINT])
438
# Build lint "library" for more indepth checks of programs calling this library
439
AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
440
[Create lint library (default: disabled)])],
441
[make_lint_lib=$enableval], [make_lint_lib=no])
442
if test "x$make_lint_lib" != "xno" ; then
443
if test "x$LINT" = "xno" ; then
444
AC_MSG_ERROR([Cannot make lint library without --with-lint])
446
if test "x$make_lint_lib" = "xyes" ; then
449
LINTLIB=$make_lint_lib
453
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
455
]) # XORG_LINT_LIBRARY
459
# Minimum version: 1.2.0
461
# Defines CWARNFLAGS to enable C compiler warnings.
463
AC_DEFUN([XORG_CWARNFLAGS], [
464
AC_REQUIRE([AC_PROG_CC])
465
if test "x$GCC" = xyes ; then
466
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
467
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
469
case `gcc -dumpversion` in
471
CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
475
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
476
if test "x$SUNCC" = "xyes"; then
482
dnl Copyright 2005 Red Hat, Inc
484
dnl Permission to use, copy, modify, distribute, and sell this software and its
485
dnl documentation for any purpose is hereby granted without fee, provided that
486
dnl the above copyright notice appear in all copies and that both that
487
dnl copyright notice and this permission notice appear in supporting
490
dnl The above copyright notice and this permission notice shall be included
491
dnl in all copies or substantial portions of the Software.
493
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
494
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
495
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
496
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
497
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
498
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
499
dnl OTHER DEALINGS IN THE SOFTWARE.
501
dnl Except as contained in this notice, the name of the copyright holders shall
502
dnl not be used in advertising or otherwise to promote the sale, use or
503
dnl other dealings in this Software without prior written authorization
504
dnl from the copyright holders.
507
# XORG_RELEASE_VERSION
508
# --------------------
509
# Adds --with/without-release-string and changes the PACKAGE and
510
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
511
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
512
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
514
AC_DEFUN([XORG_RELEASE_VERSION],[
515
AC_ARG_WITH(release-version,
516
AC_HELP_STRING([--with-release-version=STRING],
517
[Use release version string in package name]),
518
[RELEASE_VERSION="$withval"],
519
[RELEASE_VERSION=""])
520
if test "x$RELEASE_VERSION" != "x"; then
521
PACKAGE="$PACKAGE-$RELEASE_VERSION"
522
PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
523
AC_MSG_NOTICE([Building with package name set to $PACKAGE])
525
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
526
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
527
[Major version of this package])
528
PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
529
if test "x$PVM" = "x"; then
532
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
534
[Minor version of this package])
535
PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
536
if test "x$PVP" = "x"; then
539
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
541
[Patch version of this package])
546
# Minimum version: 1.2.0
548
# Defines the variable CHANGELOG_CMD as the command to generate
549
# ChangeLog from git.
551
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
553
AC_DEFUN([XORG_CHANGELOG], [
554
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
555
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
556
echo 'git directory not found: installing possibly empty changelog.' >&2)"
557
AC_SUBST([CHANGELOG_CMD])
558
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
561
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
24
563
# This file is free software; the Free Software Foundation
25
564
# gives unlimited permission to copy and/or distribute it,