aboutsummaryrefslogtreecommitdiff
path: root/libXfont
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-05 09:59:38 +0100
committermarha <marha@users.sourceforge.net>2012-03-05 09:59:38 +0100
commitffe218bbb0ffa6d2a7f7cbf6b1f81797e667183a (patch)
tree233b818e67de2073647e46e91ac688c6b43d5917 /libXfont
parent15a500d3edb03668b43cc6898fafcda024d0f006 (diff)
downloadvcxsrv-ffe218bbb0ffa6d2a7f7cbf6b1f81797e667183a.tar.gz
vcxsrv-ffe218bbb0ffa6d2a7f7cbf6b1f81797e667183a.tar.bz2
vcxsrv-ffe218bbb0ffa6d2a7f7cbf6b1f81797e667183a.zip
libfontenc xserver pixman mesa git update 5 Mar 2012
font-util-1.3.0 xclock-1.0.6 libXfont-1.4.5 inputproto-2.2
Diffstat (limited to 'libXfont')
-rw-r--r--libXfont/ChangeLog191
-rw-r--r--libXfont/Makefile.in7
-rw-r--r--libXfont/aclocal.m43637
-rw-r--r--libXfont/configure5696
-rw-r--r--libXfont/configure.ac20
-rw-r--r--libXfont/devbook.am46
-rw-r--r--libXfont/doc/Makefile.in53
-rw-r--r--libXfont/doc/fontlib.xml114
-rw-r--r--libXfont/src/FreeType/Makefile.in1
-rw-r--r--libXfont/src/FreeType/ftenc.c30
-rw-r--r--libXfont/src/FreeType/ftfuncs.c278
-rw-r--r--libXfont/src/Makefile.in7
-rw-r--r--libXfont/src/bitmap/Makefile.in1
-rw-r--r--libXfont/src/bitmap/bdfread.c40
-rw-r--r--libXfont/src/bitmap/bdfutils.c21
-rw-r--r--libXfont/src/bitmap/bitscale.c106
-rw-r--r--libXfont/src/bitmap/pcfread.c54
-rw-r--r--libXfont/src/bitmap/pcfwrite.c7
-rw-r--r--libXfont/src/bitmap/snfread.c18
-rw-r--r--libXfont/src/builtins/Makefile.in1
-rw-r--r--libXfont/src/builtins/builtin.h4
-rw-r--r--libXfont/src/fc/Makefile.in1
-rw-r--r--libXfont/src/fc/fsio.c26
-rw-r--r--libXfont/src/fc/fsio.h8
-rw-r--r--libXfont/src/fontfile/Makefile.in1
-rw-r--r--libXfont/src/fontfile/decompress.c61
-rw-r--r--libXfont/src/fontfile/fontdir.c16
-rw-r--r--libXfont/src/stubs/Makefile.in3
-rw-r--r--libXfont/src/util/Makefile.in1
-rw-r--r--libXfont/src/util/atom.c8
-rw-r--r--libXfont/src/util/fontxlfd.c18
31 files changed, 8249 insertions, 2226 deletions
diff --git a/libXfont/ChangeLog b/libXfont/ChangeLog
index 4ff7b3709..5b797d540 100644
--- a/libXfont/ChangeLog
+++ b/libXfont/ChangeLog
@@ -1,3 +1,194 @@
+commit 4b67ad5486c322c01a2ca86b0b4af0a74228f813
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Mar 2 10:05:21 2012 -0800
+
+ libXfont 1.4.5
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 3f87a8b0b86de83ea8944a53de82caf254a9988a
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Oct 21 20:49:50 2011 -0700
+
+ Use * precision notation instead of computing sprintf format strings
+
+ Allows gcc to check format strings instead of just warning about them
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 613faa245437bb948b4c86ea6c7fbb716e38f0bf
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Oct 2 09:30:09 2011 -0700
+
+ Fix printf warnings about incorrect argument types
+
+ Mostly due to difference between sizeof & int on 64-bit platforms
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit f24c559bcb42e3ea9321c3e6a9ecf0720a581e33
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Oct 2 09:19:47 2011 -0700
+
+ Add _X_ATTRIBUTE_PRINTF to *Error/*Warning functions taking printf formats
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 3715cd752bac912a56aa1cbb9dd874624a709aab
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Oct 2 09:16:05 2011 -0700
+
+ Add const attributes to fix gcc -Wwrite-strings warnings
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 8d130ac0fcf19e0e0dd0a404d9317fd8860baad4
+Author: Tomas Hoger <thoger@redhat.com>
+Date: Mon Oct 10 14:38:06 2011 -0700
+
+ Support compress files with maxbits < 12
+
+ The compress decompression code used by libXfont rejects valid archives
+ with maxbits less than 12 (compress allows values 9 - 16, 16 is the
+ default). This is because maxbits-12 is used as index to hsize_table[].
+
+ That looks like an incorrect port of the original compress code, where:
+ - hsize depended on BITS, the maximum maxbits value supported by particular
+ build, rather than on maxbits value from the particular input file
+ - the same hsize was used for all BITS <= 12
+
+ The quick way to verify the problem is:
+ compress -b 11 fontfile.bdf
+ bdftopcf -o /dev/null fontfile.bdf.Z
+ which fails, while 12-16 works correctly.
+
+ This fix removes hsize_table and uses 1 << maxbits (aka maxmaxcode) as
+ tab_prefix size. As decompression code does not use hashing as compression
+ code, there does not seem to be a reason to allocate any extra space.
+
+ Note: In this fix, maxbits == 9 is still rejected early. AFAICS compress
+ is able to generate such files (unknown how correct such output is), but is
+ unable to uncompress them correctly.
+
+ Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit bb97dbf56dff50bef936c0631587ed08dd6c8fa9
+Author: Matt Dew <marcoz@osource.org>
+Date: Mon Oct 3 20:23:47 2011 -0600
+
+ 1 - fix the capitalization of the ID attriutes to match either the
+ <title> or <funcdef> string it goes with.
+ 2 - fix any <linkend>'s that were affected by 1.
+ 3 - any <function> in the docs that has an actual funcdef,
+ will become an olink.
+
+ Signed-off-by: Matt Dew <marcoz@osource.org>
+
+commit c73a0e09a2713d0dc16ca5cd9d288b8868846a19
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Sep 22 14:00:36 2011 -0400
+
+ doc: fix typo in copyright statement
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit d86d8f34f5c2ac5c80230aea2de49bb97eaf5f92
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Sep 22 09:20:38 2011 -0400
+
+ doc: refactor legal text for multi licensing copyrights
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 43d587d89bee679850bb18ff25aa77c961712728
+Author: Olli Vertanen <olli.vertanen@symbio.com>
+Date: Tue Sep 6 19:00:55 2011 +0000
+
+ libxfont: An uninitialized pointer causes a crash if pcf header is corrupted.
+
+ If pcfReadTOC() or pcfGetProperties() fail in the beginning
+ of execution of pcfReadFont(), function tries to free an
+ uninitialized pointer (isStringProp) when bailing out.
+
+ The pointer gets now initialized correctly.
+
+ Signed-off-by: Olli Vertanen <olli.vertanen@symbio.com>
+ Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
+
+commit 73e6c94a351c891ed85446df84c9a30a4224f478
+Author: Joerg Sonnenberger <joerg@britannica.bec.de>
+Date: Sun Aug 21 19:07:51 2011 +0200
+
+ Fix empty statement in if conditional.
+
+ Assume for a moment that the intention here is to do
+ something useful.
+
+ Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
+
+commit bd48ad11fd11412c62c3ac8ed5d52c4f10a985aa
+Author: Joerg Sonnenberger <joerg@britannica.bec.de>
+Date: Sun Aug 21 18:51:53 2011 +0200
+
+ Do proper input validation to fix for CVE-2011-2895.
+
+ It ensures that all valid input can be decompressed, checks that the
+ overflow conditions doesn't happen and generally tightens the
+ validation of the LZW stream and doesn't pessimize the inner loop for
+ no good reason. It's derived from a change in libarchive from 2004.
+
+ Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
+ Reviewed-by: Tomas Hoger <thoger@redhat.com>
+
+commit 098ab294deed98371ee362fadafcf2e510e0cc50
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Sep 16 22:21:21 2011 -0700
+
+ Strip trailing whitespace
+
+ Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
+ git diff -w & git diff -b show no diffs from this change
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 211368b8d04ed13ba520de2dd49a875cb1d663a7
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Sep 12 11:09:50 2011 -0400
+
+ docs: use the &fullrelvers; entity to set X11 release information
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 425ee265c61b3815a0ef1e4e0445dc91921d71ee
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Sep 9 13:08:04 2011 -0400
+
+ devbook.am: maintenance update from docbook.am
+
+ The developer docs are generated from a subset of docbook.am
+ which is sometimes updated.
+
+ The one difference is the embedded css style in the HEAD element.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 1c7cfd7a2b89329f27951c0437f925dd3301e3de
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Wed Aug 10 22:19:44 2011 -0700
+
+ Remove configure comment about synchronizing version numbers
+
+ This appears to have been a mistaken copy-and-paste from something like
+ libXcursor - I can't find any Xfont.h header, nor any libXfont header
+ containing a version number.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+ Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
+
commit a7970f5c817b5c75d945389cfaf1384ff23437f3
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date: Mon Aug 8 18:08:05 2011 +0200
diff --git a/libXfont/Makefile.in b/libXfont/Makefile.in
index 60cdba3bd..806da6184 100644
--- a/libXfont/Makefile.in
+++ b/libXfont/Makefile.in
@@ -15,9 +15,9 @@
@SET_MAKE@
-#
+#
# Copyright © 2003 Keith Packard, Noah Levitt
-#
+#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
@@ -27,7 +27,7 @@
# specific, written prior permission. Keith Packard makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
-#
+#
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -171,6 +171,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/aclocal.m4 b/libXfont/aclocal.m4
index 47a436886..f682579b3 100644
--- a/libXfont/aclocal.m4
+++ b/libXfont/aclocal.m4
@@ -1016,1693 +1016,6 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
-dnl
-dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
-dnl
-dnl Permission is hereby granted, free of charge, to any person obtaining a
-dnl copy of this software and associated documentation files (the "Software"),
-dnl to deal in the Software without restriction, including without limitation
-dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
-dnl and/or sell copies of the Software, and to permit persons to whom the
-dnl Software is furnished to do so, subject to the following conditions:
-dnl
-dnl The above copyright notice and this permission notice (including the next
-dnl paragraph) shall be included in all copies or substantial portions of the
-dnl Software.
-dnl
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-dnl DEALINGS IN THE SOFTWARE.
-
-# XORG_MACROS_VERSION(required-version)
-# -------------------------------------
-# Minimum version: 1.1.0
-#
-# If you're using a macro added in Version 1.1 or newer, include this in
-# your configure.ac with the minimum required version, such as:
-# XORG_MACROS_VERSION(1.1)
-#
-# To ensure that this macro is defined, also add:
-# m4_ifndef([XORG_MACROS_VERSION],
-# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
-#
-#
-# See the "minimum version" comment for each macro you use to see what
-# version you require.
-m4_defun([XORG_MACROS_VERSION],[
-m4_define([vers_have], [1.15.0])
-m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
-m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
-m4_if(m4_cmp(maj_have, maj_needed), 0,,
- [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
-m4_if(m4_version_compare(vers_have, [$1]), -1,
- [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
-m4_undefine([vers_have])
-m4_undefine([maj_have])
-m4_undefine([maj_needed])
-]) # XORG_MACROS_VERSION
-
-# XORG_PROG_RAWCPP()
-# ------------------
-# Minimum version: 1.0.0
-#
-# Find cpp program and necessary flags for use in pre-processing text files
-# such as man pages and config files
-AC_DEFUN([XORG_PROG_RAWCPP],[
-AC_REQUIRE([AC_PROG_CPP])
-AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
- [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
-
-# Check for flag to avoid builtin definitions - assumes unix is predefined,
-# which is not the best choice for supporting other OS'es, but covers most
-# of the ones we need for now.
-AC_MSG_CHECKING([if $RAWCPP requires -undef])
-AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
-if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
- AC_MSG_RESULT([no])
-else
- if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
- RAWCPPFLAGS=-undef
- AC_MSG_RESULT([yes])
- # under Cygwin unix is still defined even with -undef
- elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
- RAWCPPFLAGS="-undef -ansi"
- AC_MSG_RESULT([yes, with -ansi])
- else
- AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
- fi
-fi
-rm -f conftest.$ac_ext
-
-AC_MSG_CHECKING([if $RAWCPP requires -traditional])
-AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
-if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
- AC_MSG_RESULT([no])
-else
- if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
- RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
- fi
-fi
-rm -f conftest.$ac_ext
-AC_SUBST(RAWCPPFLAGS)
-]) # XORG_PROG_RAWCPP
-
-# XORG_MANPAGE_SECTIONS()
-# -----------------------
-# Minimum version: 1.0.0
-#
-# Determine which sections man pages go in for the different man page types
-# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
-# Not sure if there's any better way than just hardcoding by OS name.
-# Override default settings by setting environment variables
-# Added MAN_SUBSTS in version 1.8
-# Added AC_PROG_SED in version 1.8
-
-AC_DEFUN([XORG_MANPAGE_SECTIONS],[
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_SED])
-
-if test x$APP_MAN_SUFFIX = x ; then
- APP_MAN_SUFFIX=1
-fi
-if test x$APP_MAN_DIR = x ; then
- APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
-fi
-
-if test x$LIB_MAN_SUFFIX = x ; then
- LIB_MAN_SUFFIX=3
-fi
-if test x$LIB_MAN_DIR = x ; then
- LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
-fi
-
-if test x$FILE_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) FILE_MAN_SUFFIX=4 ;;
- *) FILE_MAN_SUFFIX=5 ;;
- esac
-fi
-if test x$FILE_MAN_DIR = x ; then
- FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
-fi
-
-if test x$MISC_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) MISC_MAN_SUFFIX=5 ;;
- *) MISC_MAN_SUFFIX=7 ;;
- esac
-fi
-if test x$MISC_MAN_DIR = x ; then
- MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
-fi
-
-if test x$DRIVER_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) DRIVER_MAN_SUFFIX=7 ;;
- *) DRIVER_MAN_SUFFIX=4 ;;
- esac
-fi
-if test x$DRIVER_MAN_DIR = x ; then
- DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
-fi
-
-if test x$ADMIN_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) ADMIN_MAN_SUFFIX=1m ;;
- *) ADMIN_MAN_SUFFIX=8 ;;
- esac
-fi
-if test x$ADMIN_MAN_DIR = x ; then
- ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
-fi
-
-
-AC_SUBST([APP_MAN_SUFFIX])
-AC_SUBST([LIB_MAN_SUFFIX])
-AC_SUBST([FILE_MAN_SUFFIX])
-AC_SUBST([MISC_MAN_SUFFIX])
-AC_SUBST([DRIVER_MAN_SUFFIX])
-AC_SUBST([ADMIN_MAN_SUFFIX])
-AC_SUBST([APP_MAN_DIR])
-AC_SUBST([LIB_MAN_DIR])
-AC_SUBST([FILE_MAN_DIR])
-AC_SUBST([MISC_MAN_DIR])
-AC_SUBST([DRIVER_MAN_DIR])
-AC_SUBST([ADMIN_MAN_DIR])
-
-XORG_MAN_PAGE="X Version 11"
-AC_SUBST([XORG_MAN_PAGE])
-MAN_SUBSTS="\
- -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
- -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
- -e 's|__xservername__|Xorg|g' \
- -e 's|__xconfigfile__|xorg.conf|g' \
- -e 's|__projectroot__|\$(prefix)|g' \
- -e 's|__apploaddir__|\$(appdefaultdir)|g' \
- -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
- -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
- -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
- -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
- -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
- -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
-AC_SUBST([MAN_SUBSTS])
-
-]) # XORG_MANPAGE_SECTIONS
-
-# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
-# ------------------------
-# Minimum version: 1.7.0
-#
-# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
-# provided by xorg-sgml-doctools, if installed.
-AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
-AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
-XORG_SGML_PATH=
-PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
- [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
- [m4_ifval([$1],[:],
- [if test x"$cross_compiling" != x"yes" ; then
- AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
- [XORG_SGML_PATH=$prefix/share/sgml])
- fi])
- ])
-
-# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
-# the path and the name of the doc stylesheet
-if test "x$XORG_SGML_PATH" != "x" ; then
- AC_MSG_RESULT([$XORG_SGML_PATH])
- STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
- XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
-else
- AC_MSG_RESULT([no])
-fi
-
-AC_SUBST(XORG_SGML_PATH)
-AC_SUBST(STYLESHEET_SRCDIR)
-AC_SUBST(XSL_STYLESHEET)
-AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
-]) # XORG_CHECK_SGML_DOCTOOLS
-
-# XORG_CHECK_LINUXDOC
-# -------------------
-# Minimum version: 1.0.0
-#
-# Defines the variable MAKE_TEXT if the necessary tools and
-# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
-# Whether or not the necessary tools and files are found can be checked
-# with the AM_CONDITIONAL "BUILD_LINUXDOC"
-AC_DEFUN([XORG_CHECK_LINUXDOC],[
-AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
-AC_REQUIRE([XORG_WITH_PS2PDF])
-
-AC_PATH_PROG(LINUXDOC, linuxdoc)
-
-AC_MSG_CHECKING([whether to build documentation])
-
-if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
- BUILDDOC=yes
-else
- BUILDDOC=no
-fi
-
-AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
-
-AC_MSG_RESULT([$BUILDDOC])
-
-AC_MSG_CHECKING([whether to build pdf documentation])
-
-if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
- BUILDPDFDOC=yes
-else
- BUILDPDFDOC=no
-fi
-
-AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
-
-AC_MSG_RESULT([$BUILDPDFDOC])
-
-MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
-MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
-MAKE_PDF="$PS2PDF"
-MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
-
-AC_SUBST(MAKE_TEXT)
-AC_SUBST(MAKE_PS)
-AC_SUBST(MAKE_PDF)
-AC_SUBST(MAKE_HTML)
-]) # XORG_CHECK_LINUXDOC
-
-# XORG_CHECK_DOCBOOK
-# -------------------
-# Minimum version: 1.0.0
-#
-# Checks for the ability to build output formats from SGML DocBook source.
-# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
-# indicates whether the necessary tools and files are found and, if set,
-# $(MAKE_XXX) blah.sgml will produce blah.xxx.
-AC_DEFUN([XORG_CHECK_DOCBOOK],[
-AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
-
-BUILDTXTDOC=no
-BUILDPDFDOC=no
-BUILDPSDOC=no
-BUILDHTMLDOC=no
-
-AC_PATH_PROG(DOCBOOKPS, docbook2ps)
-AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
-AC_PATH_PROG(DOCBOOKHTML, docbook2html)
-AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
-
-AC_MSG_CHECKING([whether to build text documentation])
-if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
- test x$BUILD_TXTDOC != xno; then
- BUILDTXTDOC=yes
-fi
-AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
-AC_MSG_RESULT([$BUILDTXTDOC])
-
-AC_MSG_CHECKING([whether to build PDF documentation])
-if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
- test x$BUILD_PDFDOC != xno; then
- BUILDPDFDOC=yes
-fi
-AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
-AC_MSG_RESULT([$BUILDPDFDOC])
-
-AC_MSG_CHECKING([whether to build PostScript documentation])
-if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
- test x$BUILD_PSDOC != xno; then
- BUILDPSDOC=yes
-fi
-AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
-AC_MSG_RESULT([$BUILDPSDOC])
-
-AC_MSG_CHECKING([whether to build HTML documentation])
-if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
- test x$BUILD_HTMLDOC != xno; then
- BUILDHTMLDOC=yes
-fi
-AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
-AC_MSG_RESULT([$BUILDHTMLDOC])
-
-MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
-MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
-MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
-MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
-
-AC_SUBST(MAKE_TEXT)
-AC_SUBST(MAKE_PS)
-AC_SUBST(MAKE_PDF)
-AC_SUBST(MAKE_HTML)
-]) # XORG_CHECK_DOCBOOK
-
-# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
-# ----------------
-# Minimum version: 1.5.0
-# Minimum version for optional DEFAULT argument: 1.11.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a module to test for the
-# presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-xmlto option, it allows maximum flexibilty in making decisions
-# as whether or not to use the xmlto package. When DEFAULT is not specified,
-# --with-xmlto assumes 'auto'.
-#
-# Interface to module:
-# HAVE_XMLTO: used in makefiles to conditionally generate documentation
-# XMLTO: returns the path of the xmlto program found
-# returns the path set by the user in the environment
-# --with-xmlto: 'yes' user instructs the module to use xmlto
-# 'no' user instructs the module not to use xmlto
-#
-# Added in version 1.10.0
-# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
-# xmlto for text output requires either lynx, links, or w3m browsers
-#
-# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_XMLTO],[
-AC_ARG_VAR([XMLTO], [Path to xmlto command])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(xmlto,
- AS_HELP_STRING([--with-xmlto],
- [Use xmlto to regenerate documentation (default: ]_defopt[)]),
- [use_xmlto=$withval], [use_xmlto=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_xmlto" = x"auto"; then
- AC_PATH_PROG([XMLTO], [xmlto])
- if test "x$XMLTO" = "x"; then
- AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
- have_xmlto=no
- else
- have_xmlto=yes
- fi
-elif test "x$use_xmlto" = x"yes" ; then
- AC_PATH_PROG([XMLTO], [xmlto])
- if test "x$XMLTO" = "x"; then
- AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
- fi
- have_xmlto=yes
-elif test "x$use_xmlto" = x"no" ; then
- if test "x$XMLTO" != "x"; then
- AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
- fi
- have_xmlto=no
-else
- AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
-fi
-
-# Test for a minimum version of xmlto, if provided.
-m4_ifval([$1],
-[if test "$have_xmlto" = yes; then
- # scrape the xmlto version
- AC_MSG_CHECKING([the xmlto version])
- xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
- AC_MSG_RESULT([$xmlto_version])
- AS_VERSION_COMPARE([$xmlto_version], [$1],
- [if test "x$use_xmlto" = xauto; then
- AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
- have_xmlto=no
- else
- AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
- fi])
-fi])
-
-# Test for the ability of xmlto to generate a text target
-have_xmlto_text=no
-cat > conftest.xml << "EOF"
-EOF
-AS_IF([test "$have_xmlto" = yes],
- [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
- [have_xmlto_text=yes],
- [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
-rm -f conftest.xml
-AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
-AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
-]) # XORG_WITH_XMLTO
-
-# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
-# --------------------------------------------
-# Minimum version: 1.12.0
-# Minimum version for optional DEFAULT argument: 1.12.0
-#
-# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
-# XML-based language used for the transformation of XML documents.
-# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
-# It is used under the cover by xmlto to generate html files from DocBook/XML.
-# The XSLT processor is often used as a standalone tool for transformations.
-# It should not be assumed that this tool is used only to work with documnetation.
-# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
-#
-# Interface to module:
-# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
-# XSLTPROC: returns the path of the xsltproc program found
-# returns the path set by the user in the environment
-# --with-xsltproc: 'yes' user instructs the module to use xsltproc
-# 'no' user instructs the module not to use xsltproc
-# have_xsltproc: returns yes if xsltproc found in PATH or no
-#
-# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_XSLTPROC],[
-AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
-# Preserves the interface, should it be implemented later
-m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(xsltproc,
- AS_HELP_STRING([--with-xsltproc],
- [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
- [use_xsltproc=$withval], [use_xsltproc=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_xsltproc" = x"auto"; then
- AC_PATH_PROG([XSLTPROC], [xsltproc])
- if test "x$XSLTPROC" = "x"; then
- AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
- have_xsltproc=no
- else
- have_xsltproc=yes
- fi
-elif test "x$use_xsltproc" = x"yes" ; then
- AC_PATH_PROG([XSLTPROC], [xsltproc])
- if test "x$XSLTPROC" = "x"; then
- AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
- fi
- have_xsltproc=yes
-elif test "x$use_xsltproc" = x"no" ; then
- if test "x$XSLTPROC" != "x"; then
- AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
- fi
- have_xsltproc=no
-else
- AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
-fi
-
-AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
-]) # XORG_WITH_XSLTPROC
-
-# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
-# ----------------------------------------
-# Minimum version: 1.15.0
-#
-# PERL (Practical Extraction and Report Language) is a language optimized for
-# scanning arbitrary text files, extracting information from those text files,
-# and printing reports based on that information.
-#
-# When DEFAULT is not specified, --with-perl assumes 'auto'.
-#
-# Interface to module:
-# HAVE_PERL: used in makefiles to conditionally scan text files
-# PERL: returns the path of the perl program found
-# returns the path set by the user in the environment
-# --with-perl: 'yes' user instructs the module to use perl
-# 'no' user instructs the module not to use perl
-# have_perl: returns yes if perl found in PATH or no
-#
-# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_PERL],[
-AC_ARG_VAR([PERL], [Path to perl command])
-# Preserves the interface, should it be implemented later
-m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(perl,
- AS_HELP_STRING([--with-perl],
- [Use perl for extracting information from files (default: ]_defopt[)]),
- [use_perl=$withval], [use_perl=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_perl" = x"auto"; then
- AC_PATH_PROG([PERL], [perl])
- if test "x$PERL" = "x"; then
- AC_MSG_WARN([perl not found - cannot extract information and report])
- have_perl=no
- else
- have_perl=yes
- fi
-elif test "x$use_perl" = x"yes" ; then
- AC_PATH_PROG([PERL], [perl])
- if test "x$PERL" = "x"; then
- AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
- fi
- have_perl=yes
-elif test "x$use_perl" = x"no" ; then
- if test "x$PERL" != "x"; then
- AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
- fi
- have_perl=no
-else
- AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
-fi
-
-AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
-]) # XORG_WITH_PERL
-
-# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
-# ----------------
-# Minimum version: 1.5.0
-# Minimum version for optional DEFAULT argument: 1.11.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a module to test for the
-# presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-asciidoc option, it allows maximum flexibilty in making decisions
-# as whether or not to use the asciidoc package. When DEFAULT is not specified,
-# --with-asciidoc assumes 'auto'.
-#
-# Interface to module:
-# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
-# ASCIIDOC: returns the path of the asciidoc program found
-# returns the path set by the user in the environment
-# --with-asciidoc: 'yes' user instructs the module to use asciidoc
-# 'no' user instructs the module not to use asciidoc
-#
-# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_ASCIIDOC],[
-AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(asciidoc,
- AS_HELP_STRING([--with-asciidoc],
- [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
- [use_asciidoc=$withval], [use_asciidoc=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_asciidoc" = x"auto"; then
- AC_PATH_PROG([ASCIIDOC], [asciidoc])
- if test "x$ASCIIDOC" = "x"; then
- AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
- have_asciidoc=no
- else
- have_asciidoc=yes
- fi
-elif test "x$use_asciidoc" = x"yes" ; then
- AC_PATH_PROG([ASCIIDOC], [asciidoc])
- if test "x$ASCIIDOC" = "x"; then
- AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
- fi
- have_asciidoc=yes
-elif test "x$use_asciidoc" = x"no" ; then
- if test "x$ASCIIDOC" != "x"; then
- AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
- fi
- have_asciidoc=no
-else
- AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
-fi
-m4_ifval([$1],
-[if test "$have_asciidoc" = yes; then
- # scrape the asciidoc version
- AC_MSG_CHECKING([the asciidoc version])
- asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
- AC_MSG_RESULT([$asciidoc_version])
- AS_VERSION_COMPARE([$asciidoc_version], [$1],
- [if test "x$use_asciidoc" = xauto; then
- AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
- have_asciidoc=no
- else
- AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
- fi])
-fi])
-AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
-]) # XORG_WITH_ASCIIDOC
-
-# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
-# --------------------------------
-# Minimum version: 1.5.0
-# Minimum version for optional DEFAULT argument: 1.11.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a module to test for the
-# presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-doxygen option, it allows maximum flexibilty in making decisions
-# as whether or not to use the doxygen package. When DEFAULT is not specified,
-# --with-doxygen assumes 'auto'.
-#
-# Interface to module:
-# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
-# DOXYGEN: returns the path of the doxygen program found
-# returns the path set by the user in the environment
-# --with-doxygen: 'yes' user instructs the module to use doxygen
-# 'no' user instructs the module not to use doxygen
-#
-# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_DOXYGEN],[
-AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(doxygen,
- AS_HELP_STRING([--with-doxygen],
- [Use doxygen to regenerate documentation (default: ]_defopt[)]),
- [use_doxygen=$withval], [use_doxygen=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_doxygen" = x"auto"; then
- AC_PATH_PROG([DOXYGEN], [doxygen])
- if test "x$DOXYGEN" = "x"; then
- AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
- have_doxygen=no
- else
- have_doxygen=yes
- fi
-elif test "x$use_doxygen" = x"yes" ; then
- AC_PATH_PROG([DOXYGEN], [doxygen])
- if test "x$DOXYGEN" = "x"; then
- AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
- fi
- have_doxygen=yes
-elif test "x$use_doxygen" = x"no" ; then
- if test "x$DOXYGEN" != "x"; then
- AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
- fi
- have_doxygen=no
-else
- AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
-fi
-m4_ifval([$1],
-[if test "$have_doxygen" = yes; then
- # scrape the doxygen version
- AC_MSG_CHECKING([the doxygen version])
- doxygen_version=`$DOXYGEN --version 2>/dev/null`
- AC_MSG_RESULT([$doxygen_version])
- AS_VERSION_COMPARE([$doxygen_version], [$1],
- [if test "x$use_doxygen" = xauto; then
- AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
- have_doxygen=no
- else
- AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
- fi])
-fi])
-AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
-]) # XORG_WITH_DOXYGEN
-
-# XORG_WITH_GROFF([DEFAULT])
-# ----------------
-# Minimum version: 1.6.0
-# Minimum version for optional DEFAULT argument: 1.11.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a module to test for the
-# presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-groff option, it allows maximum flexibilty in making decisions
-# as whether or not to use the groff package. When DEFAULT is not specified,
-# --with-groff assumes 'auto'.
-#
-# Interface to module:
-# HAVE_GROFF: used in makefiles to conditionally generate documentation
-# HAVE_GROFF_MM: the memorandum macros (-mm) package
-# HAVE_GROFF_MS: the -ms macros package
-# GROFF: returns the path of the groff program found
-# returns the path set by the user in the environment
-# --with-groff: 'yes' user instructs the module to use groff
-# 'no' user instructs the module not to use groff
-#
-# Added in version 1.9.0:
-# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
-# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
-# psselect from the psutils package.
-# the ghostcript package. Refer to the grohtml man pages
-#
-# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
-#
-# OS and distros often splits groff in a basic and full package, the former
-# having the groff program and the later having devices, fonts and macros
-# Checking for the groff executable is not enough.
-#
-# If macros are missing, we cannot assume that groff is useless, so we don't
-# unset HAVE_GROFF or GROFF env variables.
-# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
-#
-AC_DEFUN([XORG_WITH_GROFF],[
-AC_ARG_VAR([GROFF], [Path to groff command])
-m4_define([_defopt], m4_default([$1], [auto]))
-AC_ARG_WITH(groff,
- AS_HELP_STRING([--with-groff],
- [Use groff to regenerate documentation (default: ]_defopt[)]),
- [use_groff=$withval], [use_groff=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_groff" = x"auto"; then
- AC_PATH_PROG([GROFF], [groff])
- if test "x$GROFF" = "x"; then
- AC_MSG_WARN([groff not found - documentation targets will be skipped])
- have_groff=no
- else
- have_groff=yes
- fi
-elif test "x$use_groff" = x"yes" ; then
- AC_PATH_PROG([GROFF], [groff])
- if test "x$GROFF" = "x"; then
- AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
- fi
- have_groff=yes
-elif test "x$use_groff" = x"no" ; then
- if test "x$GROFF" != "x"; then
- AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
- fi
- have_groff=no
-else
- AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
-fi
-
-# We have groff, test for the presence of the macro packages
-if test "x$have_groff" = x"yes"; then
- AC_MSG_CHECKING([for ${GROFF} -ms macros])
- if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
- groff_ms_works=yes
- else
- groff_ms_works=no
- fi
- AC_MSG_RESULT([$groff_ms_works])
- AC_MSG_CHECKING([for ${GROFF} -mm macros])
- if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
- groff_mm_works=yes
- else
- groff_mm_works=no
- fi
- AC_MSG_RESULT([$groff_mm_works])
-fi
-
-# We have groff, test for HTML dependencies, one command per package
-if test "x$have_groff" = x"yes"; then
- AC_PATH_PROGS(GS_PATH, [gs gswin32c])
- AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
- AC_PATH_PROG(PSSELECT_PATH, [psselect])
- if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
- have_groff_html=yes
- else
- have_groff_html=no
- AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
- fi
-fi
-
-# Set Automake conditionals for Makefiles
-AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
-AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
-AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
-AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
-]) # XORG_WITH_GROFF
-
-# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
-# ---------------------------------------
-# Minimum version: 1.6.0
-# Minimum version for optional DEFAULT argument: 1.11.0
-# Minimum version for optional MIN-VERSION argument: 1.15.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a module to test for the
-# presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-fop option, it allows maximum flexibilty in making decisions
-# as whether or not to use the fop package. When DEFAULT is not specified,
-# --with-fop assumes 'auto'.
-#
-# Interface to module:
-# HAVE_FOP: used in makefiles to conditionally generate documentation
-# FOP: returns the path of the fop program found
-# returns the path set by the user in the environment
-# --with-fop: 'yes' user instructs the module to use fop
-# 'no' user instructs the module not to use fop
-#
-# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_FOP],[
-AC_ARG_VAR([FOP], [Path to fop command])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(fop,
- AS_HELP_STRING([--with-fop],
- [Use fop to regenerate documentation (default: ]_defopt[)]),
- [use_fop=$withval], [use_fop=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_fop" = x"auto"; then
- AC_PATH_PROG([FOP], [fop])
- if test "x$FOP" = "x"; then
- AC_MSG_WARN([fop not found - documentation targets will be skipped])
- have_fop=no
- else
- have_fop=yes
- fi
-elif test "x$use_fop" = x"yes" ; then
- AC_PATH_PROG([FOP], [fop])
- if test "x$FOP" = "x"; then
- AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
- fi
- have_fop=yes
-elif test "x$use_fop" = x"no" ; then
- if test "x$FOP" != "x"; then
- AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
- fi
- have_fop=no
-else
- AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
-fi
-
-# Test for a minimum version of fop, if provided.
-m4_ifval([$1],
-[if test "$have_fop" = yes; then
- # scrape the fop version
- AC_MSG_CHECKING([for fop minimum version])
- fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
- AC_MSG_RESULT([$fop_version])
- AS_VERSION_COMPARE([$fop_version], [$1],
- [if test "x$use_fop" = xauto; then
- AC_MSG_WARN([fop version $fop_version found, but $1 needed])
- have_fop=no
- else
- AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
- fi])
-fi])
-AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
-]) # XORG_WITH_FOP
-
-# XORG_WITH_PS2PDF([DEFAULT])
-# ----------------
-# Minimum version: 1.6.0
-# Minimum version for optional DEFAULT argument: 1.11.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a module to test for the
-# presence of the tool and obtain it's path in separate variables. Coupled with
-# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
-# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
-# --with-ps2pdf assumes 'auto'.
-#
-# Interface to module:
-# HAVE_PS2PDF: used in makefiles to conditionally generate documentation
-# PS2PDF: returns the path of the ps2pdf program found
-# returns the path set by the user in the environment
-# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
-# 'no' user instructs the module not to use ps2pdf
-#
-# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
-#
-AC_DEFUN([XORG_WITH_PS2PDF],[
-AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
-m4_define([_defopt], m4_default([$1], [auto]))
-AC_ARG_WITH(ps2pdf,
- AS_HELP_STRING([--with-ps2pdf],
- [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
- [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
-m4_undefine([_defopt])
-
-if test "x$use_ps2pdf" = x"auto"; then
- AC_PATH_PROG([PS2PDF], [ps2pdf])
- if test "x$PS2PDF" = "x"; then
- AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
- have_ps2pdf=no
- else
- have_ps2pdf=yes
- fi
-elif test "x$use_ps2pdf" = x"yes" ; then
- AC_PATH_PROG([PS2PDF], [ps2pdf])
- if test "x$PS2PDF" = "x"; then
- AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
- fi
- have_ps2pdf=yes
-elif test "x$use_ps2pdf" = x"no" ; then
- if test "x$PS2PDF" != "x"; then
- AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
- fi
- have_ps2pdf=no
-else
- AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
-fi
-AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
-]) # XORG_WITH_PS2PDF
-
-# XORG_ENABLE_DOCS (enable_docs=yes)
-# ----------------
-# Minimum version: 1.6.0
-#
-# Documentation tools are not always available on all platforms and sometimes
-# not at the appropriate level. This macro enables a builder to skip all
-# documentation targets except traditional man pages.
-# Combined with the specific tool checking macros XORG_WITH_*, it provides
-# maximum flexibilty in controlling documentation building.
-# Refer to:
-# XORG_WITH_XMLTO --with-xmlto
-# XORG_WITH_ASCIIDOC --with-asciidoc
-# XORG_WITH_DOXYGEN --with-doxygen
-# XORG_WITH_FOP --with-fop
-# XORG_WITH_GROFF --with-groff
-# XORG_WITH_PS2PDF --with-ps2pdf
-#
-# Interface to module:
-# ENABLE_DOCS: used in makefiles to conditionally generate documentation
-# --enable-docs: 'yes' user instructs the module to generate docs
-# 'no' user instructs the module not to generate docs
-# parm1: specify the default value, yes or no.
-#
-AC_DEFUN([XORG_ENABLE_DOCS],[
-m4_define([docs_default], m4_default([$1], [yes]))
-AC_ARG_ENABLE(docs,
- AS_HELP_STRING([--enable-docs],
- [Enable building the documentation (default: ]docs_default[)]),
- [build_docs=$enableval], [build_docs=]docs_default)
-m4_undefine([docs_default])
-AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
-AC_MSG_CHECKING([whether to build documentation])
-AC_MSG_RESULT([$build_docs])
-]) # XORG_ENABLE_DOCS
-
-# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
-# ----------------
-# Minimum version: 1.6.0
-#
-# This macro enables a builder to skip all developer documentation.
-# Combined with the specific tool checking macros XORG_WITH_*, it provides
-# maximum flexibilty in controlling documentation building.
-# Refer to:
-# XORG_WITH_XMLTO --with-xmlto
-# XORG_WITH_ASCIIDOC --with-asciidoc
-# XORG_WITH_DOXYGEN --with-doxygen
-# XORG_WITH_FOP --with-fop
-# XORG_WITH_GROFF --with-groff
-# XORG_WITH_PS2PDF --with-ps2pdf
-#
-# Interface to module:
-# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
-# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
-# 'no' user instructs the module not to generate developer docs
-# parm1: specify the default value, yes or no.
-#
-AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
-m4_define([devel_default], m4_default([$1], [yes]))
-AC_ARG_ENABLE(devel-docs,
- AS_HELP_STRING([--enable-devel-docs],
- [Enable building the developer documentation (default: ]devel_default[)]),
- [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
-m4_undefine([devel_default])
-AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
-AC_MSG_CHECKING([whether to build developer documentation])
-AC_MSG_RESULT([$build_devel_docs])
-]) # XORG_ENABLE_DEVEL_DOCS
-
-# XORG_ENABLE_SPECS (enable_specs=yes)
-# ----------------
-# Minimum version: 1.6.0
-#
-# This macro enables a builder to skip all functional specification targets.
-# Combined with the specific tool checking macros XORG_WITH_*, it provides
-# maximum flexibilty in controlling documentation building.
-# Refer to:
-# XORG_WITH_XMLTO --with-xmlto
-# XORG_WITH_ASCIIDOC --with-asciidoc
-# XORG_WITH_DOXYGEN --with-doxygen
-# XORG_WITH_FOP --with-fop
-# XORG_WITH_GROFF --with-groff
-# XORG_WITH_PS2PDF --with-ps2pdf
-#
-# Interface to module:
-# ENABLE_SPECS: used in makefiles to conditionally generate specs
-# --enable-specs: 'yes' user instructs the module to generate specs
-# 'no' user instructs the module not to generate specs
-# parm1: specify the default value, yes or no.
-#
-AC_DEFUN([XORG_ENABLE_SPECS],[
-m4_define([spec_default], m4_default([$1], [yes]))
-AC_ARG_ENABLE(specs,
- AS_HELP_STRING([--enable-specs],
- [Enable building the specs (default: ]spec_default[)]),
- [build_specs=$enableval], [build_specs=]spec_default)
-m4_undefine([spec_default])
-AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
-AC_MSG_CHECKING([whether to build functional specifications])
-AC_MSG_RESULT([$build_specs])
-]) # XORG_ENABLE_SPECS
-
-# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
-# ----------------------------------------------
-# Minimum version: 1.13.0
-#
-# This macro enables a builder to enable/disable unit testing
-# It makes no assumption about the test cases implementation
-# Test cases may or may not use Automake "Support for test suites"
-# They may or may not use the software utility library GLib
-#
-# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
-# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
-# The variable enable_unit_tests is used by other macros in this file.
-#
-# Interface to module:
-# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
-# enable_unit_tests: used in configure.ac for additional configuration
-# --enable-unit-tests: 'yes' user instructs the module to build tests
-# 'no' user instructs the module not to build tests
-# parm1: specify the default value, yes or no.
-#
-AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
-AC_BEFORE([$0], [XORG_WITH_GLIB])
-AC_BEFORE([$0], [XORG_LD_WRAP])
-m4_define([_defopt], m4_default([$1], [auto]))
-AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
- [Enable building unit test cases (default: ]_defopt[)]),
- [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
-m4_undefine([_defopt])
-AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
-AC_MSG_CHECKING([whether to build unit test cases])
-AC_MSG_RESULT([$enable_unit_tests])
-]) # XORG_ENABLE_UNIT_TESTS
-
-# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
-# ----------------------------------------
-# Minimum version: 1.13.0
-#
-# GLib is a library which provides advanced data structures and functions.
-# This macro enables a module to test for the presence of Glib.
-#
-# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
-# Otherwise the value of $enable_unit_tests is blank.
-#
-# Interface to module:
-# HAVE_GLIB: used in makefiles to conditionally build targets
-# with_glib: used in configure.ac to know if GLib has been found
-# --with-glib: 'yes' user instructs the module to use glib
-# 'no' user instructs the module not to use glib
-#
-AC_DEFUN([XORG_WITH_GLIB],[
-AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-m4_define([_defopt], m4_default([$2], [auto]))
-AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
- [Use GLib library for unit testing (default: ]_defopt[)]),
- [with_glib=$withval], [with_glib=]_defopt)
-m4_undefine([_defopt])
-
-have_glib=no
-# Do not probe GLib if user explicitly disabled unit testing
-if test "x$enable_unit_tests" != x"no"; then
- # Do not probe GLib if user explicitly disabled it
- if test "x$with_glib" != x"no"; then
- m4_ifval(
- [$1],
- [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
- [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
- )
- fi
-fi
-
-# Not having GLib when unit testing has been explicitly requested is an error
-if test "x$enable_unit_tests" = x"yes"; then
- if test "x$have_glib" = x"no"; then
- AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
- fi
-fi
-
-# Having unit testing disabled when GLib has been explicitly requested is an error
-if test "x$enable_unit_tests" = x"no"; then
- if test "x$with_glib" = x"yes"; then
- AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
- fi
-fi
-
-# Not having GLib when it has been explicitly requested is an error
-if test "x$with_glib" = x"yes"; then
- if test "x$have_glib" = x"no"; then
- AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
- fi
-fi
-
-AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
-]) # XORG_WITH_GLIB
-
-# XORG_LD_WRAP
-# ------------
-# Minimum version: 1.13.0
-#
-# Check if linker supports -wrap, passed via compiler flags
-#
-# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
-# Otherwise the value of $enable_unit_tests is blank.
-#
-AC_DEFUN([XORG_LD_WRAP],[
-XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
-# Not having ld wrap when unit testing has been explicitly requested is an error
-if test "x$enable_unit_tests" = x"yes"; then
- if test "x$have_ld_wrap" = x"no"; then
- AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
- fi
-fi
-AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
-#
-]) # XORG_LD_WRAP
-
-# XORG_CHECK_LINKER_FLAGS
-# -----------------------
-# SYNOPSIS
-#
-# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
-#
-# DESCRIPTION
-#
-# Check whether the given linker FLAGS work with the current language's
-# linker, or whether they give an error.
-#
-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-# success/failure.
-#
-# NOTE: Based on AX_CHECK_COMPILER_FLAGS.
-#
-# LICENSE
-#
-# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
-# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
-# Copyright (c) 2009 Matteo Frigo
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.#
-AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
-[AC_MSG_CHECKING([whether the linker accepts $1])
-dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
-AS_LITERAL_IF([$1],
- [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
- ax_save_FLAGS=$LDFLAGS
- LDFLAGS="$1"
- AC_LINK_IFELSE([AC_LANG_PROGRAM()],
- AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
- AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
- LDFLAGS=$ax_save_FLAGS])],
- [ax_save_FLAGS=$LDFLAGS
- LDFLAGS="$1"
- AC_LINK_IFELSE([AC_LANG_PROGRAM()],
- eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
- eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
- LDFLAGS=$ax_save_FLAGS])
-eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
-AC_MSG_RESULT($xorg_check_linker_flags)
-if test "x$xorg_check_linker_flags" = xyes; then
- m4_default([$2], :)
-else
- m4_default([$3], :)
-fi
-]) # XORG_CHECK_LINKER_FLAGS
-
-# XORG_CHECK_MALLOC_ZERO
-# ----------------------
-# Minimum version: 1.0.0
-#
-# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
-# malloc(0) returns NULL. Packages should add one of these cflags to
-# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
-AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
-AC_ARG_ENABLE(malloc0returnsnull,
- AS_HELP_STRING([--enable-malloc0returnsnull],
- [malloc(0) returns NULL (default: auto)]),
- [MALLOC_ZERO_RETURNS_NULL=$enableval],
- [MALLOC_ZERO_RETURNS_NULL=auto])
-
-AC_MSG_CHECKING([whether malloc(0) returns NULL])
-if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
- AC_RUN_IFELSE([AC_LANG_PROGRAM([
-#include <stdlib.h>
-],[
- char *m0, *r0, *c0, *p;
- m0 = malloc(0);
- p = malloc(10);
- r0 = realloc(p,0);
- c0 = calloc(0,10);
- exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
-])],
- [MALLOC_ZERO_RETURNS_NULL=yes],
- [MALLOC_ZERO_RETURNS_NULL=no],
- [MALLOC_ZERO_RETURNS_NULL=yes])
-fi
-AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
-
-if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
- MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
- XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
- XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
-else
- MALLOC_ZERO_CFLAGS=""
- XMALLOC_ZERO_CFLAGS=""
- XTMALLOC_ZERO_CFLAGS=""
-fi
-
-AC_SUBST([MALLOC_ZERO_CFLAGS])
-AC_SUBST([XMALLOC_ZERO_CFLAGS])
-AC_SUBST([XTMALLOC_ZERO_CFLAGS])
-]) # XORG_CHECK_MALLOC_ZERO
-
-# XORG_WITH_LINT()
-# ----------------
-# Minimum version: 1.1.0
-#
-# This macro enables the use of a tool that flags some suspicious and
-# non-portable constructs (likely to be bugs) in C language source code.
-# It will attempt to locate the tool and use appropriate options.
-# There are various lint type tools on different platforms.
-#
-# Interface to module:
-# LINT: returns the path to the tool found on the platform
-# or the value set to LINT on the configure cmd line
-# also an Automake conditional
-# LINT_FLAGS: an Automake variable with appropriate flags
-#
-# --with-lint: 'yes' user instructs the module to use lint
-# 'no' user instructs the module not to use lint (default)
-#
-# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
-# If the user sets the value of LINT_FLAGS, they are used verbatim.
-#
-AC_DEFUN([XORG_WITH_LINT],[
-
-AC_ARG_VAR([LINT], [Path to a lint-style command])
-AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
-AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
- [Use a lint-style source code checker (default: disabled)])],
- [use_lint=$withval], [use_lint=no])
-
-# Obtain platform specific info like program name and options
-# The lint program on FreeBSD and NetBSD is different from the one on Solaris
-case $host_os in
- *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
- lint_name=splint
- lint_options="-badflag"
- ;;
- *freebsd* | *netbsd*)
- lint_name=lint
- lint_options="-u -b"
- ;;
- *solaris*)
- lint_name=lint
- lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
- ;;
-esac
-
-# Test for the presence of the program (either guessed by the code or spelled out by the user)
-if test "x$use_lint" = x"yes" ; then
- AC_PATH_PROG([LINT], [$lint_name])
- if test "x$LINT" = "x"; then
- AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
- fi
-elif test "x$use_lint" = x"no" ; then
- if test "x$LINT" != "x"; then
- AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
- fi
-else
- AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
-fi
-
-# User supplied flags override default flags
-if test "x$LINT_FLAGS" != "x"; then
- lint_options=$LINT_FLAGS
-fi
-
-AC_SUBST([LINT_FLAGS],[$lint_options])
-AM_CONDITIONAL(LINT, [test "x$LINT" != x])
-
-]) # XORG_WITH_LINT
-
-# XORG_LINT_LIBRARY(LIBNAME)
-# --------------------------
-# Minimum version: 1.1.0
-#
-# Sets up flags for building lint libraries for checking programs that call
-# functions in the library.
-#
-# Interface to module:
-# LINTLIB - Automake variable with the name of lint library file to make
-# MAKE_LINT_LIB - Automake conditional
-#
-# --enable-lint-library: - 'yes' user instructs the module to created a lint library
-# - 'no' user instructs the module not to create a lint library (default)
-
-AC_DEFUN([XORG_LINT_LIBRARY],[
-AC_REQUIRE([XORG_WITH_LINT])
-AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
- [Create lint library (default: disabled)])],
- [make_lint_lib=$enableval], [make_lint_lib=no])
-
-if test "x$make_lint_lib" = x"yes" ; then
- LINTLIB=llib-l$1.ln
- if test "x$LINT" = "x"; then
- AC_MSG_ERROR([Cannot make lint library without --with-lint])
- fi
-elif test "x$make_lint_lib" != x"no" ; then
- AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
-fi
-
-AC_SUBST(LINTLIB)
-AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
-
-]) # XORG_LINT_LIBRARY
-
-# XORG_COMPILER_BRAND
-# -------------------
-# Minimum version: 1.14.0
-#
-# Checks for various brands of compilers and sets flags as appropriate:
-# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
-# clang compiler - sets CLANGCC to "yes"
-# Intel compiler - sets INTELCC to "yes"
-# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
-#
-AC_DEFUN([XORG_COMPILER_BRAND], [
-AC_REQUIRE([AC_PROG_CC_C99])
-AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
-AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
-AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
-]) # XORG_COMPILER_BRAND
-
-# XORG_CWARNFLAGS
-# ---------------
-# Minimum version: 1.2.0
-#
-# Defines CWARNFLAGS to enable C compiler warnings.
-#
-AC_DEFUN([XORG_CWARNFLAGS], [
-AC_REQUIRE([AC_PROG_CC_C99])
-AC_REQUIRE([XORG_COMPILER_BRAND])
-if test "x$GCC" = xyes ; then
- CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
--Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
--Wbad-function-cast -Wformat=2"
- case `$CC -dumpversion` in
- 3.4.* | 4.*)
- CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
- ;;
- esac
-else
- if test "x$SUNCC" = "xyes"; then
- CWARNFLAGS="-v"
- fi
-fi
-AC_SUBST(CWARNFLAGS)
-]) # XORG_CWARNFLAGS
-
-# XORG_STRICT_OPTION
-# -----------------------
-# Minimum version: 1.3.0
-#
-# Add configure option to enable strict compilation flags, such as treating
-# warnings as fatal errors.
-# If --enable-strict-compilation is passed to configure, adds strict flags to
-# $CWARNFLAGS.
-#
-# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
-# when strict compilation is unconditionally desired.
-AC_DEFUN([XORG_STRICT_OPTION], [
-# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
-AC_REQUIRE([AC_PROG_CC_C99])
-AC_REQUIRE([XORG_COMPILER_BRAND])
-AC_REQUIRE([XORG_CWARNFLAGS])
-
-AC_ARG_ENABLE(strict-compilation,
- AS_HELP_STRING([--enable-strict-compilation],
- [Enable all warnings from compiler and make them errors (default: disabled)]),
- [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
-if test "x$GCC" = xyes ; then
- STRICT_CFLAGS="-pedantic -Werror"
- # Add -Werror=attributes if supported (gcc 4.2 & later)
- AC_MSG_CHECKING([if $CC supports -Werror=attributes])
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
- [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
- AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])])
- CFLAGS="$save_CFLAGS"
-elif test "x$SUNCC" = "xyes"; then
- STRICT_CFLAGS="-errwarn"
-elif test "x$INTELCC" = "xyes"; then
- STRICT_CFLAGS="-Werror"
-fi
-if test "x$STRICT_COMPILE" = "xyes"; then
- CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
-fi
-AC_SUBST([STRICT_CFLAGS])
-AC_SUBST([CWARNFLAGS])
-]) # XORG_STRICT_OPTION
-
-# XORG_DEFAULT_OPTIONS
-# --------------------
-# Minimum version: 1.3.0
-#
-# Defines default options for X.Org modules.
-#
-AC_DEFUN([XORG_DEFAULT_OPTIONS], [
-AC_REQUIRE([AC_PROG_INSTALL])
-XORG_CWARNFLAGS
-XORG_STRICT_OPTION
-XORG_RELEASE_VERSION
-XORG_CHANGELOG
-XORG_INSTALL
-XORG_MANPAGE_SECTIONS
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
- [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
-]) # XORG_DEFAULT_OPTIONS
-
-# XORG_INSTALL()
-# ----------------
-# Minimum version: 1.4.0
-#
-# Defines the variable INSTALL_CMD as the command to copy
-# INSTALL from $prefix/share/util-macros.
-#
-AC_DEFUN([XORG_INSTALL], [
-AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
-INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
-mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
-|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
-echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
-AC_SUBST([INSTALL_CMD])
-]) # XORG_INSTALL
-dnl Copyright 2005 Red Hat, Inc
-dnl
-dnl Permission to use, copy, modify, distribute, and sell this software and its
-dnl documentation for any purpose is hereby granted without fee, provided that
-dnl the above copyright notice appear in all copies and that both that
-dnl copyright notice and this permission notice appear in supporting
-dnl documentation.
-dnl
-dnl The above copyright notice and this permission notice shall be included
-dnl in all copies or substantial portions of the Software.
-dnl
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-dnl OTHER DEALINGS IN THE SOFTWARE.
-dnl
-dnl Except as contained in this notice, the name of the copyright holders shall
-dnl not be used in advertising or otherwise to promote the sale, use or
-dnl other dealings in this Software without prior written authorization
-dnl from the copyright holders.
-dnl
-
-# XORG_RELEASE_VERSION
-# --------------------
-# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
-
-AC_DEFUN([XORG_RELEASE_VERSION],[
- AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
- [`echo $PACKAGE_VERSION | cut -d . -f 1`],
- [Major version of this package])
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
- if test "x$PVM" = "x"; then
- PVM="0"
- fi
- AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
- [$PVM],
- [Minor version of this package])
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
- if test "x$PVP" = "x"; then
- PVP="0"
- fi
- AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
- [$PVP],
- [Patch version of this package])
-])
-
-# XORG_CHANGELOG()
-# ----------------
-# Minimum version: 1.2.0
-#
-# Defines the variable CHANGELOG_CMD as the command to generate
-# ChangeLog from git.
-#
-#
-AC_DEFUN([XORG_CHANGELOG], [
-CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
-mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
-|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
-echo 'git directory not found: installing possibly empty changelog.' >&2)"
-AC_SUBST([CHANGELOG_CMD])
-]) # XORG_CHANGELOG
-
-dnl
-dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-dnl
-dnl Permission is hereby granted, free of charge, to any person obtaining a
-dnl copy of this software and associated documentation files (the "Software"),
-dnl to deal in the Software without restriction, including without limitation
-dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
-dnl and/or sell copies of the Software, and to permit persons to whom the
-dnl Software is furnished to do so, subject to the following conditions:
-dnl
-dnl The above copyright notice and this permission notice (including the next
-dnl paragraph) shall be included in all copies or substantial portions of the
-dnl Software.
-dnl
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-dnl DEALINGS IN THE SOFTWARE.
-dnl
-
-# XTRANS_TCP_FLAGS()
-# ------------------
-# Find needed libraries for TCP sockets, and check for IPv6 support
-AC_DEFUN([XTRANS_TCP_FLAGS],[
- # SVR4 hides these in libraries other than libc
- AC_SEARCH_LIBS(socket, [socket])
- AC_SEARCH_LIBS(gethostbyname, [nsl])
- if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
- AC_HAVE_LIBRARY([ws2_32])
- fi
-
- # Needs to come after above checks for libsocket & libnsl for SVR4 systems
- AC_ARG_ENABLE(ipv6,
- AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
- [IPV6CONN=$enableval],
- [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
- AC_MSG_CHECKING([if IPv6 support should be built])
- if test "$IPV6CONN" = "yes"; then
- AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
- fi
- AC_MSG_RESULT($IPV6CONN)
-
- # 4.3BSD-Reno added a new member to struct sockaddr_in
- AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
- AC_DEFINE([BSD44SOCKETS],1,
- [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
- ])
-
- # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
- AC_CHECK_TYPES([socklen_t], [], [], [
-AC_INCLUDES_DEFAULT
-#include <sys/socket.h>])
-
-]) # XTRANS_TCP_FLAGS
-
-# XTRANS_CONNECTION_FLAGS()
-# -------------------------
-# Standard checks for which Xtrans transports to use by the Xorg packages
-# that use Xtrans functions
-AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([AC_TYPE_SIGNAL])
- [case $host_os in
- mingw*) unixdef="no" ;;
- *) unixdef="yes" ;;
- esac]
- AC_ARG_ENABLE(unix-transport,
- AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
- [UNIXCONN=$enableval], [UNIXCONN=$unixdef])
- AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
- if test "$UNIXCONN" = "yes"; then
- AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
- fi
- AC_MSG_RESULT($UNIXCONN)
- AC_ARG_ENABLE(tcp-transport,
- AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
- [TCPCONN=$enableval], [TCPCONN=yes])
- AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
- AC_MSG_RESULT($TCPCONN)
- if test "$TCPCONN" = "yes"; then
- AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
- XTRANS_TCP_FLAGS
- fi
- [case $host_os in
- solaris*|sco*|sysv4*) localdef="yes" ;;
- *) localdef="no" ;;
- esac]
- AC_ARG_ENABLE(local-transport,
- AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
- [LOCALCONN=$enableval], [LOCALCONN=$localdef])
- AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
- AC_MSG_RESULT($LOCALCONN)
- if test "$LOCALCONN" = "yes"; then
- AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
- fi
-
-]) # XTRANS_CONNECTION_FLAGS
-
-
-# XTRANS_SECURE_RPC_FLAGS()
-# -------------------------
-# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
-# so that any necessary networking libraries are already found
-AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
-[AC_REQUIRE([XTRANS_TCP_FLAGS])
- AC_ARG_ENABLE(secure-rpc,
- AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
- [SECURE_RPC=$enableval], [SECURE_RPC="try"])
-
- if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
- FOUND_SECURE_RPC="no"
- AC_CHECK_FUNCS([authdes_seccreate authdes_create],
- [FOUND_SECURE_RPC="yes"])
- if test "x$FOUND_SECURE_RPC" = "xno" ; then
- if test "x$SECURE_RPC" = "xyes" ; then
- AC_MSG_ERROR([Secure RPC requested, but required functions not found])
- fi
- SECURE_RPC="no"
- else
- dnl FreeBSD keeps getsecretkey in librpcsvc
- AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
- SECURE_RPC="yes"
- fi
- fi
- AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
- if test "x$SECURE_RPC" = "xyes" ; then
- AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
- fi
- AC_MSG_RESULT($SECURE_RPC)
-]) # XTRANS_SECURE_RPC_FLAGS
-
-
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
@@ -11286,3 +9599,1953 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
+dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+dnl
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# XORG_MACROS_VERSION(required-version)
+# -------------------------------------
+# Minimum version: 1.1.0
+#
+# If you're using a macro added in Version 1.1 or newer, include this in
+# your configure.ac with the minimum required version, such as:
+# XORG_MACROS_VERSION(1.1)
+#
+# To ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
+#
+#
+# See the "minimum version" comment for each macro you use to see what
+# version you require.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.16.1])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+ [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+ [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # XORG_MACROS_VERSION
+
+# XORG_PROG_RAWCPP()
+# ------------------
+# Minimum version: 1.0.0
+#
+# Find cpp program and necessary flags for use in pre-processing text files
+# such as man pages and config files
+AC_DEFUN([XORG_PROG_RAWCPP],[
+AC_REQUIRE([AC_PROG_CPP])
+AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
+ [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
+
+# Check for flag to avoid builtin definitions - assumes unix is predefined,
+# which is not the best choice for supporting other OS'es, but covers most
+# of the ones we need for now.
+AC_MSG_CHECKING([if $RAWCPP requires -undef])
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
+if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+ AC_MSG_RESULT([no])
+else
+ if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+ RAWCPPFLAGS=-undef
+ AC_MSG_RESULT([yes])
+ # under Cygwin unix is still defined even with -undef
+ elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+ RAWCPPFLAGS="-undef -ansi"
+ AC_MSG_RESULT([yes, with -ansi])
+ else
+ AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
+ fi
+fi
+rm -f conftest.$ac_ext
+
+AC_MSG_CHECKING([if $RAWCPP requires -traditional])
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
+if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
+ AC_MSG_RESULT([no])
+else
+ if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
+ RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
+ fi
+fi
+rm -f conftest.$ac_ext
+AC_SUBST(RAWCPPFLAGS)
+]) # XORG_PROG_RAWCPP
+
+# XORG_MANPAGE_SECTIONS()
+# -----------------------
+# Minimum version: 1.0.0
+#
+# Determine which sections man pages go in for the different man page types
+# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
+# Not sure if there's any better way than just hardcoding by OS name.
+# Override default settings by setting environment variables
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+if test x$APP_MAN_SUFFIX = x ; then
+ APP_MAN_SUFFIX=1
+fi
+if test x$APP_MAN_DIR = x ; then
+ APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
+fi
+
+if test x$LIB_MAN_SUFFIX = x ; then
+ LIB_MAN_SUFFIX=3
+fi
+if test x$LIB_MAN_DIR = x ; then
+ LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
+fi
+
+if test x$FILE_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) FILE_MAN_SUFFIX=4 ;;
+ *) FILE_MAN_SUFFIX=5 ;;
+ esac
+fi
+if test x$FILE_MAN_DIR = x ; then
+ FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
+fi
+
+if test x$MISC_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) MISC_MAN_SUFFIX=5 ;;
+ *) MISC_MAN_SUFFIX=7 ;;
+ esac
+fi
+if test x$MISC_MAN_DIR = x ; then
+ MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
+fi
+
+if test x$DRIVER_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) DRIVER_MAN_SUFFIX=7 ;;
+ *) DRIVER_MAN_SUFFIX=4 ;;
+ esac
+fi
+if test x$DRIVER_MAN_DIR = x ; then
+ DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
+fi
+
+if test x$ADMIN_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) ADMIN_MAN_SUFFIX=1m ;;
+ *) ADMIN_MAN_SUFFIX=8 ;;
+ esac
+fi
+if test x$ADMIN_MAN_DIR = x ; then
+ ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
+fi
+
+
+AC_SUBST([APP_MAN_SUFFIX])
+AC_SUBST([LIB_MAN_SUFFIX])
+AC_SUBST([FILE_MAN_SUFFIX])
+AC_SUBST([MISC_MAN_SUFFIX])
+AC_SUBST([DRIVER_MAN_SUFFIX])
+AC_SUBST([ADMIN_MAN_SUFFIX])
+AC_SUBST([APP_MAN_DIR])
+AC_SUBST([LIB_MAN_DIR])
+AC_SUBST([FILE_MAN_DIR])
+AC_SUBST([MISC_MAN_DIR])
+AC_SUBST([DRIVER_MAN_DIR])
+AC_SUBST([ADMIN_MAN_DIR])
+
+XORG_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+ -e 's|__xservername__|Xorg|g' \
+ -e 's|__xconfigfile__|xorg.conf|g' \
+ -e 's|__projectroot__|\$(prefix)|g' \
+ -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+ [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+ [m4_ifval([$1],[:],
+ [if test x"$cross_compiling" != x"yes" ; then
+ AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+ [XORG_SGML_PATH=$prefix/share/sgml])
+ fi])
+ ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+ AC_MSG_RESULT([$XORG_SGML_PATH])
+ STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+ XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+ AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# XORG_CHECK_LINUXDOC
+# -------------------
+# Minimum version: 1.0.0
+#
+# Defines the variable MAKE_TEXT if the necessary tools and
+# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
+# Whether or not the necessary tools and files are found can be checked
+# with the AM_CONDITIONAL "BUILD_LINUXDOC"
+AC_DEFUN([XORG_CHECK_LINUXDOC],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
+ BUILDDOC=yes
+else
+ BUILDDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
+
+AC_MSG_RESULT([$BUILDDOC])
+
+AC_MSG_CHECKING([whether to build pdf documentation])
+
+if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+ BUILDPDFDOC=yes
+else
+ BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_LINUXDOC
+
+# XORG_CHECK_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+ test x$BUILD_TXTDOC != xno; then
+ BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+ test x$BUILD_PDFDOC != xno; then
+ BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+ test x$BUILD_PSDOC != xno; then
+ BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+ test x$BUILD_HTMLDOC != xno; then
+ BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package. When DEFAULT is not specified,
+# --with-xmlto assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XMLTO: used in makefiles to conditionally generate documentation
+# XMLTO: returns the path of the xmlto program found
+# returns the path set by the user in the environment
+# --with-xmlto: 'yes' user instructs the module to use xmlto
+# 'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+# xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xmlto,
+ AS_HELP_STRING([--with-xmlto],
+ [Use xmlto to regenerate documentation (default: ]_defopt[)]),
+ [use_xmlto=$withval], [use_xmlto=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xmlto" = x"auto"; then
+ AC_PATH_PROG([XMLTO], [xmlto])
+ if test "x$XMLTO" = "x"; then
+ AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+ have_xmlto=no
+ else
+ have_xmlto=yes
+ fi
+elif test "x$use_xmlto" = x"yes" ; then
+ AC_PATH_PROG([XMLTO], [xmlto])
+ if test "x$XMLTO" = "x"; then
+ AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+ fi
+ have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+ if test "x$XMLTO" != "x"; then
+ AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+ fi
+ have_xmlto=no
+else
+ AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+ # scrape the xmlto version
+ AC_MSG_CHECKING([the xmlto version])
+ xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+ AC_MSG_RESULT([$xmlto_version])
+ AS_VERSION_COMPARE([$xmlto_version], [$1],
+ [if test "x$use_xmlto" = xauto; then
+ AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+ have_xmlto=no
+ else
+ AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+ fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+ [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+ [have_xmlto_text=yes],
+ [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
+# --------------------------------------------
+# Minimum version: 1.12.0
+# Minimum version for optional DEFAULT argument: 1.12.0
+#
+# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
+# XML-based language used for the transformation of XML documents.
+# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
+# It is used under the cover by xmlto to generate html files from DocBook/XML.
+# The XSLT processor is often used as a standalone tool for transformations.
+# It should not be assumed that this tool is used only to work with documnetation.
+# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
+# XSLTPROC: returns the path of the xsltproc program found
+# returns the path set by the user in the environment
+# --with-xsltproc: 'yes' user instructs the module to use xsltproc
+# 'no' user instructs the module not to use xsltproc
+# have_xsltproc: returns yes if xsltproc found in PATH or no
+#
+# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XSLTPROC],[
+AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
+# Preserves the interface, should it be implemented later
+m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xsltproc,
+ AS_HELP_STRING([--with-xsltproc],
+ [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
+ [use_xsltproc=$withval], [use_xsltproc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xsltproc" = x"auto"; then
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+ if test "x$XSLTPROC" = "x"; then
+ AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
+ have_xsltproc=no
+ else
+ have_xsltproc=yes
+ fi
+elif test "x$use_xsltproc" = x"yes" ; then
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+ if test "x$XSLTPROC" = "x"; then
+ AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
+ fi
+ have_xsltproc=yes
+elif test "x$use_xsltproc" = x"no" ; then
+ if test "x$XSLTPROC" != "x"; then
+ AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
+ fi
+ have_xsltproc=no
+else
+ AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
+fi
+
+AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
+]) # XORG_WITH_XSLTPROC
+
+# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
+# ----------------------------------------
+# Minimum version: 1.15.0
+#
+# PERL (Practical Extraction and Report Language) is a language optimized for
+# scanning arbitrary text files, extracting information from those text files,
+# and printing reports based on that information.
+#
+# When DEFAULT is not specified, --with-perl assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PERL: used in makefiles to conditionally scan text files
+# PERL: returns the path of the perl program found
+# returns the path set by the user in the environment
+# --with-perl: 'yes' user instructs the module to use perl
+# 'no' user instructs the module not to use perl
+# have_perl: returns yes if perl found in PATH or no
+#
+# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PERL],[
+AC_ARG_VAR([PERL], [Path to perl command])
+# Preserves the interface, should it be implemented later
+m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(perl,
+ AS_HELP_STRING([--with-perl],
+ [Use perl for extracting information from files (default: ]_defopt[)]),
+ [use_perl=$withval], [use_perl=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_perl" = x"auto"; then
+ AC_PATH_PROG([PERL], [perl])
+ if test "x$PERL" = "x"; then
+ AC_MSG_WARN([perl not found - cannot extract information and report])
+ have_perl=no
+ else
+ have_perl=yes
+ fi
+elif test "x$use_perl" = x"yes" ; then
+ AC_PATH_PROG([PERL], [perl])
+ if test "x$PERL" = "x"; then
+ AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
+ fi
+ have_perl=yes
+elif test "x$use_perl" = x"no" ; then
+ if test "x$PERL" != "x"; then
+ AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
+ fi
+ have_perl=no
+else
+ AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
+fi
+
+AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
+]) # XORG_WITH_PERL
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package. When DEFAULT is not specified,
+# --with-asciidoc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC: returns the path of the asciidoc program found
+# returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+# 'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(asciidoc,
+ AS_HELP_STRING([--with-asciidoc],
+ [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
+ [use_asciidoc=$withval], [use_asciidoc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_asciidoc" = x"auto"; then
+ AC_PATH_PROG([ASCIIDOC], [asciidoc])
+ if test "x$ASCIIDOC" = "x"; then
+ AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+ have_asciidoc=no
+ else
+ have_asciidoc=yes
+ fi
+elif test "x$use_asciidoc" = x"yes" ; then
+ AC_PATH_PROG([ASCIIDOC], [asciidoc])
+ if test "x$ASCIIDOC" = "x"; then
+ AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+ fi
+ have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+ if test "x$ASCIIDOC" != "x"; then
+ AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+ fi
+ have_asciidoc=no
+else
+ AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+ # scrape the asciidoc version
+ AC_MSG_CHECKING([the asciidoc version])
+ asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+ AC_MSG_RESULT([$asciidoc_version])
+ AS_VERSION_COMPARE([$asciidoc_version], [$1],
+ [if test "x$use_asciidoc" = xauto; then
+ AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+ have_asciidoc=no
+ else
+ AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+ fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
+# --------------------------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package. When DEFAULT is not specified,
+# --with-doxygen assumes 'auto'.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN: returns the path of the doxygen program found
+# returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+# 'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(doxygen,
+ AS_HELP_STRING([--with-doxygen],
+ [Use doxygen to regenerate documentation (default: ]_defopt[)]),
+ [use_doxygen=$withval], [use_doxygen=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_doxygen" = x"auto"; then
+ AC_PATH_PROG([DOXYGEN], [doxygen])
+ if test "x$DOXYGEN" = "x"; then
+ AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+ have_doxygen=no
+ else
+ have_doxygen=yes
+ fi
+elif test "x$use_doxygen" = x"yes" ; then
+ AC_PATH_PROG([DOXYGEN], [doxygen])
+ if test "x$DOXYGEN" = "x"; then
+ AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+ fi
+ have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+ if test "x$DOXYGEN" != "x"; then
+ AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+ fi
+ have_doxygen=no
+else
+ AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+ # scrape the doxygen version
+ AC_MSG_CHECKING([the doxygen version])
+ doxygen_version=`$DOXYGEN --version 2>/dev/null`
+ AC_MSG_RESULT([$doxygen_version])
+ AS_VERSION_COMPARE([$doxygen_version], [$1],
+ [if test "x$use_doxygen" = xauto; then
+ AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+ have_doxygen=no
+ else
+ AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+ fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package. When DEFAULT is not specified,
+# --with-groff assumes 'auto'.
+#
+# Interface to module:
+# HAVE_GROFF: used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF: returns the path of the groff program found
+# returns the path set by the user in the environment
+# --with-groff: 'yes' user instructs the module to use groff
+# 'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+# psselect from the psutils package.
+# the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(groff,
+ AS_HELP_STRING([--with-groff],
+ [Use groff to regenerate documentation (default: ]_defopt[)]),
+ [use_groff=$withval], [use_groff=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_groff" = x"auto"; then
+ AC_PATH_PROG([GROFF], [groff])
+ if test "x$GROFF" = "x"; then
+ AC_MSG_WARN([groff not found - documentation targets will be skipped])
+ have_groff=no
+ else
+ have_groff=yes
+ fi
+elif test "x$use_groff" = x"yes" ; then
+ AC_PATH_PROG([GROFF], [groff])
+ if test "x$GROFF" = "x"; then
+ AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+ fi
+ have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+ if test "x$GROFF" != "x"; then
+ AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+ fi
+ have_groff=no
+else
+ AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+ AC_MSG_CHECKING([for ${GROFF} -ms macros])
+ if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+ groff_ms_works=yes
+ else
+ groff_ms_works=no
+ fi
+ AC_MSG_RESULT([$groff_ms_works])
+ AC_MSG_CHECKING([for ${GROFF} -mm macros])
+ if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+ groff_mm_works=yes
+ else
+ groff_mm_works=no
+ fi
+ AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+ AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+ AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+ AC_PATH_PROG(PSSELECT_PATH, [psselect])
+ if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+ have_groff_html=yes
+ else
+ have_groff_html=no
+ AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+ fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
+# ---------------------------------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+# Minimum version for optional MIN-VERSION argument: 1.15.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package. When DEFAULT is not specified,
+# --with-fop assumes 'auto'.
+#
+# Interface to module:
+# HAVE_FOP: used in makefiles to conditionally generate documentation
+# FOP: returns the path of the fop program found
+# returns the path set by the user in the environment
+# --with-fop: 'yes' user instructs the module to use fop
+# 'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(fop,
+ AS_HELP_STRING([--with-fop],
+ [Use fop to regenerate documentation (default: ]_defopt[)]),
+ [use_fop=$withval], [use_fop=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_fop" = x"auto"; then
+ AC_PATH_PROG([FOP], [fop])
+ if test "x$FOP" = "x"; then
+ AC_MSG_WARN([fop not found - documentation targets will be skipped])
+ have_fop=no
+ else
+ have_fop=yes
+ fi
+elif test "x$use_fop" = x"yes" ; then
+ AC_PATH_PROG([FOP], [fop])
+ if test "x$FOP" = "x"; then
+ AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+ fi
+ have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+ if test "x$FOP" != "x"; then
+ AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+ fi
+ have_fop=no
+else
+ AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of fop, if provided.
+m4_ifval([$1],
+[if test "$have_fop" = yes; then
+ # scrape the fop version
+ AC_MSG_CHECKING([for fop minimum version])
+ fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
+ AC_MSG_RESULT([$fop_version])
+ AS_VERSION_COMPARE([$fop_version], [$1],
+ [if test "x$use_fop" = xauto; then
+ AC_MSG_WARN([fop version $fop_version found, but $1 needed])
+ have_fop=no
+ else
+ AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
+ fi])
+fi])
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
+# --with-ps2pdf assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PS2PDF: used in makefiles to conditionally generate documentation
+# PS2PDF: returns the path of the ps2pdf program found
+# returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+# 'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(ps2pdf,
+ AS_HELP_STRING([--with-ps2pdf],
+ [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
+ [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_ps2pdf" = x"auto"; then
+ AC_PATH_PROG([PS2PDF], [ps2pdf])
+ if test "x$PS2PDF" = "x"; then
+ AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+ have_ps2pdf=no
+ else
+ have_ps2pdf=yes
+ fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+ AC_PATH_PROG([PS2PDF], [ps2pdf])
+ if test "x$PS2PDF" = "x"; then
+ AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+ fi
+ have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+ if test "x$PS2PDF" != "x"; then
+ AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+ fi
+ have_ps2pdf=no
+else
+ AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO --with-xmlto
+# XORG_WITH_ASCIIDOC --with-asciidoc
+# XORG_WITH_DOXYGEN --with-doxygen
+# XORG_WITH_FOP --with-fop
+# XORG_WITH_GROFF --with-groff
+# XORG_WITH_PS2PDF --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS: used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+# 'no' user instructs the module not to generate docs
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+m4_define([docs_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(docs,
+ AS_HELP_STRING([--enable-docs],
+ [Enable building the documentation (default: ]docs_default[)]),
+ [build_docs=$enableval], [build_docs=]docs_default)
+m4_undefine([docs_default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO --with-xmlto
+# XORG_WITH_ASCIIDOC --with-asciidoc
+# XORG_WITH_DOXYGEN --with-doxygen
+# XORG_WITH_FOP --with-fop
+# XORG_WITH_GROFF --with-groff
+# XORG_WITH_PS2PDF --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+# 'no' user instructs the module not to generate developer docs
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+m4_define([devel_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(devel-docs,
+ AS_HELP_STRING([--enable-devel-docs],
+ [Enable building the developer documentation (default: ]devel_default[)]),
+ [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
+m4_undefine([devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO --with-xmlto
+# XORG_WITH_ASCIIDOC --with-asciidoc
+# XORG_WITH_DOXYGEN --with-doxygen
+# XORG_WITH_FOP --with-fop
+# XORG_WITH_GROFF --with-groff
+# XORG_WITH_PS2PDF --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS: used in makefiles to conditionally generate specs
+# --enable-specs: 'yes' user instructs the module to generate specs
+# 'no' user instructs the module not to generate specs
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+m4_define([spec_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(specs,
+ AS_HELP_STRING([--enable-specs],
+ [Enable building the specs (default: ]spec_default[)]),
+ [build_specs=$enableval], [build_specs=]spec_default)
+m4_undefine([spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
+# ----------------------------------------------
+# Minimum version: 1.13.0
+#
+# This macro enables a builder to enable/disable unit testing
+# It makes no assumption about the test cases implementation
+# Test cases may or may not use Automake "Support for test suites"
+# They may or may not use the software utility library GLib
+#
+# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
+# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
+# The variable enable_unit_tests is used by other macros in this file.
+#
+# Interface to module:
+# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
+# enable_unit_tests: used in configure.ac for additional configuration
+# --enable-unit-tests: 'yes' user instructs the module to build tests
+# 'no' user instructs the module not to build tests
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
+AC_BEFORE([$0], [XORG_WITH_GLIB])
+AC_BEFORE([$0], [XORG_LD_WRAP])
+AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
+ [Enable building unit test cases (default: ]_defopt[)]),
+ [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
+m4_undefine([_defopt])
+AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
+AC_MSG_CHECKING([whether to build unit test cases])
+AC_MSG_RESULT([$enable_unit_tests])
+]) # XORG_ENABLE_UNIT_TESTS
+
+# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
+# ----------------------------------------
+# Minimum version: 1.13.0
+#
+# GLib is a library which provides advanced data structures and functions.
+# This macro enables a module to test for the presence of Glib.
+#
+# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
+# Otherwise the value of $enable_unit_tests is blank.
+#
+# Interface to module:
+# HAVE_GLIB: used in makefiles to conditionally build targets
+# with_glib: used in configure.ac to know if GLib has been found
+# --with-glib: 'yes' user instructs the module to use glib
+# 'no' user instructs the module not to use glib
+#
+AC_DEFUN([XORG_WITH_GLIB],[
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
+ [Use GLib library for unit testing (default: ]_defopt[)]),
+ [with_glib=$withval], [with_glib=]_defopt)
+m4_undefine([_defopt])
+
+have_glib=no
+# Do not probe GLib if user explicitly disabled unit testing
+if test "x$enable_unit_tests" != x"no"; then
+ # Do not probe GLib if user explicitly disabled it
+ if test "x$with_glib" != x"no"; then
+ m4_ifval(
+ [$1],
+ [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
+ [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
+ )
+ fi
+fi
+
+# Not having GLib when unit testing has been explicitly requested is an error
+if test "x$enable_unit_tests" = x"yes"; then
+ if test "x$have_glib" = x"no"; then
+ AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
+ fi
+fi
+
+# Having unit testing disabled when GLib has been explicitly requested is an error
+if test "x$enable_unit_tests" = x"no"; then
+ if test "x$with_glib" = x"yes"; then
+ AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
+ fi
+fi
+
+# Not having GLib when it has been explicitly requested is an error
+if test "x$with_glib" = x"yes"; then
+ if test "x$have_glib" = x"no"; then
+ AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
+ fi
+fi
+
+AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
+]) # XORG_WITH_GLIB
+
+# XORG_LD_WRAP([required|optional])
+# ---------------------------------
+# Minimum version: 1.13.0
+#
+# Check if linker supports -wrap, passed via compiler flags
+#
+# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
+# Otherwise the value of $enable_unit_tests is blank.
+#
+# Argument added in 1.16.0 - default is "required", to match existing behavior
+# of returning an error if enable_unit_tests is yes, and ld -wrap is not
+# available, an argument of "optional" allows use when some unit tests require
+# ld -wrap and others do not.
+#
+AC_DEFUN([XORG_LD_WRAP],[
+XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
+ [AC_LANG_PROGRAM([#include <stdlib.h>
+ void __wrap_exit(int status) { return; }],
+ [exit(0);])])
+# Not having ld wrap when unit testing has been explicitly requested is an error
+if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
+ if test "x$have_ld_wrap" = x"no"; then
+ AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
+ fi
+fi
+AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
+#
+]) # XORG_LD_WRAP
+
+# XORG_CHECK_LINKER_FLAGS
+# -----------------------
+# SYNOPSIS
+#
+# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
+#
+# DESCRIPTION
+#
+# Check whether the given linker FLAGS work with the current language's
+# linker, or whether they give an error.
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# PROGRAM-SOURCE is the program source to link with, if needed
+#
+# NOTE: Based on AX_CHECK_COMPILER_FLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2009 Matteo Frigo
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.#
+AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
+[AC_MSG_CHECKING([whether the linker accepts $1])
+dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
+AS_LITERAL_IF([$1],
+ [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
+ ax_save_FLAGS=$LDFLAGS
+ LDFLAGS="$1"
+ AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
+ AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
+ AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
+ LDFLAGS=$ax_save_FLAGS])],
+ [ax_save_FLAGS=$LDFLAGS
+ LDFLAGS="$1"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
+ eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
+ LDFLAGS=$ax_save_FLAGS])
+eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
+AC_MSG_RESULT($xorg_check_linker_flags)
+if test "x$xorg_check_linker_flags" = xyes; then
+ m4_default([$2], :)
+else
+ m4_default([$3], :)
+fi
+]) # XORG_CHECK_LINKER_FLAGS
+
+# XORG_MEMORY_CHECK_FLAGS
+# -----------------------
+# Minimum version: 1.16.0
+#
+# This macro attempts to find appropriate memory checking functionality
+# for various platforms which unit testing code may use to catch various
+# forms of memory allocation and access errors in testing.
+#
+# Interface to module:
+# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
+# Usually added to TESTS_ENVIRONMENT in Makefile.am
+#
+# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
+#
+AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
+
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
+ [Environment variables to enable memory checking in tests])
+
+# Check for different types of support on different platforms
+case $host_os in
+ solaris*)
+ AC_CHECK_LIB([umem], [umem_alloc],
+ [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
+ ;;
+ *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
+ # both directly and inverted, so should not be 0 or 255.
+ malloc_debug_env='MALLOC_PERTURB_=15'
+ ;;
+ darwin*)
+ malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
+ ;;
+ *bsd*)
+ malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
+ ;;
+esac
+
+# User supplied flags override default flags
+if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
+ malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
+fi
+
+AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
+]) # XORG_WITH_LINT
+
+# XORG_CHECK_MALLOC_ZERO
+# ----------------------
+# Minimum version: 1.0.0
+#
+# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
+# malloc(0) returns NULL. Packages should add one of these cflags to
+# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
+AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
+AC_ARG_ENABLE(malloc0returnsnull,
+ AS_HELP_STRING([--enable-malloc0returnsnull],
+ [malloc(0) returns NULL (default: auto)]),
+ [MALLOC_ZERO_RETURNS_NULL=$enableval],
+ [MALLOC_ZERO_RETURNS_NULL=auto])
+
+AC_MSG_CHECKING([whether malloc(0) returns NULL])
+if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([
+#include <stdlib.h>
+],[
+ char *m0, *r0, *c0, *p;
+ m0 = malloc(0);
+ p = malloc(10);
+ r0 = realloc(p,0);
+ c0 = calloc(0,10);
+ exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
+])],
+ [MALLOC_ZERO_RETURNS_NULL=yes],
+ [MALLOC_ZERO_RETURNS_NULL=no],
+ [MALLOC_ZERO_RETURNS_NULL=yes])
+fi
+AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
+
+if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
+ MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
+ XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
+ XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
+else
+ MALLOC_ZERO_CFLAGS=""
+ XMALLOC_ZERO_CFLAGS=""
+ XTMALLOC_ZERO_CFLAGS=""
+fi
+
+AC_SUBST([MALLOC_ZERO_CFLAGS])
+AC_SUBST([XMALLOC_ZERO_CFLAGS])
+AC_SUBST([XTMALLOC_ZERO_CFLAGS])
+]) # XORG_CHECK_MALLOC_ZERO
+
+# XORG_WITH_LINT()
+# ----------------
+# Minimum version: 1.1.0
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT: returns the path to the tool found on the platform
+# or the value set to LINT on the configure cmd line
+# also an Automake conditional
+# LINT_FLAGS: an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+# 'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+ [Use a lint-style source code checker (default: disabled)])],
+ [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+ *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+ lint_name=splint
+ lint_options="-badflag"
+ ;;
+ *freebsd* | *netbsd*)
+ lint_name=lint
+ lint_options="-u -b"
+ ;;
+ *solaris*)
+ lint_name=lint
+ lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+ ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+ AC_PATH_PROG([LINT], [$lint_name])
+ if test "x$LINT" = "x"; then
+ AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+ fi
+elif test "x$use_lint" = x"no" ; then
+ if test "x$LINT" != "x"; then
+ AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+ fi
+else
+ AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+ lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # XORG_WITH_LINT
+
+# XORG_LINT_LIBRARY(LIBNAME)
+# --------------------------
+# Minimum version: 1.1.0
+#
+# Sets up flags for building lint libraries for checking programs that call
+# functions in the library.
+#
+# Interface to module:
+# LINTLIB - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB - Automake conditional
+#
+# --enable-lint-library: - 'yes' user instructs the module to created a lint library
+# - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+ [Create lint library (default: disabled)])],
+ [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+ LINTLIB=llib-l$1.ln
+ if test "x$LINT" = "x"; then
+ AC_MSG_ERROR([Cannot make lint library without --with-lint])
+ fi
+elif test "x$make_lint_lib" != x"no" ; then
+ AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_COMPILER_BRAND
+# -------------------
+# Minimum version: 1.14.0
+#
+# Checks for various brands of compilers and sets flags as appropriate:
+# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
+# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
+# clang compiler - sets CLANGCC to "yes"
+# Intel compiler - sets INTELCC to "yes"
+# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
+#
+AC_DEFUN([XORG_COMPILER_BRAND], [
+AC_LANG_CASE(
+ [C], [
+ AC_REQUIRE([AC_PROG_CC_C99])
+ ],
+ [C++], [
+ AC_REQUIRE([AC_PROG_CXX])
+ ]
+)
+AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
+AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+]) # XORG_COMPILER_BRAND
+
+# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
+# ---------------
+# Minimum version: 1.16.0
+#
+# Test if the compiler works when passed the given flag as a command line argument.
+# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
+# next flag in the list until there are no more options.
+#
+# Note that this does not guarantee that the compiler supports the flag as some
+# compilers will simply ignore arguments that they do not understand, but we do
+# attempt to weed out false positives by using -Werror=unknown-warning-option and
+# -Werror=unused-command-line-argument
+#
+AC_DEFUN([XORG_TESTSET_CFLAG], [
+m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
+m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
+
+AC_LANG_COMPILER_REQUIRE
+
+AC_LANG_CASE(
+ [C], [
+ AC_REQUIRE([AC_PROG_CC_C99])
+ define([PREFIX], [C])
+ ],
+ [C++], [
+ define([PREFIX], [CXX])
+ ]
+)
+
+[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
+ AC_CACHE_CHECK([if compiler supports -Werror=unknown-warning-option],
+ xorg_cv_compiler_flag_unknown_warning_option,
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
+ [xorg_cv_compiler_flag_unknown_warning_option=yes],
+ [xorg_cv_compiler_flag_unknown_warning_option=no]))
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
+ fi
+ PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
+ AC_CACHE_CHECK([if compiler supports -Werror=unused-command-line-argument],
+ xorg_cv_compiler_flag_unused_command_line_argument,
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
+ [xorg_cv_compiler_flag_unused_command_line_argument=yes],
+ [xorg_cv_compiler_flag_unused_command_line_argument=no]))
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
+fi
+
+found="no"
+m4_foreach([flag], m4_cdr($@), [
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
+ fi
+
+ PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
+
+dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
+ AC_MSG_CHECKING([if $CC supports ]flag[])
+ cacheid=`AS_ECHO([xorg_cv_cc_flag_]flag[])`
+ AC_CACHE_VAL(AS_TR_SH($cacheid),
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
+ [eval AS_TR_SH($cacheid)=yes],
+ [eval AS_TR_SH($cacheid)=no])])
+
+ PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
+
+ eval supported=$AS_TR_SH($cacheid)
+ AC_MSG_RESULT([$supported])
+ if test "$supported" = "yes" ; then
+ $1="$$1 ]flag["
+ found="yes"
+ fi
+ fi
+])
+]) # XORG_TESTSET_CFLAG
+
+# XORG_COMPILER_FLAGS
+# ---------------
+# Minimum version: 1.16.0
+#
+# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
+# arguments supported by the selected compiler which do NOT alter the generated
+# code. These arguments will cause the compiler to print various warnings
+# during compilation AND turn a conservative set of warnings into errors.
+#
+# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
+# future versions of util-macros as options are added to new compilers.
+#
+AC_DEFUN([XORG_COMPILER_FLAGS], [
+AC_REQUIRE([XORG_COMPILER_BRAND])
+
+AC_ARG_ENABLE(selective-werror,
+ AS_HELP_STRING([--disable-selective-werror],
+ [Turn off selective compiler errors. (default: enabled)]),
+ [SELECTIVE_WERROR=$enableval],
+ [SELECTIVE_WERROR=yes])
+
+AC_LANG_CASE(
+ [C], [
+ define([PREFIX], [C])
+ ],
+ [C++], [
+ define([PREFIX], [CXX])
+ ]
+)
+# -v is too short to test reliably with XORG_TESTSET_CFLAG
+if test "x$SUNCC" = "xyes"; then
+ [BASE_]PREFIX[FLAGS]="-v"
+else
+ [BASE_]PREFIX[FLAGS]=""
+fi
+
+# This chunk of warnings were those that existed in the legacy CWARNFLAGS
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
+
+AC_LANG_CASE(
+ [C], [
+ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
+ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
+ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
+ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
+ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
+ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
+ ]
+)
+
+# This chunk adds additional warnings that could catch undesired effects.
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
+
+# These are currently disabled because they are noisy. They will be enabled
+# in the future once the codebase is sufficiently modernized to silence
+# them. For now, I don't want them to drown out the other warnings.
+# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
+# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
+# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
+
+# Turn some warnings into errors, so we don't accidently get successful builds
+# when there are problems that should be fixed.
+
+if test "x$SELECTIVE_WERROR" = "xyes" ; then
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
+else
+AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
+XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
+fi
+
+AC_SUBST([BASE_]PREFIX[FLAGS])
+]) # XORG_COMPILER_FLAGS
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+# This function is deprecated because it defines -fno-strict-aliasing
+# which alters the code generated by the compiler. If -fno-strict-aliasing
+# is needed, then it should be added explicitly in the module when
+# it is updated to use BASE_CFLAGS.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([XORG_COMPILER_FLAGS])
+AC_REQUIRE([XORG_COMPILER_BRAND])
+AC_LANG_CASE(
+ [C], [
+ CWARNFLAGS="$BASE_CFLAGS"
+ if test "x$GCC" = xyes ; then
+ CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
+ fi
+ AC_SUBST(CWARNFLAGS)
+ ]
+)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation flags, such as treating
+# warnings as fatal errors.
+# If --enable-strict-compilation is passed to configure, adds strict flags to
+# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
+#
+# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
+# when strict compilation is unconditionally desired.
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([XORG_CWARNFLAGS])
+AC_REQUIRE([XORG_COMPILER_FLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+ AS_HELP_STRING([--enable-strict-compilation],
+ [Enable all warnings from compiler and make them errors (default: disabled)]),
+ [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+
+AC_LANG_CASE(
+ [C], [
+ define([PREFIX], [C])
+ ],
+ [C++], [
+ define([PREFIX], [CXX])
+ ]
+)
+
+[STRICT_]PREFIX[FLAGS]=""
+XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
+XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
+
+# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
+# activate it with -Werror, so we add it here explicitly.
+XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+ [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
+ AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
+fi
+AC_SUBST([STRICT_]PREFIX[FLAGS])
+AC_SUBST([BASE_]PREFIX[FLAGS])
+AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_COMPILER_FLAGS
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+dnl Copyright 2005 Red Hat, Inc
+dnl
+dnl Permission to use, copy, modify, distribute, and sell this software and its
+dnl documentation for any purpose is hereby granted without fee, provided that
+dnl the above copyright notice appear in all copies and that both that
+dnl copyright notice and this permission notice appear in supporting
+dnl documentation.
+dnl
+dnl The above copyright notice and this permission notice shall be included
+dnl in all copies or substantial portions of the Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+dnl OTHER DEALINGS IN THE SOFTWARE.
+dnl
+dnl Except as contained in this notice, the name of the copyright holders shall
+dnl not be used in advertising or otherwise to promote the sale, use or
+dnl other dealings in this Software without prior written authorization
+dnl from the copyright holders.
+dnl
+
+# XORG_RELEASE_VERSION
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+
+AC_DEFUN([XORG_RELEASE_VERSION],[
+ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+ [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+ [Major version of this package])
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+ if test "x$PVM" = "x"; then
+ PVM="0"
+ fi
+ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+ [$PVM],
+ [Minor version of this package])
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+ if test "x$PVP" = "x"; then
+ PVP="0"
+ fi
+ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+ [$PVP],
+ [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+dnl
+dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+dnl
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+dnl
+
+# XTRANS_TCP_FLAGS()
+# ------------------
+# Find needed libraries for TCP sockets, and check for IPv6 support
+AC_DEFUN([XTRANS_TCP_FLAGS],[
+ # SVR4 hides these in libraries other than libc
+ AC_SEARCH_LIBS(socket, [socket])
+ AC_SEARCH_LIBS(gethostbyname, [nsl])
+ if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
+ AC_HAVE_LIBRARY([ws2_32])
+ fi
+
+ # Needs to come after above checks for libsocket & libnsl for SVR4 systems
+ AC_ARG_ENABLE(ipv6,
+ AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
+ [IPV6CONN=$enableval],
+ [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
+ AC_MSG_CHECKING([if IPv6 support should be built])
+ if test "$IPV6CONN" = "yes"; then
+ AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
+ fi
+ AC_MSG_RESULT($IPV6CONN)
+
+ # 4.3BSD-Reno added a new member to struct sockaddr_in
+ AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
+ AC_DEFINE([BSD44SOCKETS],1,
+ [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+ ])
+
+ # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
+ AC_CHECK_TYPES([socklen_t], [], [], [
+AC_INCLUDES_DEFAULT
+#include <sys/socket.h>])
+
+]) # XTRANS_TCP_FLAGS
+
+# XTRANS_CONNECTION_FLAGS()
+# -------------------------
+# Standard checks for which Xtrans transports to use by the Xorg packages
+# that use Xtrans functions
+AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_TYPE_SIGNAL])
+ [case $host_os in
+ mingw*) unixdef="no" ;;
+ *) unixdef="yes" ;;
+ esac]
+ AC_ARG_ENABLE(unix-transport,
+ AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
+ [UNIXCONN=$enableval], [UNIXCONN=$unixdef])
+ AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
+ if test "$UNIXCONN" = "yes"; then
+ AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
+ fi
+ AC_MSG_RESULT($UNIXCONN)
+ AC_ARG_ENABLE(tcp-transport,
+ AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
+ [TCPCONN=$enableval], [TCPCONN=yes])
+ AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
+ AC_MSG_RESULT($TCPCONN)
+ if test "$TCPCONN" = "yes"; then
+ AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
+ XTRANS_TCP_FLAGS
+ fi
+ [case $host_os in
+ solaris*|sco*|sysv4*) localdef="yes" ;;
+ *) localdef="no" ;;
+ esac]
+ AC_ARG_ENABLE(local-transport,
+ AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
+ [LOCALCONN=$enableval], [LOCALCONN=$localdef])
+ AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
+ AC_MSG_RESULT($LOCALCONN)
+ if test "$LOCALCONN" = "yes"; then
+ AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
+ fi
+
+]) # XTRANS_CONNECTION_FLAGS
+
+
+# XTRANS_SECURE_RPC_FLAGS()
+# -------------------------
+# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
+# so that any necessary networking libraries are already found
+AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
+[AC_REQUIRE([XTRANS_TCP_FLAGS])
+ AC_ARG_ENABLE(secure-rpc,
+ AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
+ [SECURE_RPC=$enableval], [SECURE_RPC="try"])
+
+ if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
+ FOUND_SECURE_RPC="no"
+ AC_CHECK_FUNCS([authdes_seccreate authdes_create],
+ [FOUND_SECURE_RPC="yes"])
+ if test "x$FOUND_SECURE_RPC" = "xno" ; then
+ if test "x$SECURE_RPC" = "xyes" ; then
+ AC_MSG_ERROR([Secure RPC requested, but required functions not found])
+ fi
+ SECURE_RPC="no"
+ else
+ dnl FreeBSD keeps getsecretkey in librpcsvc
+ AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
+ SECURE_RPC="yes"
+ fi
+ fi
+ AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
+ if test "x$SECURE_RPC" = "xyes" ; then
+ AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
+ fi
+ AC_MSG_RESULT($SECURE_RPC)
+]) # XTRANS_SECURE_RPC_FLAGS
+
+
diff --git a/libXfont/configure b/libXfont/configure
index aecef381d..41e9fa9fe 100644
--- a/libXfont/configure
+++ b/libXfont/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for libXfont 1.4.4.
+# Generated by GNU Autoconf 2.68 for libXfont 1.4.5.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -631,8 +631,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libXfont'
PACKAGE_TARNAME='libXfont'
-PACKAGE_VERSION='1.4.4'
-PACKAGE_STRING='libXfont 1.4.4'
+PACKAGE_VERSION='1.4.5'
+PACKAGE_STRING='libXfont 1.4.5'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL=''
@@ -741,6 +741,7 @@ PKG_CONFIG
CHANGELOG_CMD
STRICT_CFLAGS
CWARNFLAGS
+BASE_CFLAGS
CPP
OTOOL64
OTOOL
@@ -863,6 +864,7 @@ enable_dependency_tracking
with_gnu_ld
with_sysroot
enable_libtool_lock
+enable_selective_werror
enable_strict_compilation
enable_silent_rules
enable_devel_docs
@@ -1439,7 +1441,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libXfont 1.4.4 to adapt to many kinds of systems.
+\`configure' configures libXfont 1.4.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1509,7 +1511,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libXfont 1.4.4:";;
+ short | recursive ) echo "Configuration of libXfont 1.4.5:";;
esac
cat <<\_ACEOF
@@ -1526,6 +1528,9 @@ Optional Features:
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-selective-werror
+ Turn off selective compiler errors. (default:
+ enabled)
--enable-strict-compilation
Enable all warnings from compiler and make them
errors (default: disabled)
@@ -1645,7 +1650,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libXfont configure 1.4.4
+libXfont configure 1.4.5
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2171,7 +2176,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libXfont $as_me 1.4.4, which was
+It was created by libXfont $as_me 1.4.5, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2991,7 +2996,7 @@ fi
# Define the identity of the package.
PACKAGE='libXfont'
- VERSION='1.4.4'
+ VERSION='1.4.5'
cat >>confdefs.h <<_ACEOF
@@ -11751,6 +11756,8 @@ fi
+
+
ac_fn_c_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default"
if test "x$ac_cv_have_decl___clang__" = xyes; then :
CLANGCC="yes"
@@ -11894,24 +11901,5246 @@ fi
-if test "x$GCC" = xyes ; then
- CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
--Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
--Wbad-function-cast -Wformat=2"
- case `$CC -dumpversion` in
- 3.4.* | 4.*)
- CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
- ;;
- esac
+# Check whether --enable-selective-werror was given.
+if test "${enable_selective_werror+set}" = set; then :
+ enableval=$enable_selective_werror; SELECTIVE_WERROR=$enableval
else
- if test "x$SUNCC" = "xyes"; then
- CWARNFLAGS="-v"
- fi
+ SELECTIVE_WERROR=yes
+fi
+
+
+
+
+
+# -v is too short to test reliably with XORG_TESTSET_CFLAG
+if test "x$SUNCC" = "xyes"; then
+ BASE_CFLAGS="-v"
+else
+ BASE_CFLAGS=""
+fi
+
+# This chunk of warnings were those that existed in the legacy CWARNFLAGS
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wall"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wall" >&5
+$as_echo_n "checking if $CC supports -Wall... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wall`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wall"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wpointer-arith"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-arith" >&5
+$as_echo_n "checking if $CC supports -Wpointer-arith... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wpointer-arith`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wpointer-arith"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wmissing-declarations"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-declarations" >&5
+$as_echo_n "checking if $CC supports -Wmissing-declarations... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wmissing-declarations`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wmissing-declarations"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wformat=2"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat=2" >&5
+$as_echo_n "checking if $CC supports -Wformat=2... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wformat=2`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wformat=2"
+ found="yes"
+ fi
+ fi
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wformat"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat" >&5
+$as_echo_n "checking if $CC supports -Wformat... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wformat`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wformat"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wstrict-prototypes" >&5
+$as_echo_n "checking if $CC supports -Wstrict-prototypes... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wstrict-prototypes`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wstrict-prototypes"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wmissing-prototypes"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-prototypes" >&5
+$as_echo_n "checking if $CC supports -Wmissing-prototypes... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wmissing-prototypes`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wmissing-prototypes"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wnested-externs"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnested-externs" >&5
+$as_echo_n "checking if $CC supports -Wnested-externs... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wnested-externs`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wnested-externs"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wbad-function-cast"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wbad-function-cast" >&5
+$as_echo_n "checking if $CC supports -Wbad-function-cast... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wbad-function-cast`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wbad-function-cast"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wold-style-definition"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wold-style-definition" >&5
+$as_echo_n "checking if $CC supports -Wold-style-definition... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wold-style-definition`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wold-style-definition"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wdeclaration-after-statement" >&5
+$as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wdeclaration-after-statement`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wdeclaration-after-statement"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+# This chunk adds additional warnings that could catch undesired effects.
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wunused"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wunused" >&5
+$as_echo_n "checking if $CC supports -Wunused... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wunused`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wunused"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wuninitialized"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wuninitialized" >&5
+$as_echo_n "checking if $CC supports -Wuninitialized... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wuninitialized`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wuninitialized"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wshadow"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wshadow" >&5
+$as_echo_n "checking if $CC supports -Wshadow... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wshadow`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wshadow"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wcast-qual"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wcast-qual" >&5
+$as_echo_n "checking if $CC supports -Wcast-qual... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wcast-qual`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wcast-qual"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wmissing-noreturn"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5
+$as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wmissing-noreturn`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wmissing-format-attribute"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5
+$as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wmissing-format-attribute`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wredundant-decls"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5
+$as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wredundant-decls`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls"
+ found="yes"
+ fi
+ fi
+
+
+
+# These are currently disabled because they are noisy. They will be enabled
+# in the future once the codebase is sufficiently modernized to silence
+# them. For now, I don't want them to drown out the other warnings.
+# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
+# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
+# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
+
+# Turn some warnings into errors, so we don't accidently get successful builds
+# when there are problems that should be fixed.
+
+if test "x$SELECTIVE_WERROR" = "xyes" ; then
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=implicit"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=implicit" >&5
+$as_echo_n "checking if $CC supports -Werror=implicit... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=implicit`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=implicit"
+ found="yes"
+ fi
+ fi
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5
+$as_echo_n "checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=nonnull"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=nonnull" >&5
+$as_echo_n "checking if $CC supports -Werror=nonnull... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=nonnull`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=nonnull"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=init-self"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=init-self" >&5
+$as_echo_n "checking if $CC supports -Werror=init-self... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=init-self`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=init-self"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=main"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=main" >&5
+$as_echo_n "checking if $CC supports -Werror=main... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=main`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=main"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=missing-braces"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=missing-braces" >&5
+$as_echo_n "checking if $CC supports -Werror=missing-braces... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=missing-braces`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=missing-braces"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=sequence-point"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=sequence-point" >&5
+$as_echo_n "checking if $CC supports -Werror=sequence-point... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=sequence-point`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=sequence-point"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=return-type"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=return-type" >&5
+$as_echo_n "checking if $CC supports -Werror=return-type... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=return-type`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=return-type"
+ found="yes"
+ fi
+ fi
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5
+$as_echo_n "checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-errwarn=E_FUNC_HAS_NO_RETURN_STMT`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=trigraphs"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=trigraphs" >&5
+$as_echo_n "checking if $CC supports -Werror=trigraphs... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=trigraphs`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=trigraphs"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=array-bounds"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=array-bounds" >&5
+$as_echo_n "checking if $CC supports -Werror=array-bounds... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=array-bounds`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=array-bounds"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=write-strings"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=write-strings" >&5
+$as_echo_n "checking if $CC supports -Werror=write-strings... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=write-strings`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=write-strings"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=address"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=address" >&5
+$as_echo_n "checking if $CC supports -Werror=address... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=address`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=address"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=int-to-pointer-cast"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=int-to-pointer-cast" >&5
+$as_echo_n "checking if $CC supports -Werror=int-to-pointer-cast... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=int-to-pointer-cast`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=int-to-pointer-cast"
+ found="yes"
+ fi
+ fi
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION" >&5
+$as_echo_n "checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-errwarn=E_BAD_PTR_INT_COMBINATION`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=pointer-to-int-cast"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=pointer-to-int-cast" >&5
+$as_echo_n "checking if $CC supports -Werror=pointer-to-int-cast... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=pointer-to-int-cast`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Werror=pointer-to-int-cast"
+ found="yes"
+ fi
+ fi
+
+ # Also -errwarn=E_BAD_PTR_INT_COMBINATION
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&5
+$as_echo "$as_me: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&2;}
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wimplicit"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wimplicit" >&5
+$as_echo_n "checking if $CC supports -Wimplicit... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wimplicit`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wimplicit"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wnonnull"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnonnull" >&5
+$as_echo_n "checking if $CC supports -Wnonnull... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wnonnull`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wnonnull"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Winit-self"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Winit-self" >&5
+$as_echo_n "checking if $CC supports -Winit-self... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Winit-self`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Winit-self"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wmain"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmain" >&5
+$as_echo_n "checking if $CC supports -Wmain... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wmain`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wmain"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wmissing-braces"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-braces" >&5
+$as_echo_n "checking if $CC supports -Wmissing-braces... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wmissing-braces`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wmissing-braces"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wsequence-point"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wsequence-point" >&5
+$as_echo_n "checking if $CC supports -Wsequence-point... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wsequence-point`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wsequence-point"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wreturn-type"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wreturn-type" >&5
+$as_echo_n "checking if $CC supports -Wreturn-type... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wreturn-type`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wreturn-type"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wtrigraphs"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wtrigraphs" >&5
+$as_echo_n "checking if $CC supports -Wtrigraphs... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wtrigraphs`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wtrigraphs"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Warray-bounds"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Warray-bounds" >&5
+$as_echo_n "checking if $CC supports -Warray-bounds... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Warray-bounds`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Warray-bounds"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wwrite-strings"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wwrite-strings" >&5
+$as_echo_n "checking if $CC supports -Wwrite-strings... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wwrite-strings`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wwrite-strings"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Waddress"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Waddress" >&5
+$as_echo_n "checking if $CC supports -Waddress... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Waddress`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Waddress"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wint-to-pointer-cast"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wint-to-pointer-cast" >&5
+$as_echo_n "checking if $CC supports -Wint-to-pointer-cast... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wint-to-pointer-cast`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wint-to-pointer-cast"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Wpointer-to-int-cast"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-to-int-cast" >&5
+$as_echo_n "checking if $CC supports -Wpointer-to-int-cast... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Wpointer-to-int-cast`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ BASE_CFLAGS="$BASE_CFLAGS -Wpointer-to-int-cast"
+ found="yes"
+ fi
+ fi
+
+
+fi
+
+
+
+
+
+
+
+ CWARNFLAGS="$BASE_CFLAGS"
+ if test "x$GCC" = xyes ; then
+ CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
+ fi
+
-# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
@@ -11923,33 +17152,415 @@ else
STRICT_COMPILE=no
fi
-if test "x$GCC" = xyes ; then
- STRICT_CFLAGS="-pedantic -Werror"
- # Add -Werror=attributes if supported (gcc 4.2 & later)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=attributes" >&5
-$as_echo_n "checking if $CC supports -Werror=attributes... " >&6; }
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+
+
+
+STRICT_CFLAGS=""
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-return 0;
+int i;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ xorg_cv_compiler_flag_unknown_warning_option=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -pedantic"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -pedantic" >&5
+$as_echo_n "checking if $CC supports -pedantic... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-pedantic`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ STRICT_CFLAGS="$STRICT_CFLAGS -pedantic"
+ found="yes"
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
-elif test "x$SUNCC" = "xyes"; then
- STRICT_CFLAGS="-errwarn"
-elif test "x$INTELCC" = "xyes"; then
- STRICT_CFLAGS="-Werror"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror" >&5
+$as_echo_n "checking if $CC supports -Werror... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ STRICT_CFLAGS="$STRICT_CFLAGS -Werror"
+ found="yes"
+ fi
+ fi
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -errwarn"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn" >&5
+$as_echo_n "checking if $CC supports -errwarn... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-errwarn`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ STRICT_CFLAGS="$STRICT_CFLAGS -errwarn"
+ found="yes"
+ fi
+ fi
+
+
+
+# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
+# activate it with -Werror, so we add it here explicitly.
+
+
+
+
+
+
+
+
+
+
+
+xorg_testset_save_CFLAGS="$CFLAGS"
+
+if test "x$xorg_testset_unknown_warning_option" = "x" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unknown-warning-option" >&5
+$as_echo_n "checking if compiler supports -Werror=unknown-warning-option... " >&6; }
+if ${xorg_cv_compiler_flag_unknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unknown_warning_option=yes
+else
+ xorg_cv_compiler_flag_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unknown_warning_option" >&5
+$as_echo "$xorg_cv_compiler_flag_unknown_warning_option" >&6; }
+ xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Werror=unused-command-line-argument" >&5
+$as_echo_n "checking if compiler supports -Werror=unused-command-line-argument... " >&6; }
+if ${xorg_cv_compiler_flag_unused_command_line_argument+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ xorg_cv_compiler_flag_unused_command_line_argument=yes
+else
+ xorg_cv_compiler_flag_unused_command_line_argument=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_compiler_flag_unused_command_line_argument" >&5
+$as_echo "$xorg_cv_compiler_flag_unused_command_line_argument" >&6; }
+ xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
+ CFLAGS="$xorg_testset_save_CFLAGS"
+fi
+
+found="no"
+
+ if test $found = "no" ; then
+ if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unknown-warning-option"
+ fi
+
+ if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
+ CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
+ fi
+
+ CFLAGS="$CFLAGS -Werror=attributes"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=attributes" >&5
+$as_echo_n "checking if $CC supports -Werror=attributes... " >&6; }
+ cacheid=`$as_echo xorg_cv_cc_flag_-Werror=attributes`
+ if { as_var=`$as_echo "$cacheid" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval `$as_echo "$cacheid" | $as_tr_sh`=yes
+else
+ eval `$as_echo "$cacheid" | $as_tr_sh`=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+ CFLAGS="$xorg_testset_save_CFLAGS"
+
+ eval supported=$`$as_echo "$cacheid" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
+$as_echo "$supported" >&6; }
+ if test "$supported" = "yes" ; then
+ STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
+ found="yes"
+ fi
+ fi
+
+
+
if test "x$STRICT_COMPILE" = "xyes"; then
+ BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS"
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
fi
@@ -11957,6 +17568,7 @@ fi
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
_ACEOF
@@ -14096,7 +19708,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libXfont $as_me 1.4.4, which was
+This file was extended by libXfont $as_me 1.4.5, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14162,7 +19774,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libXfont config.status 1.4.4
+libXfont config.status 1.4.5
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/libXfont/configure.ac b/libXfont/configure.ac
index 7aa7a1c62..b274a8f9e 100644
--- a/libXfont/configure.ac
+++ b/libXfont/configure.ac
@@ -21,13 +21,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
-#
-# This is the package version number, not the shared library
-# version. This same version number must appear in Xfont.h
-# Yes, it is a pain to synchronize version numbers. Unfortunately, it's
-# not possible to extract the version number here from Xfont.h
-#
-AC_INIT([libXfont], [1.4.4],
+AC_INIT([libXfont], [1.4.5],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfont])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h include/X11/fonts/fontconf.h])
@@ -75,13 +69,13 @@ AM_CONDITIONAL(XFONT_FREETYPE, [test x$XFONT_FREETYPE = xyes])
if test x$XFONT_FREETYPE = xyes; then
AC_DEFINE(XFONT_FREETYPE,1,[Support FreeType rasterizer for nearly all font file formats])
AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=auto)
-
+
if test "$freetype_config" = "auto" ; then
- PKG_CHECK_MODULES(FREETYPE, freetype2,
+ PKG_CHECK_MODULES(FREETYPE, freetype2,
freetype_config=no, freetype_config=yes)
fi
- if test "$freetype_config" = "yes"; then
+ if test "$freetype_config" = "yes"; then
AC_PATH_PROG(ft_config,freetype-config,no)
if test "$ft_config" = "no"; then
AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
@@ -90,7 +84,7 @@ if test x$XFONT_FREETYPE = xyes; then
ft_config="$freetype_config"
fi
- if test "$freetype_config" != "no"; then
+ if test "$freetype_config" != "no"; then
FREETYPE_CFLAGS="`$ft_config --cflags`"
FREETYPE_LIBS="`$ft_config --libs`"
fi
@@ -118,8 +112,8 @@ X_GZIP_FONT_COMPRESSION=1
AC_SUBST(X_GZIP_FONT_COMPRESSION)
AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz], AC_MSG_ERROR([*** zlib is required]))
-AC_ARG_WITH(bzip2,
- AS_HELP_STRING([--with-bzip2],
+AC_ARG_WITH(bzip2,
+ AS_HELP_STRING([--with-bzip2],
[Support bzip2 compressed bitmap fonts]),
[], [with_bzip2=no])
if test "x$with_bzip2" = xyes; then
diff --git a/libXfont/devbook.am b/libXfont/devbook.am
index 62f482958..400b2ca55 100644
--- a/libXfont/devbook.am
+++ b/libXfont/devbook.am
@@ -20,42 +20,36 @@ noinst_DATA =
# DocBook/XML file with chapters, appendix and images it includes
dist_noinst_DATA = $(docbook) $(chapters)
-#
-# Generate DocBook/XML output formats with or without stylesheets
-#
-
-# Stylesheets are available if the package xorg-sgml-doctools is installed
if HAVE_STYLESHEETS
-# The location where all cross reference databases are installed
-XMLTO_FLAGS = \
- --searchpath "$(XORG_SGML_PATH)/X11" \
- --stringparam current.docid="$(<:.xml=)"
-
-XMLTO_XHTML_FLAGS = \
- -m $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \
- --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
-
-XMLTO_FO_FLAGS = \
- -m $(STYLESHEET_SRCDIR)/xorg-fo.xsl
-endif HAVE_STYLESHEETS
+XMLTO_HTML_FLAGS = \
+ --searchpath "$(XORG_SGML_PATH)/X11" \
+ --searchpath "$(abs_top_builddir)" \
+ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
noinst_DATA += $(docbook:.xml=.html)
%.html: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
+
+if HAVE_XMLTO_TEXT
+noinst_DATA += $(docbook:.xml=.txt)
+%.txt: %.xml $(chapters)
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
+endif HAVE_XMLTO_TEXT
if HAVE_FOP
+XMLTO_FO_FLAGS = \
+ --searchpath "$(XORG_SGML_PATH)/X11" \
+ --searchpath "$(abs_top_builddir)" \
+ --stringparam img.src.path=$(abs_builddir)/ \
+ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+
noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
%.pdf: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
%.ps: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
endif HAVE_FOP
-
-if HAVE_XMLTO_TEXT
-noinst_DATA += $(docbook:.xml=.txt)
-%.txt: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
-endif HAVE_XMLTO_TEXT
+endif HAVE_STYLESHEETS
CLEANFILES = $(noinst_DATA)
diff --git a/libXfont/doc/Makefile.in b/libXfont/doc/Makefile.in
index 0e5814c46..d0cc41e67 100644
--- a/libXfont/doc/Makefile.in
+++ b/libXfont/doc/Makefile.in
@@ -52,8 +52,9 @@ build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/devbook.am
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_XMLTO_TRUE@am__append_1 = $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@am__append_2 = $(docbook:.xml=.txt)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_1 = $(docbook:.xml=.html)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@am__append_2 = $(docbook:.xml=.txt)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_3 = $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
subdir = doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -87,6 +88,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -229,30 +231,23 @@ top_srcdir = @top_srcdir@
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@docbook = fontlib.xml
# Developers documnetation is not installed
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@noinst_DATA = $(docbook:.xml=.html) \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@noinst_DATA = \
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_1) \
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_2)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_2) \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_3)
# DocBook/XML file with chapters, appendix and images it includes
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@dist_noinst_DATA = $(docbook) $(chapters)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_HTML_FLAGS = \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
-#
-# Generate DocBook/XML output formats with or without stylesheets
-#
-
-# Stylesheets are available if the package xorg-sgml-doctools is installed
-
-# The location where all cross reference databases are installed
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FLAGS = \
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam current.docid="$(<:.xml=)"
-
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_XHTML_FLAGS = \
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -m $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
-
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FO_FLAGS = \
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -m $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FO_FLAGS = \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(XORG_SGML_PATH)/X11" \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --searchpath "$(abs_top_builddir)" \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam img.src.path=$(abs_builddir)/ \
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@CLEANFILES = $(noinst_DATA)
all: all-am
@@ -440,14 +435,14 @@ uninstall-am:
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters)
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters)
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters)
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters)
-@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(chapters)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(chapters)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(chapters)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@%.ps: %.xml $(chapters)
+@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
# Generate DocBook/XML output formats with or without stylesheets
diff --git a/libXfont/doc/fontlib.xml b/libXfont/doc/fontlib.xml
index cce83e9bd..c5079c884 100644
--- a/libXfont/doc/fontlib.xml
+++ b/libXfont/doc/fontlib.xml
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" >
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+<!ENTITY % defs SYSTEM "defs.ent"> %defs;
+]>
<!-- lifted from troff+ms by doclifter -->
<!-- previous version was in xorg-docs/specs/Xserver/fontlib.ms -->
@@ -15,7 +18,6 @@
<title>
The X Font Library
</title>
- <pubdate>July 27, 1991</pubdate>
<authorgroup>
<author>
<firstname>Keith</firstname>
@@ -32,11 +34,11 @@
</affiliation>
</author>
</authorgroup>
+ <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
+ <copyright><year>1993</year><holder>Network Computing Devices</holder></copyright>
+
<legalnotice>
<para>
- Copyright 1993 <orgname>Network Computing Devices</orgname>
- </para>
- <para>
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby
granted without fee, provided that the above copyright
@@ -50,8 +52,8 @@
any purpose. It is provided &ldquo;as is&rdquo; without
express or implied warranty.
</para>
- <para>
- Copyright 1993, 1994 <orgname>X Consortium</orgname>
+ <para role="multiLicensing">
+ Copyright &copy; 1993, 1994 X Consortium
</para>
<para>
Permission is hereby granted, free of charge, to any person
@@ -80,7 +82,9 @@
promote the sale, use or other dealings in this Software
without prior written authorization from the X Consortium.
</para>
+ <para>X Window System is a trademark of The Open Group.</para>
</legalnotice>
+ <pubdate>July 27, 1991</pubdate>
</articleinfo>
<warning>
@@ -136,10 +140,8 @@
source code, so have a listing handy.
</para>
- <sect1 id='requirements_for_the_font_library'>
- <title>
- Requirements for the Font library
- </title>
+ <sect1 id='Requirements_for_the_Font_library'>
+<title>Requirements for the Font library</title>
<para>
To avoid miles of duplicate code in the X server, the font server
@@ -177,10 +179,8 @@
</sect1>
- <sect1 id='general_font_library_interface_details'>
- <title>
- General Font Library Interface details.
- </title>
+ <sect1 id='General_Font_Library_Interface_details'>
+<title>General Font Library Interface details.</title>
<para>
To avoid collision between the #define name space for errors, the Font
@@ -209,10 +209,8 @@
</sect1>
- <sect1 id='font_path_elements'>
- <title>
- Font Path Elements
- </title>
+ <sect1 id='Font_Path_Elements'>
+<title>Font Path Elements</title>
<para>
At the center of the general font access methods used by X and
@@ -269,9 +267,7 @@ typedef struct _FPEFunctions {
</para>
<sect2 id='name_check'>
- <title>
- (*name_check)
- </title>
+ <title>(*name_check)</title>
<para>
Each new font path member is passed to this function; if
@@ -286,9 +282,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='init_fpe'>
- <title>
- (*init_fpe)
- </title>
+ <title>(*init_fpe)</title>
<para>
Initialize a new font path element. This function prepares
@@ -305,9 +299,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='reset_fpe'>
- <title>
- (*reset_fpe)
- </title>
+ <title>(*reset_fpe)</title>
<para>
When the X font path is reset, and some of the new members
@@ -324,9 +316,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='free_fpe'>
- <title>
- (*free_fpe)
- </title>
+ <title>(*free_fpe)</title>
<para>
When the server is finished with an FPE, this function is
@@ -337,9 +327,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='open_font'>
- <title>
- (*open_font)
- </title>
+ <title>(*open_font)</title>
<para>
This routine requests that a font be opened. The <parameter
@@ -375,9 +363,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='close_font'>
- <title>
- (*close_font)
- </title>
+ <title>(*close_font)</title>
<para>
When the server is finished with a font, this routine
@@ -387,9 +373,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='list_fonts'>
- <title>
- (*list_fonts)
- </title>
+ <title>(*list_fonts)</title>
<para>
The <parameter class='function'>paths</parameter> argument is
@@ -402,9 +386,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='start_list_fonts_with_info'>
- <title>
- (*start_list_fonts_with_info)
- </title>
+ <title>(*start_list_fonts_with_info)</title>
<para>
This routine sets any internal state for a verbose listing of
@@ -414,9 +396,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='list_next_font_with_info'>
- <title>
- (*list_next_font_with_info)
- </title>
+ <title>(*list_next_font_with_info)</title>
<para>
To avoid storing huge amounts of data, the interface for
@@ -442,9 +422,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='wakeup_fpe'>
- <title>
- (*wakeup_fpe)
- </title>
+ <title>(*wakeup_fpe)</title>
<para>
Whenever an FPE function has returned
@@ -458,9 +436,7 @@ typedef struct _FPEFunctions {
</sect2>
<sect2 id='client_died'>
- <title>
- (*client_died)
- </title>
+ <title>(*client_died)</title>
<para>
When an FPE function has returned <errorname>Suspended</errorname>
@@ -471,10 +447,8 @@ typedef struct _FPEFunctions {
</sect2>
</sect1>
- <sect1 id='fonts'>
- <title>
- Fonts
- </title>
+ <sect1 id='Fonts'>
+<title>Fonts</title>
<para>
The data structure which actually contains the font information has
@@ -576,9 +550,7 @@ typedef struct _Font {
</para>
<sect2 id='get_glyphs'>
- <title>
- (*get_glyphs)
- </title>
+ <title>(*get_glyphs)</title>
<para>
This routine returns <structname>CharInfoPtrs</structname>
@@ -592,9 +564,7 @@ typedef struct _Font {
</sect2>
<sect2 id='get_metrics'>
- <title>
- (*get_metrics)
- </title>
+ <title>(*get_metrics)</title>
<para>
This is similar to <structfield>(*get_glyphs)</structfield>
@@ -604,10 +574,8 @@ typedef struct _Font {
</para>
</sect2>
- <sect2 id='getbitmaps'>
- <title>
- (*get_bitmaps)
- </title>
+ <sect2 id='get_bitmaps'>
+<title>(*get_bitmaps)</title>
<para>
This packs the glyph image data in the requested
@@ -618,9 +586,7 @@ typedef struct _Font {
</sect2>
<sect2 id='get_extents'>
- <title>
- (*get_extents)
- </title>
+ <title>(*get_extents)</title>
<para>
This returns the metrics for the specified font from the
@@ -630,9 +596,7 @@ typedef struct _Font {
</sect2>
<sect2 id='unload_font'>
- <title>
- (*unload_font)
- </title>
+ <title>(*unload_font)</title>
<para>
This is called from the FPE routine
@@ -641,10 +605,8 @@ typedef struct _Font {
</para>
</sect2>
- <sect2 id='maxprivate'>
- <title>
- maxPrivate
- </title>
+ <sect2 id='maxPrivate'>
+<title>maxPrivate</title>
<para>
When initializing a new font structure,
diff --git a/libXfont/src/FreeType/Makefile.in b/libXfont/src/FreeType/Makefile.in
index 5682616bb..21b05b46c 100644
--- a/libXfont/src/FreeType/Makefile.in
+++ b/libXfont/src/FreeType/Makefile.in
@@ -95,6 +95,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/FreeType/ftenc.c b/libXfont/src/FreeType/ftenc.c
index 99defbed6..9e31d7529 100644
--- a/libXfont/src/FreeType/ftenc.c
+++ b/libXfont/src/FreeType/ftenc.c
@@ -1,15 +1,15 @@
-/*
+/*
Copyright (c) 1998-2003 by Juliusz Chroboczek
-
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
+furnished to do so, subject to the following conditions:
+
The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@@ -43,13 +43,13 @@ THE SOFTWARE.
static int find_cmap(int, int, int, FT_Face, FT_CharMap *);
static int
-FTEncFontSpecific(char *encoding)
+FTEncFontSpecific(const char *encoding)
{
- char *p = encoding;
+ const char *p = encoding;
if(strcasecmp(encoding, "microsoft-symbol") == 0)
return 1;
-
+
while(*p != '-') {
if(*p == '\0')
return 0;
@@ -69,7 +69,7 @@ FTPickMapping(char *xlfd, int length, char *filename, FT_Face face,
int ftrc;
int symbol = 0;
const char *enc, *reg;
- char *encoding_name = 0;
+ const char *encoding_name = 0;
char buf[20];
if(xlfd)
@@ -123,9 +123,9 @@ FTPickMapping(char *xlfd, int length, char *filename, FT_Face face,
}
}
}
-
+
for(mapping = encoding->mappings; mapping; mapping = mapping->next) {
- if(find_cmap(mapping->type, mapping->pid, mapping->eid, face,
+ if(find_cmap(mapping->type, mapping->pid, mapping->eid, face,
&cmap)) {
tm->named = 0;
tm->cmap = cmap;
@@ -144,7 +144,7 @@ FTPickMapping(char *xlfd, int length, char *filename, FT_Face face,
return Successful;
}
}
-
+
return BadFontFormat;
native:
@@ -155,7 +155,7 @@ FTPickMapping(char *xlfd, int length, char *filename, FT_Face face,
return Successful;
}
-static int
+static int
find_cmap(int type, int pid, int eid, FT_Face face, FT_CharMap *cmap_return)
{
int i, n;
@@ -177,7 +177,7 @@ find_cmap(int type, int pid, int eid, FT_Face face, FT_CharMap *cmap_return)
/* prefer Microsoft Unicode */
for(i=0; i<n; i++) {
cmap = face->charmaps[i];
- if(cmap->platform_id == TT_PLATFORM_MICROSOFT &&
+ if(cmap->platform_id == TT_PLATFORM_MICROSOFT &&
cmap->encoding_id == TT_MS_ID_UNICODE_CS) {
*cmap_return = cmap;
return 1;
@@ -207,7 +207,7 @@ find_cmap(int type, int pid, int eid, FT_Face face, FT_CharMap *cmap_return)
return 0;
}
-unsigned
+unsigned
FTRemap(FT_Face face, FTMappingPtr tm, unsigned code)
{
unsigned index;
diff --git a/libXfont/src/FreeType/ftfuncs.c b/libXfont/src/FreeType/ftfuncs.c
index fd8e53e5f..918e3f37e 100644
--- a/libXfont/src/FreeType/ftfuncs.c
+++ b/libXfont/src/FreeType/ftfuncs.c
@@ -48,7 +48,7 @@ THE SOFTWARE.
#include FT_BBOX_H
#include FT_TRUETYPE_TAGS_H
/*
- * If you want to use FT_Outline_Get_CBox instead of
+ * If you want to use FT_Outline_Get_CBox instead of
* FT_Outline_Get_BBox, define here.
*/
/* #define USE_GET_CBOX */
@@ -94,7 +94,7 @@ static CharInfoRec noSuchChar = { /* metrics */{0,0,0,0,0,0},
/* The propery names for all the XLFD properties. */
-static char *xlfd_props[] = {
+static const char *xlfd_props[] = {
"FOUNDRY",
"FAMILY_NAME",
"WEIGHT_NAME",
@@ -122,7 +122,7 @@ sfnt_get_ushort( FT_Face face,
FT_ULong len = sizeof(buff);
FT_UShort result = 0;
- if ( !FT_Load_Sfnt_Table( face, table_tag, table_offset, buff, &len ) );
+ if ( !FT_Load_Sfnt_Table( face, table_tag, table_offset, buff, &len ) )
result = (FT_UShort)( (buff[0] << 8) | buff[1] );
return result;
@@ -160,7 +160,7 @@ iceil(int x, int y)
{
return ifloor(x + y - 1, y);
}
-
+
static int
FreeTypeOpenFace(FTFacePtr *facep, char *FTFileName, char *realFileName, int faceNumber)
{
@@ -267,7 +267,7 @@ TransEqual(FTNormalisedTransformationPtr t1, FTNormalisedTransformationPtr t2)
else if(t1->nonIdentity != t2->nonIdentity)
return 0;
else if(t1->nonIdentity && t2->nonIdentity) {
- return
+ return
t1->matrix.xx == t2->matrix.xx &&
t1->matrix.yx == t2->matrix.yx &&
t1->matrix.yy == t2->matrix.yy &&
@@ -300,7 +300,7 @@ TTCapEqual(struct TTCapInfo *t1, struct TTCapInfo *t2)
t1->flags == t2->flags &&
t1->scaleBitmap == t2->scaleBitmap &&
/*
- If we use forceConstantSpacing,
+ If we use forceConstantSpacing,
we *MUST* allocate new instance.
*/
t1->forceConstantSpacingEnd < 0 &&
@@ -311,7 +311,7 @@ static int
FTInstanceMatch(FTInstancePtr instance,
char *FTFileName, FTNormalisedTransformationPtr trans,
int spacing, FontBitmapFormatPtr bmfmt,
- struct TTCapInfo *tmp_ttcap, FT_Int32 load_flags)
+ struct TTCapInfo *tmp_ttcap, FT_Int32 load_flags)
{
if(strcmp(instance->face->filename, FTFileName) != 0) {
return 0;
@@ -347,7 +347,7 @@ FreeTypeActivateInstance(FTInstancePtr instance)
instance->transformation.nonIdentity ?
&instance->transformation.matrix : 0,
0);
-
+
instance->face->active_instance = instance;
return Successful;
}
@@ -377,7 +377,7 @@ FTFindSize(FT_Face face, FTNormalisedTransformationPtr trans,
j = i;
d = dd;
}
- }
+ }
}
if(j < 0)
return BadFontName;
@@ -530,7 +530,7 @@ FreeTypeOpenInstance(FTInstancePtr *instance_return, FTFacePtr face,
/* maintain a linked list of instances */
instance->next = instance->face->instances;
instance->face->instances = instance;
-
+
*instance_return = instance;
return Successful;
}
@@ -547,7 +547,7 @@ FreeTypeFreeInstance(FTInstancePtr instance)
instance->refcount--;
if(instance->refcount <= 0) {
int i,j;
-
+
if(instance->face->instances == instance)
instance->face->instances = instance->next;
else {
@@ -573,7 +573,7 @@ FreeTypeFreeInstance(FTInstancePtr instance)
for(i = 0; i < iceil(instance->nglyphs, FONTSEGMENTSIZE); i++) {
if(instance->glyphs[i]) {
for(j = 0; j < FONTSEGMENTSIZE; j++) {
- if(instance->available[i][j] ==
+ if(instance->available[i][j] ==
FT_AVAILABLE_RASTERISED)
free(instance->glyphs[i][j].bits);
}
@@ -610,7 +610,7 @@ FreeTypeInstanceFindGlyph(unsigned idx_in, int flags, FTInstancePtr instance,
*found = 0;
return Successful;
}
-
+
if(*available == NULL) {
*available = calloc(iceil(instance->nglyphs, FONTSEGMENTSIZE),
sizeof(int *));
@@ -653,7 +653,7 @@ FreeTypeInstanceGetGlyph(unsigned idx, int flags, CharInfoPtr *g, FTInstancePtr
int xrc;
int ***available;
CharInfoPtr **glyphs;
-
+
available = &instance->available;
glyphs = &instance->glyphs;
@@ -665,17 +665,17 @@ FreeTypeInstanceGetGlyph(unsigned idx, int flags, CharInfoPtr *g, FTInstancePtr
if(!found || (*available)[segment][offset] == FT_AVAILABLE_NO) {
*g = NULL;
return Successful;
- }
+ }
if((*available)[segment][offset] == FT_AVAILABLE_RASTERISED) {
*g = &(*glyphs)[segment][offset];
return Successful;
}
-
+
flags |= FT_GET_GLYPH_BOTH;
- xrc = FreeTypeRasteriseGlyph(idx, flags,
- &(*glyphs)[segment][offset], instance,
+ xrc = FreeTypeRasteriseGlyph(idx, flags,
+ &(*glyphs)[segment][offset], instance,
(*available)[segment][offset] >= FT_AVAILABLE_METRICS);
if(xrc != Successful && (*available)[segment][offset] >= FT_AVAILABLE_METRICS) {
ErrorF("Warning: FreeTypeRasteriseGlyph() returns an error,\n");
@@ -698,7 +698,7 @@ FreeTypeInstanceGetGlyphMetrics(unsigned idx, int flags,
{
int xrc;
int found, segment, offset;
-
+
/* Char cell */
if(instance->spacing == FT_CHARCELL) {
*metrics = instance->charcellMetrics;
@@ -712,8 +712,8 @@ FreeTypeInstanceGetGlyphMetrics(unsigned idx, int flags,
/* Not char cell */
- xrc = FreeTypeInstanceFindGlyph(idx, flags, instance,
- &instance->glyphs, &instance->available,
+ xrc = FreeTypeInstanceFindGlyph(idx, flags, instance,
+ &instance->glyphs, &instance->available,
&found, &segment, &offset);
if(xrc != Successful)
return xrc;
@@ -724,16 +724,16 @@ FreeTypeInstanceGetGlyphMetrics(unsigned idx, int flags,
if( instance->available[segment][offset] == FT_AVAILABLE_NO ) {
*metrics = NULL;
return Successful;
- }
+ }
if( instance->available[segment][offset] >= FT_AVAILABLE_METRICS ) {
*metrics = &instance->glyphs[segment][offset].metrics;
return Successful;
}
-
+
flags |= FT_GET_GLYPH_METRICS_ONLY;
- xrc = FreeTypeRasteriseGlyph(idx, flags,
+ xrc = FreeTypeRasteriseGlyph(idx, flags,
&instance->glyphs[segment][offset],
instance, 0);
if(xrc == Successful) {
@@ -742,7 +742,7 @@ FreeTypeInstanceGetGlyphMetrics(unsigned idx, int flags,
}
return xrc;
}
-
+
/*
* Pseudo enbolding similar as Microsoft Windows.
* It is useful but poor.
@@ -796,7 +796,7 @@ ft_make_up_italic_bitmap( char *raster, int bpr, int ht, int shift,
tmp_shift %= 8;
if ( tmp_shift ) {
for (x=bpr-1;0<=x;x--) {
- if ( x != bpr-1 )
+ if ( x != bpr-1 )
tmp_p[x+1] |= tmp_p[x]<<(8-tmp_shift);
tmp_p[x]>>=tmp_shift;
}
@@ -814,7 +814,7 @@ ft_make_up_italic_bitmap( char *raster, int bpr, int ht, int shift,
tmp_shift %= 8;
if ( tmp_shift ) {
for (x=0;x<bpr;x++) {
- if ( x != 0 )
+ if ( x != 0 )
tmp_p[x-1] |= tmp_p[x]>>(8-tmp_shift);
tmp_p[x]<<=tmp_shift;
}
@@ -892,7 +892,7 @@ tt_get_metrics( FT_Face face,
}
}
-static int
+static int
ft_get_very_lazy_bbox( FT_UInt index,
FT_Face face,
FT_Size size,
@@ -1049,7 +1049,7 @@ FT_Do_SBit_Metrics( FT_Face ft_face, FT_Size ft_size, FT_ULong strike_index,
metrics_return->horiBearingX = (FT_Pos)elem_metrics.horiBearingX << 6;
metrics_return->horiBearingY = (FT_Pos)elem_metrics.horiBearingY << 6;
metrics_return->horiAdvance = (FT_Pos)elem_metrics.horiAdvance << 6;
-
+
metrics_return->vertBearingX = (FT_Pos)elem_metrics.vertBearingX << 6;
metrics_return->vertBearingY = (FT_Pos)elem_metrics.vertBearingY << 6;
metrics_return->vertAdvance = (FT_Pos)elem_metrics.vertAdvance << 6;
@@ -1100,12 +1100,12 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
if(!hasMetrics) {
if( instance->spacing == FT_CHARCELL || flags & FT_GET_DUMMY ){
- memcpy((char*)&tgp->metrics,
+ memcpy((char*)&tgp->metrics,
(char*)instance->charcellMetrics,
sizeof(xCharInfo));
}
else if( flags & FT_FORCE_CONSTANT_SPACING ) {
- memcpy((char*)&tgp->metrics,
+ memcpy((char*)&tgp->metrics,
(char*)instance->forceConstantMetrics,
sizeof(xCharInfo));
}
@@ -1123,16 +1123,16 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
}
if( bitmap_metrics == NULL ) {
if ( sbitchk_incomplete_but_exist==0 && (instance->ttcap.flags & TTCAP_IS_VERY_LAZY) ) {
- if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
+ if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
face->num_hmetrics,
instance->ttcap.vl_slant,
&instance->transformation.matrix,
- &bbox, &outline_hori_advance,
+ &bbox, &outline_hori_advance,
&outline_vert_advance ) == 0 ) {
goto bbox_ok; /* skip exact calculation */
}
}
- ftrc = FT_Load_Glyph(instance->face->face, idx,
+ ftrc = FT_Load_Glyph(instance->face->face, idx,
instance->load_flags);
if(ftrc != 0) return FTtoXReturnCode(ftrc);
metrics = &face->face->glyph->metrics;
@@ -1143,11 +1143,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
if( bitmap_metrics ) {
FT_Pos factor;
-
+
leftSideBearing = bitmap_metrics->horiBearingX / 64;
rightSideBearing = (bitmap_metrics->width + bitmap_metrics->horiBearingX) / 64;
bbox_center_raw = (2.0 * bitmap_metrics->horiBearingX + bitmap_metrics->width)/2.0/64.0;
- characterWidth = (int)floor(bitmap_metrics->horiAdvance
+ characterWidth = (int)floor(bitmap_metrics->horiAdvance
* instance->ttcap.scaleBBoxWidth / 64.0 + .5);
ascent = bitmap_metrics->horiBearingY / 64;
descent = (bitmap_metrics->height - bitmap_metrics->horiBearingY) / 64 ;
@@ -1192,11 +1192,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
bbox_center_raw = (double)(bbox.xMax + bbox.xMin)/2.0/64.;
if ( instance->pixel_width_unit_x != 0 )
characterWidth =
- (int)floor( outline_hori_advance
+ (int)floor( outline_hori_advance
* instance->ttcap.scaleBBoxWidth
* instance->pixel_width_unit_x / 64. + .5);
else {
- characterWidth =
+ characterWidth =
(int)floor( outline_vert_advance
* instance->ttcap.scaleBBoxHeight
* instance->pixel_width_unit_y / 64. + .5);
@@ -1212,12 +1212,12 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
characterWidth = new_width;
if ( instance->pixel_width_unit_x != 0 )
rawCharacterWidth =
- (unsigned short)(short)(floor(1000 * outline_hori_advance
+ (unsigned short)(short)(floor(1000 * outline_hori_advance
* instance->ttcap.scaleBBoxWidth * ratio
* instance->pixel_width_unit_x / 64.));
else {
rawCharacterWidth =
- (unsigned short)(short)(floor(1000 * outline_vert_advance
+ (unsigned short)(short)(floor(1000 * outline_vert_advance
* instance->ttcap.scaleBBoxHeight * ratio
* instance->pixel_width_unit_y / 64.));
if(rawCharacterWidth <= 0)
@@ -1281,7 +1281,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
if( flags & FT_GET_DUMMY ) is_outline = -1;
else {
if( !metrics ) {
- ftrc = FT_Load_Glyph(instance->face->face, idx,
+ ftrc = FT_Load_Glyph(instance->face->face, idx,
instance->load_flags);
metrics = &face->face->glyph->metrics;
@@ -1299,7 +1299,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
bbox.yMin = FLOOR64( bbox.yMin );
bbox.yMax = CEIL64 ( bbox.yMax );
ht_actual = ( bbox.yMax - bbox.yMin ) >> 6;
- /* FreeType think a glyph with 0 height control box is invalid.
+ /* FreeType think a glyph with 0 height control box is invalid.
* So just let X to create a empty bitmap instead. */
if ( ht_actual == 0 )
is_outline = -1;
@@ -1319,11 +1319,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
if( (instance->ttcap.flags & TTCAP_MONO_CENTER) && hasMetrics ) {
if( is_outline == 1 ){
if( correct ){
- if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
+ if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
face->num_hmetrics,
instance->ttcap.vl_slant,
&instance->transformation.matrix,
- &bbox, &outline_hori_advance,
+ &bbox, &outline_hori_advance,
&outline_vert_advance ) != 0 ){
is_outline = -1; /* <- error */
}
@@ -1357,10 +1357,10 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
if(ht_actual <= 0) ht = 1;
else ht=ht_actual;
- bpr = (((wd + (instance->bmfmt.glyph<<3) - 1) >> 3) &
+ bpr = (((wd + (instance->bmfmt.glyph<<3) - 1) >> 3) &
-instance->bmfmt.glyph);
raster = calloc(1, ht * bpr);
- if(raster == NULL)
+ if(raster == NULL)
return AllocError;
tgp->bits = raster;
@@ -1483,7 +1483,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
if ( is_outline == 0 &&
( instance->ttcap.lsbShiftOfBitmapAutoItalic != 0 ||
instance->ttcap.rsbShiftOfBitmapAutoItalic != 0 ) ) {
- ft_make_up_italic_bitmap( raster, bpr, ht,
+ ft_make_up_italic_bitmap( raster, bpr, ht,
- instance->ttcap.lsbShiftOfBitmapAutoItalic
+ instance->ttcap.rsbShiftOfBitmapAutoItalic,
instance->charcellMetrics->ascent
@@ -1492,11 +1492,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp,
- tgp->metrics.ascent,
instance->ttcap.autoItalic);
}
-
+
if(instance->bmfmt.bit == LSBFirst) {
BitOrderInvert((unsigned char*)(tgp->bits), ht*bpr);
}
-
+
if(instance->bmfmt.byte != instance->bmfmt.bit) {
switch(instance->bmfmt.scan) {
case 1:
@@ -1532,7 +1532,7 @@ static void
FreeTypeFreeXFont(FontPtr pFont, int freeProps)
{
FTFontPtr tf;
-
+
if(pFont) {
if((tf = (FTFontPtr)pFont->fontPrivate)) {
FreeTypeFreeFont(tf);
@@ -1562,7 +1562,7 @@ FreeTypeUnloadXFont(FontPtr pFont)
used by Xaw. */
static int
-FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
+FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
char *fontname, int rawAverageWidth, Bool font_properties)
{
int i, j, maxprops;
@@ -1600,7 +1600,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
}
info->nprops = 0; /* in case we abort */
-
+
strcpy(val, fontname);
if(FontParseXLFDName(val, vals, FONT_XLFD_REPLACE_VALUE)) {
xlfdProps = 1;
@@ -1618,11 +1618,11 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
( (font_properties && os2) ? 6 : 0 ) +
( (font_properties && (post || t1info)) ? 3 : 0 ) +
2; /* type */
-
+
info->props = malloc(maxprops * sizeof(FontPropRec));
if(info->props == NULL)
return AllocError;
-
+
info->isStringProp = malloc(maxprops);
if(info->isStringProp == NULL) {
free(info->props);
@@ -1646,18 +1646,18 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
for (ep = sp; *ep && *ep != '['; ep++);
else
for (ep = sp; *ep && *ep != '-'; ep++);
-
+
info->props[i].name =
MakeAtom(xlfd_props[j], strlen(xlfd_props[j]), TRUE);
-
+
switch(j) {
case 6: /* pixel size */
- info->props[i].value =
+ info->props[i].value =
(int)(fabs(vals->pixel_matrix[3]) + 0.5);
i++;
break;
case 7: /* point size */
- info->props[i].value =
+ info->props[i].value =
(int)(fabs(vals->point_matrix[3])*10.0 + 0.5);
i++;
break;
@@ -1704,7 +1704,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
if(!face->bitmap) {
info->props[i].name = MakeAtom("RAW_ASCENT", 10, TRUE);
- info->props[i].value =
+ info->props[i].value =
((double)face->face->ascender/(double)upm*1000.0);
i++;
}
@@ -1717,7 +1717,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
if(!face->bitmap) {
info->props[i].name = MakeAtom("RAW_DESCENT", 11, TRUE);
- info->props[i].value =
+ info->props[i].value =
-((double)face->face->descender/(double)upm*1000.0);
i++;
}
@@ -1737,7 +1737,7 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
info->isStringProp[i] = 1;
i++;
}
-
+
j = FTGetEnglishName(face->face, TT_NAME_ID_FULL_NAME,
val, MAXFONTNAMELEN);
vp = val;
@@ -1790,30 +1790,30 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
/* In what follows, we assume the matrix is diagonal. In the rare
case when it is not, the values will be somewhat wrong. */
-
+
if( font_properties && os2 ) {
info->props[i].name = MakeAtom("SUBSCRIPT_SIZE",14,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySubscriptYSize);
i++;
info->props[i].name = MakeAtom("SUBSCRIPT_X",11,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_X(os2->ySubscriptXOffset);
i++;
info->props[i].name = MakeAtom("SUBSCRIPT_Y",11,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySubscriptYOffset);
i++;
info->props[i].name = MakeAtom("SUPERSCRIPT_SIZE",16,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySuperscriptYSize);
i++;
info->props[i].name = MakeAtom("SUPERSCRIPT_X",13,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_X(os2->ySuperscriptXOffset);
i++;
info->props[i].name = MakeAtom("SUPERSCRIPT_Y",13,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySuperscriptYOffset);
i++;
}
@@ -1821,15 +1821,15 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
if( font_properties && (post || t1info) ) {
int underlinePosition, underlineThickness;
- /* Raw underlineposition counts upwards,
+ /* Raw underlineposition counts upwards,
but UNDERLINE_POSITION counts downwards. */
if(post) {
underlinePosition = TRANSFORM_FUNITS_Y(-post->underlinePosition);
underlineThickness = TRANSFORM_FUNITS_Y(post->underlineThickness);
} else {
- underlinePosition =
+ underlinePosition =
TRANSFORM_FUNITS_Y(-t1info->underline_position);
- underlineThickness =
+ underlineThickness =
TRANSFORM_FUNITS_Y(t1info->underline_thickness);
}
if(underlineThickness <= 0)
@@ -1848,8 +1848,8 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
/* The italic angle is often unreliable for Type 1 fonts */
if(post && trans->matrix.xx == trans->matrix.yy) {
info->props[i].name = MakeAtom("ITALIC_ANGLE",12,TRUE);
- info->props[i].value =
- /* Convert from TT_Fixed to
+ info->props[i].value =
+ /* Convert from TT_Fixed to
64th of a degree counterclockwise from 3 o'clock */
90*64+(post->italicAngle >> 10);
i++;
@@ -1863,12 +1863,12 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
info->props[i].value = MakeAtom(vp, strlen(vp), TRUE);
info->isStringProp[i] = 1;
i++;
-
+
info->props[i].name = MakeAtom("RASTERIZER_NAME", 15, TRUE);
info->props[i].value = MakeAtom("FreeType", 10, TRUE);
info->isStringProp[i] = 1;
i++;
-
+
info->nprops = i;
return Successful;
}
@@ -1876,20 +1876,20 @@ FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
static int
ft_get_index(unsigned code, FTFontPtr font, unsigned *idx)
{
-
+
/* As a special case, we pass 0 even when it is not in the ranges;
this will allow for the default glyph, which should exist in any
TrueType font. */
-
+
/* This is not required...
if(code > 0 && font->nranges) {
int i;
for(i = 0; i < font->nranges; i++)
- if((code >=
+ if((code >=
font->ranges[i].min_char_low+
(font->ranges[i].min_char_high<<8)) &&
(code <=
- font->ranges[i].max_char_low +
+ font->ranges[i].max_char_low +
(font->ranges[i].max_char_high<<8)))
break;
if(i == font->nranges) {
@@ -1911,7 +1911,7 @@ ft_get_index(unsigned code, FTFontPtr font, unsigned *idx)
}
*idx = FTRemap(font->instance->face->face, &font->mapping, code);
-
+
return 0;
}
@@ -1920,7 +1920,7 @@ FreeTypeFontGetGlyph(unsigned code, int flags, CharInfoPtr *g, FTFontPtr font)
{
unsigned idx = 0;
int xrc;
-
+
#ifdef X_ACCEPTS_NO_SUCH_CHAR
if( ft_get_index(code,font,&idx) || idx == 0 || idx == font->zero_idx ) {
*g = NULL;
@@ -1972,7 +1972,7 @@ FreeTypeFontGetGlyphMetrics(unsigned code, int flags, xCharInfo **metrics, FTFon
if( xrc == Successful && *metrics != NULL )
return Successful;
if( font->zero_idx != idx ) {
- xrc = FreeTypeInstanceGetGlyphMetrics(font->zero_idx, flags,
+ xrc = FreeTypeInstanceGetGlyphMetrics(font->zero_idx, flags,
metrics, font->instance);
if( xrc == Successful && *metrics != NULL )
return Successful;
@@ -2156,7 +2156,7 @@ restrict_code_range_by_str(int count,unsigned short *refFirstCol,
}
/* *face_number and *spacing are initialized but *load_flags is NOT. */
-static int
+static int
FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
char **dynStrRealFileName, char **dynStrFTFileName,
struct TTCapInfo *ret, int *face_number, FT_Int32 *load_flags,
@@ -2185,7 +2185,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
{
/* font cap */
char *p1=NULL, *p2=NULL;
-
+
p1=strrchr(fileName, '/');
if ( p1 == NULL ) p1 = fileName;
else p1++;
@@ -2193,7 +2193,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
/* colon exist in the right side of slash. */
int dirLen = p1-fileName;
int baseLen = fileName+len - p2 -1;
-
+
*dynStrRealFileName = malloc(dirLen+baseLen+1);
if( *dynStrRealFileName == NULL ) {
result = AllocError;
@@ -2302,7 +2302,7 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
fprintf(stderr,"[Filename:%s]\n",fileName);
fprintf(stderr,"[RealFilename:%s]\n",*dynStrRealFileName);
fprintf(stderr,"[FTFilename:%s]\n",*dynStrFTFileName);
- */
+ */
/* slant control */
if (SPropRecValList_search_record(&listPropRecVal,
&contRecValue,
@@ -2587,15 +2587,15 @@ FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
semic_ptr=strchr(strMetrics,';');
comma_ptr=strchr(strMetrics,',');
period_ptr=strchr(strMetrics,'.');
- if ( semic_ptr && comma_ptr )
+ if ( semic_ptr && comma_ptr )
if ( semic_ptr < comma_ptr ) comma_ptr=NULL;
- if ( semic_ptr && period_ptr )
+ if ( semic_ptr && period_ptr )
if ( semic_ptr < period_ptr ) period_ptr=NULL;
if ( !comma_ptr && !period_ptr && strMetrics != semic_ptr ) {
if ( restrict_code_range_by_str(1,&first_col, &first_row,
&last_col, &last_row,
SPropContainer_value_str(contRecValue)) == 1 ) {
- ret->force_c_representative_metrics_char_code =
+ ret->force_c_representative_metrics_char_code =
(int)( first_row<<8 | first_col );
}
}
@@ -2688,14 +2688,14 @@ ft_get_trans_from_vals( FontScalablePtr vals, FTNormalisedTransformationPtr tran
{
/* Compute the transformation matrix. We use floating-point
arithmetic for simplicity */
-
+
trans->xres = vals->x;
trans->yres = vals->y;
-
+
/* This value cannot be 0. */
trans->scale = hypot(vals->point_matrix[2], vals->point_matrix[3]);
trans->nonIdentity = 0;
-
+
/* Try to round stuff. We want approximate zeros to be exact zeros,
and if the elements on the diagonal are approximately equal, we
want them equal. We do this to avoid breaking hinting. */
@@ -2710,14 +2710,14 @@ ft_get_trans_from_vals( FontScalablePtr vals, FTNormalisedTransformationPtr tran
((vals->point_matrix[0] + vals->point_matrix[3])/2*
(double)TWO_SIXTEENTH)/trans->scale;
}
-
+
if(DIFFER0(vals->point_matrix[1], trans->scale)) {
trans->matrix.yx =
(int)((vals->point_matrix[1]*(double)TWO_SIXTEENTH)/trans->scale);
trans->nonIdentity = 1;
} else
trans->matrix.yx = 0;
-
+
if(DIFFER0(vals->point_matrix[2], trans->scale)) {
trans->matrix.xy =
(int)((vals->point_matrix[2]*(double)TWO_SIXTEENTH)/trans->scale);
@@ -2749,7 +2749,7 @@ is_fixed_width(FT_Face face)
static int
FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
char *FTFileName, FontScalablePtr vals, FontEntryPtr entry,
- FontBitmapFormatPtr bmfmt, FT_Int32 load_flags,
+ FontBitmapFormatPtr bmfmt, FT_Int32 load_flags,
struct TTCapInfo *tmp_ttcap, char *dynStrTTCapCodeRange,
int ttcap_spacing )
{
@@ -2766,7 +2766,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
if(entry->name.ndashes == 14) {
char *p;
int dashes = 0;
- for(p = entry->name.name;
+ for(p = entry->name.name;
p <= entry->name.name + entry->name.length - 2;
p++) {
if(*p == '-') {
@@ -2800,17 +2800,17 @@ FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
if (xrc != Successful)
return xrc;
} else {
- xrc = FTPickMapping(0, 0, FTFileName,
+ xrc = FTPickMapping(0, 0, FTFileName,
face->face, &font->mapping);
if (xrc != Successful)
return xrc;
}
-
+
font->nranges = vals->nranges;
font->ranges = 0;
if(font->nranges) {
font->ranges = malloc(vals->nranges*sizeof(fsRange));
- if(font->ranges == NULL)
+ if(font->ranges == NULL)
return AllocError;
memcpy((char*)font->ranges, (char*)vals->ranges,
vals->nranges*sizeof(fsRange));
@@ -2820,7 +2820,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
if(info) {
firstCode = 0;
lastCode = 0xFFFFL;
- if(!font->mapping.mapping ||
+ if(!font->mapping.mapping ||
font->mapping.mapping->encoding->row_size == 0) {
/* linear indexing */
lastCode=MIN(lastCode,
@@ -2841,7 +2841,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
info->lastRow = MIN(font->mapping.mapping->encoding->size-1,
lastCode/0x100);
info->firstCol = font->mapping.mapping->encoding->first_col;
- info->lastCol = MIN(font->mapping.mapping->encoding->row_size-1,
+ info->lastCol = MIN(font->mapping.mapping->encoding->row_size-1,
lastCode<0x100?lastCode:0xFF);
if( info->firstRow == 0 && info->firstCol == 0 ) zero_code=0;
}
@@ -2868,7 +2868,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
font->zero_idx = 0;
}
else
- font->zero_idx = FTRemap(face->face,
+ font->zero_idx = FTRemap(face->face,
&font->mapping, zero_code);
post = FT_Get_Sfnt_Table(face->face, ft_sfnt_post);
@@ -2954,7 +2954,7 @@ ft_compute_bounds(FTFontPtr font, FontInfoPtr pinfo, FontScalablePtr vals )
for (row = pinfo->firstRow; row <= pinfo->lastRow; row++) {
if ( skip_ok && tmpchar ) {
if ( !force_c_outside ) {
- if ( instance->ttcap.forceConstantSpacingBegin < row<<8
+ if ( instance->ttcap.forceConstantSpacingBegin < row<<8
&& row<<8 < (instance->ttcap.forceConstantSpacingEnd & 0x0ff00) ) {
if (tmpchar->characterWidth) {
num_chars += num_cols;
@@ -2966,7 +2966,7 @@ ft_compute_bounds(FTFontPtr font, FontInfoPtr pinfo, FontScalablePtr vals )
else skip_ok=0;
}
else { /* for GB18030 proportional */
- if ( instance->ttcap.forceConstantSpacingBegin < row<<8
+ if ( instance->ttcap.forceConstantSpacingBegin < row<<8
|| row<<8 < (instance->ttcap.forceConstantSpacingEnd & 0x0ff00) ) {
if (tmpchar->characterWidth) {
num_chars += num_cols;
@@ -2982,12 +2982,12 @@ ft_compute_bounds(FTFontPtr font, FontInfoPtr pinfo, FontScalablePtr vals )
c = row<<8|col;
flags=0;
if ( !force_c_outside ) {
- if ( c <= instance->ttcap.forceConstantSpacingEnd
+ if ( c <= instance->ttcap.forceConstantSpacingEnd
&& instance->ttcap.forceConstantSpacingBegin <= c )
flags|=FT_FORCE_CONSTANT_SPACING;
}
else { /* for GB18030 proportional */
- if ( c <= instance->ttcap.forceConstantSpacingEnd
+ if ( c <= instance->ttcap.forceConstantSpacingEnd
|| instance->ttcap.forceConstantSpacingBegin <= c )
flags|=FT_FORCE_CONSTANT_SPACING;
}
@@ -3007,13 +3007,13 @@ ft_compute_bounds(FTFontPtr font, FontInfoPtr pinfo, FontScalablePtr vals )
overlap = tmpchar->rightSideBearing - tmpchar->characterWidth;
if (maxOverlap < overlap)
maxOverlap = overlap;
-
+
if (!tmpchar->characterWidth)
continue;
num_chars++;
swidth += ABS(tmpchar->characterWidth);
total_width += tmpchar->characterWidth;
-
+
if ( flags & FT_FORCE_CONSTANT_SPACING ) skip_ok=1;
}
}
@@ -3107,7 +3107,7 @@ is_matrix_unit(FontScalablePtr vals)
m.yx = vals->point_matrix[1] / base_size * 65536;
m.yy = vals->point_matrix[3] / base_size * 65536;
- return (m.xx == 65536) && (m.yx == 0) &&
+ return (m.xx == 65536) && (m.yx == 0) &&
(m.xy == 0) && (m.yy == 65536);
}
@@ -3115,7 +3115,7 @@ is_matrix_unit(FontScalablePtr vals)
/* xf->info is only accessed through info, and xf might be null */
static int
-FreeTypeLoadXFont(char *fileName,
+FreeTypeLoadXFont(char *fileName,
FontScalablePtr vals, FontPtr xf, FontInfoPtr info,
FontBitmapFormatPtr bmfmt, FontEntryPtr entry)
{
@@ -3143,9 +3143,9 @@ FreeTypeLoadXFont(char *fileName,
goto quit;
}
- xrc = FreeTypeSetUpTTCap(fileName, vals,
+ xrc = FreeTypeSetUpTTCap(fileName, vals,
&dynStrRealFileName, &dynStrFTFileName,
- &tmp_ttcap, &face_number,
+ &tmp_ttcap, &face_number,
&load_flags, &ttcap_spacing,
&font_properties, &dynStrTTCapCodeRange);
if ( xrc != Successful ) {
@@ -3187,7 +3187,7 @@ FreeTypeLoadXFont(char *fileName,
}
xrc = FreeTypeLoadFont(font, info, face, dynStrFTFileName, vals, entry, bmfmt,
- load_flags, &tmp_ttcap, dynStrTTCapCodeRange,
+ load_flags, &tmp_ttcap, dynStrTTCapCodeRange,
ttcap_spacing );
if(xrc != Successful) {
goto quit;
@@ -3258,9 +3258,9 @@ FreeTypeLoadXFont(char *fileName,
width_x = max_advance_height * ins_ttcap->scaleBBoxHeight * unit_y;
}
else{
- unit_x = fabs(vals->pixel_matrix[0] -
+ unit_x = fabs(vals->pixel_matrix[0] -
vals->pixel_matrix[1]*vals->pixel_matrix[2]/vals->pixel_matrix[3]);
- unit_y = fabs(vals->pixel_matrix[2] -
+ unit_y = fabs(vals->pixel_matrix[2] -
vals->pixel_matrix[3]*vals->pixel_matrix[0]/vals->pixel_matrix[1]);
width_x = face->face->max_advance_width * ins_ttcap->scaleBBoxWidth * unit_x;
width_y = max_advance_height * ins_ttcap->scaleBBoxHeight * unit_y;
@@ -3346,7 +3346,7 @@ FreeTypeLoadXFont(char *fileName,
force_c_rsb += ins_ttcap->force_c_adjust_rsb_by_pixel;
force_c_lsb += ins_ttcap->force_c_adjust_lsb_by_pixel;
/* apply to rawWidth */
- averageWidth = (int)floor(10 * width_x * scale
+ averageWidth = (int)floor(10 * width_x * scale
* ratio + 0.5);
rawWidth = floor(width_x * scale
* ratio * 1000. / base_height + 0.5);
@@ -3505,7 +3505,7 @@ FreeTypeLoadXFont(char *fileName,
instance->forceConstantMetrics->attributes = force_c_rawWidth;
}
/* Check code 0 */
- if( FreeTypeInstanceGetGlyph(font->zero_idx, FT_FORCE_CONSTANT_SPACING,
+ if( FreeTypeInstanceGetGlyph(font->zero_idx, FT_FORCE_CONSTANT_SPACING,
&tmpglyph, font->instance) != Successful
|| tmpglyph == NULL)
if( FreeTypeInstanceGetGlyph(font->zero_idx, FT_FORCE_CONSTANT_SPACING | FT_GET_DUMMY,
@@ -3541,10 +3541,10 @@ FreeTypeLoadXFont(char *fileName,
if( !charcell ) { /* NOT CHARCELL */
if( info ){
- /*
+ /*
Calculate all glyphs' metrics.
maxbounds.ascent and maxbounds.descent are quite important values
- for XAA. If ascent/descent of each glyph exceeds
+ for XAA. If ascent/descent of each glyph exceeds
maxbounds.ascent/maxbounds.descent, XAA causes SERVER CRASH.
Therefore, THIS MUST BE DONE.
*/
@@ -3558,7 +3558,7 @@ FreeTypeLoadXFont(char *fileName,
*/
vals->width = averageWidth;
-
+
if( info ){
info->maxbounds.leftSideBearing = minLsb;
@@ -3568,7 +3568,7 @@ FreeTypeLoadXFont(char *fileName,
info->maxbounds.descent = descent;
info->maxbounds.attributes =
(unsigned short)(short)rawWidth;
-
+
info->minbounds = info->maxbounds;
}
}
@@ -3584,12 +3584,12 @@ FreeTypeLoadXFont(char *fileName,
info->fontDescent = info->maxbounds.descent;
/* Glyph metrics are accurate */
info->inkMetrics=1;
-
+
memcpy((char *)&info->ink_maxbounds,
(char *)&info->maxbounds, sizeof(xCharInfo));
memcpy((char *)&info->ink_minbounds,
(char *)&info->minbounds, sizeof(xCharInfo));
-
+
/* XXX - hack */
info->defaultCh=0;
@@ -3607,9 +3607,9 @@ FreeTypeLoadXFont(char *fileName,
if(xf)
xf->fontPrivate = (void*)font;
-
+
if(info) {
- xrc = FreeTypeAddProperties(font, vals, info, entry->name.name,
+ xrc = FreeTypeAddProperties(font, vals, info, entry->name.name,
rawAverageWidth, font_properties);
if (xrc != Successful) {
goto quit;
@@ -3650,23 +3650,23 @@ FreeTypeGetMetrics(FontPtr pFont, unsigned long count, unsigned char *chars,
while (count-- > 0) {
switch (charEncoding) {
- case Linear8Bit:
+ case Linear8Bit:
case TwoD8Bit:
code = *chars++;
break;
- case Linear16Bit:
+ case Linear16Bit:
case TwoD16Bit:
code = (*chars++ << 8);
code |= *chars++;
/* */
if ( !(ttcap->flags & TTCAP_FORCE_C_OUTSIDE) ) {
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
&& ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
}
else { /* for GB18030 proportional */
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
|| ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
@@ -3681,7 +3681,7 @@ FreeTypeGetMetrics(FontPtr pFont, unsigned long count, unsigned char *chars,
else *mp++ = &noSuchChar.metrics;
#endif
}
-
+
*metricCount = mp - metrics;
return Successful;
}
@@ -3708,24 +3708,24 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
code = *chars++;
break;
case Linear16Bit: case TwoD16Bit:
- code = *chars++ << 8;
+ code = *chars++ << 8;
code |= *chars++;
/* */
if ( !(ttcap->flags & TTCAP_FORCE_C_OUTSIDE) ) {
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
&& ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
}
else { /* for GB18030 proportional */
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
|| ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
}
break;
}
-
+
if(FreeTypeFontGetGlyph(code, flags, &g, tf) == Successful && g!=NULL) {
*gp++ = g;
}
@@ -3746,7 +3746,7 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
else wd=wd_actual;
if(ht_actual <= 0) ht = 1;
else ht=ht_actual;
- bpr = (((wd + (tf->instance->bmfmt.glyph<<3) - 1) >> 3) &
+ bpr = (((wd + (tf->instance->bmfmt.glyph<<3) - 1) >> 3) &
-tf->instance->bmfmt.glyph);
raster = calloc(1, ht * bpr);
if(raster) {
@@ -3758,13 +3758,13 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
}
#endif
}
-
+
*glyphCount = gp - glyphs;
return Successful;
}
static int
-FreeTypeSetUpFont(FontPathElementPtr fpe, FontPtr xf, FontInfoPtr info,
+FreeTypeSetUpFont(FontPathElementPtr fpe, FontPtr xf, FontInfoPtr info,
fsBitmapFormat format, fsBitmapFormatMask fmask,
FontBitmapFormatPtr bmfmt)
{
@@ -3907,9 +3907,9 @@ static FontRendererRec alt_renderers[] = {
FreeTypeGetInfoScalable, 0, CAPABILITIES},
};
-static int num_alt_renderers =
+static int num_alt_renderers =
sizeof(alt_renderers) / sizeof(alt_renderers[0]);
-
+
void
FreeTypeRegisterFontFileFunctions(void)
diff --git a/libXfont/src/Makefile.in b/libXfont/src/Makefile.in
index 2f3dfdbf9..65b68f7e9 100644
--- a/libXfont/src/Makefile.in
+++ b/libXfont/src/Makefile.in
@@ -15,9 +15,9 @@
@SET_MAKE@
-#
+#
# Copyright © 2003 Keith Packard, Noah Levitt
-#
+#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
@@ -27,7 +27,7 @@
# specific, written prior permission. Keith Packard makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
-#
+#
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -183,6 +183,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/bitmap/Makefile.in b/libXfont/src/bitmap/Makefile.in
index 583e9b1e6..0b88ec1da 100644
--- a/libXfont/src/bitmap/Makefile.in
+++ b/libXfont/src/bitmap/Makefile.in
@@ -97,6 +97,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/bitmap/bdfread.c b/libXfont/src/bitmap/bdfread.c
index 2464c03cc..e2770dc1c 100644
--- a/libXfont/src/bitmap/bdfread.c
+++ b/libXfont/src/bitmap/bdfread.c
@@ -76,7 +76,7 @@ extern int bdfFileLineNum;
/***====================================================================***/
static Bool
-bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
+bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
int glyph, int scan, CARD32 *sizes)
{
int widthBits,
@@ -99,7 +99,7 @@ bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
if (widthBytes * height > 0) {
picture = malloc(widthBytes * height);
if (!picture) {
- bdfError("Couldn't allocate picture (%d*%d)\n", widthBytes, height);
+ bdfError("Couldn't allocate picture (%d*%d)\n", widthBytes, height);
goto BAILOUT;
}
} else
@@ -247,7 +247,7 @@ bdfFreeFontBits(FontPtr pFont)
static Bool
-bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
+bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
int bit, int byte, int glyph, int scan)
{
unsigned char *line;
@@ -291,13 +291,13 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
}
if (nchars > INT32_MAX / sizeof(CharInfoRec)) {
bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
- sizeof(CharInfoRec));
+ (int) sizeof(CharInfoRec));
goto BAILOUT;
}
ci = calloc(nchars, sizeof(CharInfoRec));
if (!ci) {
bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
- sizeof(CharInfoRec));
+ (int) sizeof(CharInfoRec));
goto BAILOUT;
}
bitmapFont->metrics = ci;
@@ -306,7 +306,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bitmapExtra->glyphNames = malloc(nchars * sizeof(Atom));
if (!bitmapExtra->glyphNames) {
bdfError("Couldn't allocate glyphNames (%d*%d)\n",
- nchars, sizeof(Atom));
+ nchars, (int) sizeof(Atom));
goto BAILOUT;
}
}
@@ -314,7 +314,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bitmapExtra->sWidths = malloc(nchars * sizeof(int));
if (!bitmapExtra->sWidths) {
bdfError("Couldn't allocate sWidth (%d *%d)\n",
- nchars, sizeof(int));
+ nchars, (int) sizeof(int));
return FALSE;
}
}
@@ -380,7 +380,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bdfEncoding[char_row] = malloc(256 * sizeof(CharInfoPtr));
if (!bdfEncoding[char_row]) {
bdfError("Couldn't allocate row %d of encoding (%d*%d)\n",
- char_row, INDICES, sizeof(CharInfoPtr));
+ char_row, INDICES, (int) sizeof(CharInfoPtr));
goto BAILOUT;
}
for (i = 0; i < 256; i++)
@@ -490,7 +490,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
if (!bitmapFont->encoding) {
bdfError("Couldn't allocate ppCI (%d,%d)\n",
NUM_SEGMENTS(nencoding),
- sizeof(CharInfoPtr*));
+ (int) sizeof(CharInfoPtr*));
goto BAILOUT;
}
pFont->info.allExist = TRUE;
@@ -515,7 +515,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
if (!bitmapFont->encoding[SEGMENT_MAJOR(i)])
goto BAILOUT;
}
- ACCESSENCODINGL(bitmapFont->encoding,i) =
+ ACCESSENCODINGL(bitmapFont->encoding,i) =
bdfEncoding[char_row][char_col];
}
i++;
@@ -610,14 +610,14 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState)
pFont->info.isStringProp = stringProps;
if (stringProps == NULL) {
bdfError("Couldn't allocate stringProps (%d*%d)\n",
- (nProps + BDF_GENPROPS), sizeof(Bool));
+ (nProps + BDF_GENPROPS), (int) sizeof(Bool));
goto BAILOUT;
}
pFont->info.props = props = calloc(nProps + BDF_GENPROPS,
sizeof(FontPropRec));
if (props == NULL) {
bdfError("Couldn't allocate props (%d*%d)\n", nProps + BDF_GENPROPS,
- sizeof(FontPropRec));
+ (int) sizeof(FontPropRec));
goto BAILOUT;
}
@@ -782,7 +782,7 @@ bdfUnloadFont(FontPtr pFont)
}
int
-bdfReadFont(FontPtr pFont, FontFilePtr file,
+bdfReadFont(FontPtr pFont, FontFilePtr file,
int bit, int byte, int glyph, int scan)
{
bdfFileState state;
@@ -800,7 +800,8 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bitmapFont = calloc(1, sizeof(BitmapFontRec));
if (!bitmapFont) {
- bdfError("Couldn't allocate bitmapFontRec (%d)\n", sizeof(BitmapFontRec));
+ bdfError("Couldn't allocate bitmapFontRec (%d)\n",
+ (int) sizeof(BitmapFontRec));
goto BAILOUT;
}
@@ -813,10 +814,11 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bitmapFont->bitmapExtra = calloc(1, sizeof(BitmapExtraRec));
if (!bitmapFont->bitmapExtra) {
- bdfError("Couldn't allocate bitmapExtra (%d)\n", sizeof(BitmapExtraRec));
+ bdfError("Couldn't allocate bitmapExtra (%d)\n",
+ (int) sizeof(BitmapExtraRec));
goto BAILOUT;
}
-
+
bitmapFont->bitmapExtra->glyphNames = 0;
bitmapFont->bitmapExtra->sWidths = 0;
@@ -836,7 +838,7 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
cols = pFont->info.lastCol - pFont->info.firstCol + 1;
r = r - pFont->info.firstRow;
c = c - pFont->info.firstCol;
- bitmapFont->pDefault = ACCESSENCODING(bitmapFont->encoding,
+ bitmapFont->pDefault = ACCESSENCODING(bitmapFont->encoding,
r * cols + c);
}
}
@@ -859,7 +861,7 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bdfError("Failed to add bitmap ink metrics\n");
goto BAILOUT;
}
- }
+ }
if (bitmapFont->bitmapExtra)
bitmapFont->bitmapExtra->info.inkMetrics = pFont->info.inkMetrics;
@@ -924,7 +926,7 @@ bdfPadToTerminal(FontPtr pFont)
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
- bzero(&new, sizeof(CharInfoRec));
+ bzero(&new, sizeof(CharInfoRec));
new.metrics.ascent = pFont->info.fontAscent;
new.metrics.descent = pFont->info.fontDescent;
new.metrics.leftSideBearing = 0;
diff --git a/libXfont/src/bitmap/bdfutils.c b/libXfont/src/bitmap/bdfutils.c
index 1d6cc7253..288148b36 100644
--- a/libXfont/src/bitmap/bdfutils.c
+++ b/libXfont/src/bitmap/bdfutils.c
@@ -68,7 +68,7 @@ int bdfFileLineNum;
/***====================================================================***/
void
-bdfError(char* message, ...)
+bdfError(const char* message, ...)
{
va_list args;
@@ -81,7 +81,7 @@ bdfError(char* message, ...)
/***====================================================================***/
void
-bdfWarning(char *message, ...)
+bdfWarning(const char *message, ...)
{
va_list args;
@@ -127,7 +127,7 @@ bdfGetLine(FontFilePtr file, unsigned char *buf, int len)
/***====================================================================***/
Atom
-bdfForceMakeAtom(char *str, int *size)
+bdfForceMakeAtom(const char *str, int *size)
{
register int len = strlen(str);
Atom the_atom;
@@ -174,8 +174,9 @@ bdfGetPropertyValue(char *s)
s++;
pp = p = malloc((unsigned) strlen(s) + 1);
if (pp == NULL) {
- bdfError("Couldn't allocate property value string (%d)\n", strlen(s) + 1);
- return None;
+ bdfError("Couldn't allocate property value string (%d)\n",
+ (int) strlen(s) + 1);
+ return None;
}
while (*s) {
if (*s == '"') {
@@ -191,7 +192,7 @@ bdfGetPropertyValue(char *s)
*p++ = *s++;
}
free (pp);
- bdfError("unterminated quoted string property: %s\n", (pointer) orig_s);
+ bdfError("unterminated quoted string property: %s\n", orig_s);
return None;
}
@@ -249,7 +250,7 @@ bdfHexByte(unsigned char *s)
* check for known special property values
*/
-static char *SpecialAtoms[] = {
+static const char *SpecialAtoms[] = {
"FONT_ASCENT",
#define BDF_FONT_ASCENT 0
"FONT_DESCENT",
@@ -276,11 +277,11 @@ static char *SpecialAtoms[] = {
};
Bool
-bdfSpecialProperty(FontPtr pFont, FontPropPtr prop,
+bdfSpecialProperty(FontPtr pFont, FontPropPtr prop,
char isString, bdfFileState *bdfState)
{
- char **special;
- char *name;
+ const char **special;
+ const char *name;
name = NameForAtom(prop->name);
for (special = SpecialAtoms; *special; special++)
diff --git a/libXfont/src/bitmap/bitscale.c b/libXfont/src/bitmap/bitscale.c
index 50818c66e..e89ba7ce0 100644
--- a/libXfont/src/bitmap/bitscale.c
+++ b/libXfont/src/bitmap/bitscale.c
@@ -63,11 +63,11 @@ from The Open Group.
extern unsigned long serverGeneration;
static void bitmapUnloadScalable (FontPtr pFont);
-static void ScaleBitmap ( FontPtr pFont, CharInfoPtr opci,
- CharInfoPtr pci, double *inv_xform,
+static void ScaleBitmap ( FontPtr pFont, CharInfoPtr opci,
+ CharInfoPtr pci, double *inv_xform,
double widthMult, double heightMult );
-static FontPtr BitmapScaleBitmaps(FontPtr pf, FontPtr opf,
- double widthMult, double heightMult,
+static FontPtr BitmapScaleBitmaps(FontPtr pf, FontPtr opf,
+ double widthMult, double heightMult,
FontScalablePtr vals);
enum scaleType {
@@ -78,17 +78,17 @@ enum scaleType {
};
typedef struct _fontProp {
- char *name;
+ const char *name;
Atom atom;
enum scaleType type;
} fontProp;
-static FontEntryPtr FindBestToScale ( FontPathElementPtr fpe,
- FontEntryPtr entry,
- FontScalablePtr vals,
- FontScalablePtr best,
- double *dxp, double *dyp,
- double *sdxp, double *sdyp,
+static FontEntryPtr FindBestToScale ( FontPathElementPtr fpe,
+ FontEntryPtr entry,
+ FontScalablePtr vals,
+ FontScalablePtr best,
+ double *dxp, double *dyp,
+ double *sdxp, double *sdyp,
FontPathElementPtr *fpep );
static unsigned long bitscaleGeneration = 0; /* initialization flag */
@@ -231,8 +231,8 @@ get_matrix_vertical_component(double *matrix)
static Bool
-ComputeScaleFactors(FontScalablePtr from, FontScalablePtr to,
- double *dx, double *dy, double *sdx, double *sdy,
+ComputeScaleFactors(FontScalablePtr from, FontScalablePtr to,
+ double *dx, double *dy, double *sdx, double *sdy,
double *rescale_x)
{
double srcpixelset, destpixelset, srcpixel, destpixel;
@@ -318,10 +318,10 @@ else \
score += (int)(((double)(8 * s)) * m);
static FontEntryPtr
-FindBestToScale(FontPathElementPtr fpe, FontEntryPtr entry,
- FontScalablePtr vals, FontScalablePtr best,
- double *dxp, double *dyp,
- double *sdxp, double *sdyp,
+FindBestToScale(FontPathElementPtr fpe, FontEntryPtr entry,
+ FontScalablePtr vals, FontScalablePtr best,
+ double *dxp, double *dyp,
+ double *sdxp, double *sdyp,
FontPathElementPtr *fpep)
{
FontScalableRec temp;
@@ -425,7 +425,7 @@ FindBestToScale(FontPathElementPtr fpe, FontEntryPtr entry,
((score == best_score) &&
((dy_amount < best_dy_amount) ||
((dy_amount == best_dy_amount) &&
- (dx_amount < best_dx_amount)))))
+ (dx_amount < best_dx_amount)))))
{
best_fpe = FontFileBitmapSources.fpe[source];
best_scaled = scaled;
@@ -525,8 +525,8 @@ doround(double x)
}
static int
-computeProps(FontPropPtr pf, char *wasStringProp,
- FontPropPtr npf, char *isStringProp,
+computeProps(FontPropPtr pf, char *wasStringProp,
+ FontPropPtr npf, char *isStringProp,
unsigned int nprops, double xfactor, double yfactor,
double sXfactor, double sYfactor)
{
@@ -580,13 +580,13 @@ computeProps(FontPropPtr pf, char *wasStringProp,
static int
ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */
char *name, /* name of resulting font */
- FontScalablePtr vals,
+ FontScalablePtr vals,
double dx, double dy, /* scale factors in x and y */
double sdx, double sdy, /* directions */
long sWidth, /* 1000-pixel average width */
- FontPropPtr *pProps, /* returns properties;
+ FontPropPtr *pProps, /* returns properties;
preallocated */
- char **pIsStringProp) /* return booleans;
+ char **pIsStringProp) /* return booleans;
preallocated */
{
int n;
@@ -692,8 +692,8 @@ ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */
static int
-compute_xform_matrix(FontScalablePtr vals, double dx, double dy,
- double *xform, double *inv_xform,
+compute_xform_matrix(FontScalablePtr vals, double dx, double dy,
+ double *xform, double *inv_xform,
double *xmult, double *ymult)
{
double det;
@@ -752,17 +752,17 @@ compute_xform_matrix(FontScalablePtr vals, double dx, double dy,
* returns a pointer to the new scaled font, or NULL (due to AllocError).
*/
static FontPtr
-ScaleFont(FontPtr opf, /* originating font */
- double widthMult, /* glyphs width scale factor */
- double heightMult, /* glyphs height scale factor */
- double sWidthMult, /* scalable glyphs width scale factor */
- double sHeightMult, /* scalable glyphs height scale factor */
- FontScalablePtr vals,
- double *newWidthMult, /* return: X component of glyphs width
- scale factor */
- double *newHeightMult, /* return: Y component of glyphs height
- scale factor */
- long *sWidth) /* return: average 1000-pixel width */
+ScaleFont(FontPtr opf, /* originating font */
+ double widthMult, /* glyphs width scale factor */
+ double heightMult, /* glyphs height scale factor */
+ double sWidthMult, /* scalable glyphs width scale factor */
+ double sHeightMult, /* scalable glyphs height scale factor */
+ FontScalablePtr vals,
+ double *newWidthMult, /* return: X component of glyphs width
+ scale factor */
+ double *newHeightMult, /* return: Y component of glyphs height
+ scale factor */
+ long *sWidth) /* return: average 1000-pixel width */
{
FontPtr pf;
FontInfoPtr pfi,
@@ -1015,7 +1015,7 @@ ScaleFont(FontPtr opf, /* originating font */
if (pci->metrics.ascent == -pci->metrics.descent)
pci->metrics.ascent++;
}
-
+
pci++;
}
}
@@ -1039,7 +1039,7 @@ ScaleFont(FontPtr opf, /* originating font */
pfi->minbounds.field = pci->metrics.field; \
if (pfi->maxbounds.field < pci->metrics.field) \
pfi->maxbounds.field = pci->metrics.field
-
+
MINMAX(leftSideBearing);
MINMAX(rightSideBearing);
MINMAX(ascent);
@@ -1093,7 +1093,7 @@ ScaleFont(FontPtr opf, /* originating font */
cols = pfi->lastCol - pfi->firstCol + 1;
r = r - pfi->firstRow;
c = c - pfi->firstCol;
- bitmapFont->pDefault =
+ bitmapFont->pDefault =
ACCESSENCODING(bitmapFont->encoding, r * cols + c);
}
}
@@ -1117,7 +1117,7 @@ bail:
}
static void
-ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci,
+ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci,
double *inv_xform, double widthMult, double heightMult)
{
register char *bitmap, /* The bits */
@@ -1394,7 +1394,7 @@ ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci,
{
register int x = xValue >> 16, y = yValue >> 16;
int pixvalue, error;
-
+
pixvalue = ((x >= 0 && x < width && y >= 0 && y < height) ?
char_grayscale[x + y * (width + 1)] : 0) +
thisrow[col] / 16;
@@ -1436,7 +1436,7 @@ ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci,
for (col = 0; col < newWidth; col++)
{
register int x = xValue >> 16, y = yValue >> 16;
-
+
if (x >= 0 && x < width && y >= 0 && y < height)
{
/* Use point-sampling for rescaling. */
@@ -1543,13 +1543,13 @@ bail:
/* ARGSUSED */
int
-BitmapOpenScalable (FontPathElementPtr fpe,
- FontPtr *pFont,
- int flags,
- FontEntryPtr entry,
+BitmapOpenScalable (FontPathElementPtr fpe,
+ FontPtr *pFont,
+ int flags,
+ FontEntryPtr entry,
char *fileName, /* unused */
- FontScalablePtr vals,
- fsBitmapFormat format,
+ FontScalablePtr vals,
+ fsBitmapFormat format,
fsBitmapFormatMask fmask,
FontPtr non_cachable_font) /* We don't do licensing */
{
@@ -1635,11 +1635,11 @@ BitmapOpenScalable (FontPathElementPtr fpe,
}
int
-BitmapGetInfoScalable (FontPathElementPtr fpe,
- FontInfoPtr pFontInfo,
- FontEntryPtr entry,
- FontNamePtr fontName,
- char *fileName,
+BitmapGetInfoScalable (FontPathElementPtr fpe,
+ FontInfoPtr pFontInfo,
+ FontEntryPtr entry,
+ FontNamePtr fontName,
+ char *fileName,
FontScalablePtr vals)
{
FontPtr pfont;
diff --git a/libXfont/src/bitmap/pcfread.c b/libXfont/src/bitmap/pcfread.c
index 32f9856fa..34eeeb734 100644
--- a/libXfont/src/bitmap/pcfread.c
+++ b/libXfont/src/bitmap/pcfread.c
@@ -56,7 +56,7 @@ pcfError(const char* message, ...)
vfprintf(stderr, message, args);
va_end(args);
}
-
+
/* Read PCF font files */
static void pcfUnloadFont ( FontPtr pFont );
@@ -138,7 +138,8 @@ pcfReadTOC(FontFilePtr file, int *countp)
}
tables = malloc(count * sizeof(PCFTableRec));
if (!tables) {
- pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec));
+ pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n",
+ count, (int) sizeof(PCFTableRec));
return (PCFTablePtr) NULL;
}
for (i = 0; i < count; i++) {
@@ -197,7 +198,7 @@ pcfGetCompressedMetric(FontFilePtr file, CARD32 format, xCharInfo *metric)
* in the font file
*/
static Bool
-pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables,
+pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables,
CARD32 type, CARD32 *formatp, CARD32 *sizep)
{
int i;
@@ -228,14 +229,14 @@ pcfHasType (PCFTablePtr tables, int ntables, CARD32 type)
}
/*
- * pcfGetProperties
+ * pcfGetProperties
*
* Reads the font properties from the font file, filling in the FontInfo rec
* supplied. Used by by both ReadFont and ReadFontInfo routines.
*/
static Bool
-pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
+pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
PCFTablePtr tables, int ntables)
{
FontPropPtr props = 0;
@@ -262,22 +263,24 @@ pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
if (IS_EOF(file)) goto Bail;
props = malloc(nprops * sizeof(FontPropRec));
if (!props) {
- pcfError("pcfGetProperties(): Couldn't allocate props (%d*%d)\n", nprops, sizeof(FontPropRec));
+ pcfError("pcfGetProperties(): Couldn't allocate props (%d*%d)\n",
+ nprops, (int) sizeof(FontPropRec));
goto Bail;
}
isStringProp = malloc(nprops * sizeof(char));
if (!isStringProp) {
- pcfError("pcfGetProperties(): Couldn't allocate isStringProp (%d*%d)\n", nprops, sizeof(char));
+ pcfError("pcfGetProperties(): Couldn't allocate isStringProp (%d*%d)\n",
+ nprops, (int) sizeof(char));
goto Bail;
}
for (i = 0; i < nprops; i++) {
props[i].name = pcfGetINT32(file, format);
isStringProp[i] = pcfGetINT8(file, format);
props[i].value = pcfGetINT32(file, format);
- if (props[i].name < 0
+ if (props[i].name < 0
|| (isStringProp[i] != 0 && isStringProp[i] != 1)
|| (isStringProp[i] && props[i].value < 0)) {
- pcfError("pcfGetProperties(): invalid file format %d %d %d\n",
+ pcfError("pcfGetProperties(): invalid file format %ld %d %ld\n",
props[i].name, isStringProp[i], props[i].value);
goto Bail;
}
@@ -334,7 +337,7 @@ Bail:
*/
static Bool
-pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file,
+pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file,
PCFTablePtr tables, int ntables, CARD32 type)
{
CARD32 format;
@@ -345,7 +348,7 @@ pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file,
goto Bail;
format = pcfGetLSB32(file);
if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) &&
- !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS))
+ !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS))
{
goto Bail;
}
@@ -382,7 +385,7 @@ Bail:
}
int
-pcfReadFont(FontPtr pFont, FontFilePtr file,
+pcfReadFont(FontPtr pFont, FontFilePtr file,
int bit, int byte, int glyph, int scan)
{
CARD32 format;
@@ -407,6 +410,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
pFont->info.nprops = 0;
pFont->info.props = 0;
+ pFont->info.isStringProp=0;
+
if (!(tables = pcfReadTOC(file, &ntables)))
goto Bail;
@@ -443,7 +448,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
}
metrics = malloc(nmetrics * sizeof(CharInfoRec));
if (!metrics) {
- pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
+ pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n",
+ nmetrics, (int) sizeof(CharInfoRec));
goto Bail;
}
for (i = 0; i < nmetrics; i++)
@@ -454,7 +460,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
if (!pcfGetCompressedMetric(file, format, &(metrics + i)->metrics))
goto Bail;
}
-
+
/* bitmaps */
if (!pcfSeekToType(file, tables, ntables, PCF_BITMAPS, &format, &size))
@@ -469,7 +475,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
/* nmetrics is already ok, so nbitmap also is */
offsets = malloc(nbitmaps * sizeof(CARD32));
if (!offsets) {
- pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", nbitmaps, sizeof(CARD32));
+ pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n",
+ nbitmaps, (int) sizeof(CARD32));
goto Bail;
}
for (i = 0; i < nbitmaps; i++) {
@@ -482,7 +489,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
if (IS_EOF(file)) goto Bail;
if (bitmapSizes[i] < 0) goto Bail;
}
-
+
sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)];
/* guard against completely empty font */
bitmaps = malloc(sizebitmaps ? sizebitmaps : 1);
@@ -558,10 +565,11 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
goto Bail;
/* nmetrics already checked */
ink_metrics = malloc(nink_metrics * sizeof(xCharInfo));
- if (!ink_metrics) {
- pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo));
+ if (!ink_metrics) {
+ pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n",
+ nink_metrics, (int) sizeof(xCharInfo));
goto Bail;
- }
+ }
for (i = 0; i < nink_metrics; i++)
if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) {
if (!pcfGetMetric(file, format, ink_metrics + i))
@@ -595,10 +603,11 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
encoding = calloc(NUM_SEGMENTS(nencoding), sizeof(CharInfoPtr*));
if (!encoding) {
- pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr));
+ pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n",
+ nencoding, (int) sizeof(CharInfoPtr));
goto Bail;
}
-
+
pFont->info.allExist = TRUE;
for (i = 0; i < nencoding; i++) {
encodingOffset = pcfGetINT16(file, format);
@@ -624,7 +633,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
bitmapFont = malloc(sizeof *bitmapFont);
if (!bitmapFont) {
- pcfError("pcfReadFont(): Couldn't allocate bitmapFont (%d)\n", sizeof *bitmapFont);
+ pcfError("pcfReadFont(): Couldn't allocate bitmapFont (%d)\n",
+ (int) sizeof *bitmapFont);
goto Bail;
}
diff --git a/libXfont/src/bitmap/pcfwrite.c b/libXfont/src/bitmap/pcfwrite.c
index 3ac07b359..0874c4bd4 100644
--- a/libXfont/src/bitmap/pcfwrite.c
+++ b/libXfont/src/bitmap/pcfwrite.c
@@ -236,7 +236,8 @@ pcfWriteFont(FontPtr pFont, FontFilePtr file)
}
offsetProps = malloc(pFont->info.nprops * sizeof(FontPropRec));
if (!offsetProps) {
- pcfError("pcfWriteFont(): Couldn't allocate offsetProps (%d*%d)", pFont->info.nprops, sizeof(FontPropRec));
+ pcfError("pcfWriteFont(): Couldn't allocate offsetProps (%d*%d)",
+ pFont->info.nprops, (int) sizeof(FontPropRec));
return AllocError;
}
prop_string_size = 0;
@@ -430,8 +431,8 @@ pcfWriteFont(FontPtr pFont, FontFilePtr file)
pcfPutINT16(file, format, pFont->info.defaultCh);
for (i = 0; i < nencodings; i++) {
if (ACCESSENCODING(bitmapFont->encoding,i))
- pcfPutINT16(file, format,
- ACCESSENCODING(bitmapFont->encoding, i) -
+ pcfPutINT16(file, format,
+ ACCESSENCODING(bitmapFont->encoding, i) -
bitmapFont->metrics);
else
pcfPutINT16(file, format, 0xFFFF);
diff --git a/libXfont/src/bitmap/snfread.c b/libXfont/src/bitmap/snfread.c
index d003cc5a5..da362c81a 100644
--- a/libXfont/src/bitmap/snfread.c
+++ b/libXfont/src/bitmap/snfread.c
@@ -60,7 +60,7 @@ from The Open Group.
#include <stdarg.h>
-static void
+static void _X_ATTRIBUTE_PRINTF(1, 2)
snfError(const char* message, ...)
{
va_list args;
@@ -71,7 +71,7 @@ snfError(const char* message, ...)
vfprintf(stderr, message, args);
va_end(args);
}
-
+
static void snfUnloadFont(FontPtr pFont);
static int
@@ -211,7 +211,7 @@ SnfGetFormat (int *bit, int *byte, int *glyph, int *scan)
}
int
-snfReadFont(FontPtr pFont, FontFilePtr file,
+snfReadFont(FontPtr pFont, FontFilePtr file,
int bit, int byte, int glyph, int scan)
{
snfFontInfoRec fi;
@@ -239,7 +239,7 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
/*
* we'll allocate one chunk of memory and split it among the various parts
* of the font:
- *
+ *
* BitmapFontRec CharInfoRec's Glyphs Encoding DIX Properties Ink CharInfoRec's
*
* If the glyphpad is not the same as the font file, then the glyphs
@@ -253,7 +253,7 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
metrics_off = bytestoalloc;
bytestoalloc += num_chars * sizeof(CharInfoRec); /* metrics */
encoding_off = bytestoalloc;
- bytestoalloc += NUM_SEGMENTS(num_chars) * sizeof(CharInfoPtr**);
+ bytestoalloc += NUM_SEGMENTS(num_chars) * sizeof(CharInfoPtr**);
/* encoding */
props_off = bytestoalloc;
bytestoalloc += fi.nProps * sizeof(FontPropRec); /* props */
@@ -299,7 +299,7 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
*/
ret = Successful;
- memset(bitmapFont->encoding, 0,
+ memset(bitmapFont->encoding, 0,
NUM_SEGMENTS(num_chars)*sizeof(CharInfoPtr*));
for (i = 0; ret == Successful && i < num_chars; i++) {
ret = snfReadCharInfo(file, &bitmapFont->metrics[i], bitmaps);
@@ -454,12 +454,14 @@ snfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file)
pFontInfo->props = malloc(fi.nProps * sizeof(FontPropRec));
if (!pFontInfo->props) {
- snfError("snfReadFontInfo(): Couldn't allocate props (%d*%d)\n", fi.nProps, sizeof(FontPropRec));
+ snfError("snfReadFontInfo(): Couldn't allocate props (%d*%d)\n",
+ fi.nProps, (int) sizeof(FontPropRec));
return AllocError;
}
pFontInfo->isStringProp = malloc(fi.nProps * sizeof(char));
if (!pFontInfo->isStringProp) {
- snfError("snfReadFontInfo(): Couldn't allocate isStringProp (%d*%d)\n", fi.nProps, sizeof(char));
+ snfError("snfReadFontInfo(): Couldn't allocate isStringProp (%d*%d)\n",
+ fi.nProps, (int) sizeof(char));
free(pFontInfo->props);
return AllocError;
}
diff --git a/libXfont/src/builtins/Makefile.in b/libXfont/src/builtins/Makefile.in
index 9cbdadd59..53c718f6b 100644
--- a/libXfont/src/builtins/Makefile.in
+++ b/libXfont/src/builtins/Makefile.in
@@ -95,6 +95,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/builtins/builtin.h b/libXfont/src/builtins/builtin.h
index 418bfe984..75dff8d85 100644
--- a/libXfont/src/builtins/builtin.h
+++ b/libXfont/src/builtins/builtin.h
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
@@ -36,7 +36,7 @@ typedef struct _BuiltinFile {
} BuiltinFileRec, *BuiltinFilePtr;
typedef struct _BuiltinDir {
- char *file_name;
+ const char *file_name;
char *font_name;
} BuiltinDirRec, *BuiltinDirPtr;
diff --git a/libXfont/src/fc/Makefile.in b/libXfont/src/fc/Makefile.in
index faf33b715..779f06f11 100644
--- a/libXfont/src/fc/Makefile.in
+++ b/libXfont/src/fc/Makefile.in
@@ -95,6 +95,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/fc/fsio.c b/libXfont/src/fc/fsio.c
index 63d3b4f3c..03a689f6e 100644
--- a/libXfont/src/fc/fsio.c
+++ b/libXfont/src/fc/fsio.c
@@ -72,7 +72,7 @@ _fs_resize (FSBufPtr buf, long size);
static void
_fs_downsize (FSBufPtr buf, long size);
-
+
int
_fs_poll_connect (XtransConnInfo trans_conn, int timeout)
{
@@ -149,7 +149,7 @@ _fs_fill (FSFpePtr conn)
long avail;
long bytes_read;
Bool waited = FALSE;
-
+
if (_fs_flush (conn) < 0)
return FSIO_ERROR;
/*
@@ -199,7 +199,7 @@ int
_fs_start_read (FSFpePtr conn, long size, char **buf)
{
int ret;
-
+
conn->inNeed = size;
if (fs_inqueued(conn) < size)
{
@@ -245,7 +245,7 @@ _fs_flush (FSFpePtr conn)
{
long bytes_written;
long remain;
-
+
/* XXX - hack. The right fix is to remember that the font server
has gone away when we first discovered it. */
if (conn->fs_fd < 0)
@@ -295,7 +295,7 @@ _fs_resize (FSBufPtr buf, long size)
{
if (buf->remove != buf->insert)
{
- memmove (buf->buf,
+ memmove (buf->buf,
buf->buf + buf->remove,
buf->insert - buf->remove);
}
@@ -345,7 +345,7 @@ _fs_io_init (FSFpePtr conn)
if (!conn->outBuf.buf)
return FALSE;
conn->outBuf.size = FS_BUF_INC;
-
+
conn->inBuf.insert = conn->inBuf.remove = 0;
conn->inBuf.buf = malloc (FS_BUF_INC);
if (!conn->inBuf.buf)
@@ -355,7 +355,7 @@ _fs_io_init (FSFpePtr conn)
return FALSE;
}
conn->inBuf.size = FS_BUF_INC;
-
+
return TRUE;
}
@@ -369,7 +369,7 @@ _fs_io_fini (FSFpePtr conn)
}
static int
-_fs_do_write(FSFpePtr conn, char *data, long len, long size)
+_fs_do_write(FSFpePtr conn, const char *data, long len, long size)
{
if (size == 0) {
#ifdef DEBUG
@@ -380,8 +380,8 @@ _fs_do_write(FSFpePtr conn, char *data, long len, long size)
if (conn->fs_fd == -1)
return FSIO_ERROR;
-
- while (conn->outBuf.insert + size > conn->outBuf.size)
+
+ while (conn->outBuf.insert + size > conn->outBuf.size)
{
if (_fs_flush (conn) < 0)
return FSIO_ERROR;
@@ -403,16 +403,16 @@ _fs_do_write(FSFpePtr conn, char *data, long len, long size)
* Write the indicated bytes
*/
int
-_fs_write (FSFpePtr conn, char *data, long len)
+_fs_write (FSFpePtr conn, const char *data, long len)
{
return _fs_do_write (conn, data, len, len);
}
-
+
/*
* Write the indicated bytes adding any appropriate pad
*/
int
-_fs_write_pad(FSFpePtr conn, char *data, long len)
+_fs_write_pad(FSFpePtr conn, const char *data, long len)
{
return _fs_do_write (conn, data, len, len + padlength[len & 3]);
}
diff --git a/libXfont/src/fc/fsio.h b/libXfont/src/fc/fsio.h
index bd0c621e8..2bb8e0b73 100644
--- a/libXfont/src/fc/fsio.h
+++ b/libXfont/src/fc/fsio.h
@@ -110,9 +110,9 @@ typedef struct _fs_fpe_data {
CARD32 brokenWriteTime; /* time to retry broken write */
CARD32 blockedConnectTime; /* time to abort blocked connect */
CARD32 brokenConnectionTime; /* time to retry broken connection */
-
+
FSBlockDataPtr blockedRequests;
-
+
struct _XtransConnInfo *trans_conn; /* transport connection object */
} FSFpeRec;
@@ -129,8 +129,8 @@ typedef struct _fs_fpe_data {
#define FSIO_ERROR -1
extern Bool _fs_reopen_server ( FSFpePtr conn );
-extern int _fs_write ( FSFpePtr conn, char *data, long size );
-extern int _fs_write_pad ( FSFpePtr conn, char *data, long len );
+extern int _fs_write ( FSFpePtr conn, const char *data, long size );
+extern int _fs_write_pad ( FSFpePtr conn, const char *data, long len );
extern int _fs_wait_for_readable ( FSFpePtr conn, int ms );
extern long _fs_pad_length (long len);
diff --git a/libXfont/src/fontfile/Makefile.in b/libXfont/src/fontfile/Makefile.in
index 5fbb70f9e..710b374de 100644
--- a/libXfont/src/fontfile/Makefile.in
+++ b/libXfont/src/fontfile/Makefile.in
@@ -105,6 +105,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/fontfile/decompress.c b/libXfont/src/fontfile/decompress.c
index c8171dd4a..20971dfb9 100644
--- a/libXfont/src/fontfile/decompress.c
+++ b/libXfont/src/fontfile/decompress.c
@@ -44,7 +44,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/*
+/*
* decompress - cat a compressed file
*/
@@ -93,11 +93,11 @@ static char_type magic_header[] = { "\037\235" }; /* 1F 9D */
/*
* the next two codes should not be changed lightly, as they must not
* lie within the contiguous general code space.
- */
+ */
#define FIRST 257 /* first free entry */
#define CLEAR 256 /* table clear output code */
-#define STACK_SIZE 8192
+#define STACK_SIZE 65300
typedef struct _compressedFILE {
BufFilePtr file;
@@ -124,14 +124,6 @@ typedef struct _compressedFILE {
} CompressedFile;
-static int hsize_table[] = {
- 5003, /* 12 bits - 80% occupancy */
- 9001, /* 13 bits - 91% occupancy */
- 18013, /* 14 bits - 91% occupancy */
- 35023, /* 15 bits - 94% occupancy */
- 69001 /* 16 bits - 95% occupancy */
-};
-
static int BufCompressedClose ( BufFilePtr f, int doClose );
static int BufCompressedFill ( BufFilePtr f );
static code_int getcode ( CompressedFile *file );
@@ -142,7 +134,6 @@ BufFilePushCompressed (BufFilePtr f)
{
int code;
int maxbits;
- int hsize;
CompressedFile *file;
int extra;
@@ -153,13 +144,12 @@ BufFilePushCompressed (BufFilePtr f)
}
code = BufFileGet (f);
if (code == BUFFILEEOF) return 0;
-
+
maxbits = code & BIT_MASK;
- if (maxbits > BITS || maxbits < 12)
+ if (maxbits > BITS || maxbits <= INIT_BITS)
return 0;
- hsize = hsize_table[maxbits - 12];
extra = (1 << maxbits) * sizeof (char_type) +
- hsize * sizeof (unsigned short);
+ (1 << maxbits) * sizeof (unsigned short);
file = malloc (sizeof (CompressedFile) + extra);
if (!file)
return 0;
@@ -178,14 +168,12 @@ BufFilePushCompressed (BufFilePtr f)
file->tab_suffix[code] = (char_type) code;
}
file->free_ent = ((file->block_compress) ? FIRST : 256 );
+ file->oldcode = -1;
file->clear_flg = 0;
file->offset = 0;
file->size = 0;
file->stackp = file->de_stack;
bzero(file->buf, BITS);
- file->finchar = file->oldcode = getcode (file);
- if (file->oldcode != -1)
- *file->stackp++ = file->finchar;
return BufFileCreate ((char *) file,
BufCompressedFill,
0,
@@ -230,51 +218,56 @@ BufCompressedFill (BufFilePtr f)
if (buf == bufend)
break;
- if (oldcode == -1)
- break;
-
code = getcode (file);
if (code == -1)
break;
-
+
if ( (code == CLEAR) && file->block_compress ) {
for ( code = 255; code >= 0; code-- )
file->tab_prefix[code] = 0;
file->clear_flg = 1;
- file->free_ent = FIRST - 1;
- if ( (code = getcode (file)) == -1 ) /* O, untimely death! */
- break;
+ file->free_ent = FIRST;
+ oldcode = -1;
+ continue;
}
incode = code;
/*
* Special case for KwKwK string.
*/
if ( code >= file->free_ent ) {
+ if ( code > file->free_ent || oldcode == -1 ) {
+ /* Bad stream. */
+ return BUFFILEEOF;
+ }
*stackp++ = finchar;
code = oldcode;
}
-
+ /*
+ * The above condition ensures that code < free_ent.
+ * The construction of tab_prefixof in turn guarantees that
+ * each iteration decreases code and therefore stack usage is
+ * bound by 1 << BITS - 256.
+ */
+
/*
* Generate output characters in reverse order
*/
while ( code >= 256 )
{
- if (stackp - de_stack >= STACK_SIZE - 1)
- return BUFFILEEOF;
*stackp++ = file->tab_suffix[code];
code = file->tab_prefix[code];
}
finchar = file->tab_suffix[code];
*stackp++ = finchar;
-
+
/*
* Generate the new entry.
*/
- if ( (code=file->free_ent) < file->maxmaxcode ) {
+ if ( (code=file->free_ent) < file->maxmaxcode && oldcode != -1) {
file->tab_prefix[code] = (unsigned short)oldcode;
file->tab_suffix[code] = finchar;
file->free_ent = code+1;
- }
+ }
/*
* Remember previous code.
*/
@@ -382,7 +375,7 @@ static int
BufCompressedSkip (BufFilePtr f, int bytes)
{
int c;
- while (bytes--)
+ while (bytes--)
{
c = BufFileGet(f);
if (c == BUFFILEEOF)
@@ -397,7 +390,7 @@ main (int argc, char *argv[])
{
BufFilePtr inputraw, input, output;
int c;
-
+
inputraw = BufFileOpenRead (0);
input = BufFilePushCompressed (inputraw);
output = BufFileOpenWrite (1);
diff --git a/libXfont/src/fontfile/fontdir.c b/libXfont/src/fontfile/fontdir.c
index e052bb371..97b2ba3b1 100644
--- a/libXfont/src/fontfile/fontdir.c
+++ b/libXfont/src/fontfile/fontdir.c
@@ -43,7 +43,7 @@ in this Software without prior written authorization from The Open Group.
Bool
FontFileInitTable (FontTablePtr table, int size)
{
- if (size < 0 || (size > INT32_MAX/sizeof(FontEntryRec)))
+ if (size < 0 || (size > INT32_MAX/sizeof(FontEntryRec)))
return FALSE;
if (size)
{
@@ -102,12 +102,12 @@ FontFileFreeTable (FontTablePtr table)
}
FontDirectoryPtr
-FontFileMakeDir(char *dirName, int size)
+FontFileMakeDir(const char *dirName, int size)
{
FontDirectoryPtr dir;
int dirlen;
int needslash = 0;
- char *attrib;
+ const char *attrib;
int attriblen;
#if !defined(WIN32)
@@ -279,7 +279,7 @@ FontFileSortDir(FontDirectoryPtr dir)
#define isDigit(c) (XK_0 <= (c) && (c) <= XK_9)
static int
-SetupWildMatch(FontTablePtr table, FontNamePtr pat,
+SetupWildMatch(FontTablePtr table, FontNamePtr pat,
int *leftp, int *rightp, int *privatep)
{
int nDashes;
@@ -438,7 +438,7 @@ FontFileSaveString (char *s)
}
FontEntryPtr
-FontFileFindNameInScalableDir(FontTablePtr table, FontNamePtr pat,
+FontFileFindNameInScalableDir(FontTablePtr table, FontNamePtr pat,
FontScalablePtr vals)
{
int i,
@@ -491,7 +491,7 @@ FontFileFindNameInDir(FontTablePtr table, FontNamePtr pat)
}
int
-FontFileFindNamesInScalableDir(FontTablePtr table, FontNamePtr pat, int max,
+FontFileFindNamesInScalableDir(FontTablePtr table, FontNamePtr pat, int max,
FontNamesPtr names, FontScalablePtr vals,
int alias_behavior, int *newmax)
{
@@ -578,7 +578,7 @@ FontFileFindNamesInScalableDir(FontTablePtr table, FontNamePtr pat, int max,
}
int
-FontFileFindNamesInDir(FontTablePtr table, FontNamePtr pat,
+FontFileFindNamesInDir(FontTablePtr table, FontNamePtr pat,
int max, FontNamesPtr names)
{
return FontFileFindNamesInScalableDir(table, pat, max, names,
@@ -767,7 +767,7 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName)
extra->defaults.y = 75;
}
}
- else
+ else
{
extra->defaults.x = vals.x;
extra->defaults.y = vals.y;
diff --git a/libXfont/src/stubs/Makefile.in b/libXfont/src/stubs/Makefile.in
index 0079d1095..1ad327af9 100644
--- a/libXfont/src/stubs/Makefile.in
+++ b/libXfont/src/stubs/Makefile.in
@@ -98,6 +98,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -257,7 +258,7 @@ libstubs_la_SOURCES = \
servclient.c \
setfntauth.c \
stfntcfnt.c \
- stubs.h
+ stubs.h
all: all-am
diff --git a/libXfont/src/util/Makefile.in b/libXfont/src/util/Makefile.in
index 5b0d85e40..802d9fb27 100644
--- a/libXfont/src/util/Makefile.in
+++ b/libXfont/src/util/Makefile.in
@@ -97,6 +97,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
diff --git a/libXfont/src/util/atom.c b/libXfont/src/util/atom.c
index f15e3d8de..c47cb5c80 100644
--- a/libXfont/src/util/atom.c
+++ b/libXfont/src/util/atom.c
@@ -54,7 +54,7 @@ static int reverseMapSize;
static Atom lastAtom;
static int
-Hash(char *string, int len)
+Hash(const char *string, int len)
{
int h;
@@ -146,8 +146,8 @@ NameEqual (const char *a, const char *b, int l)
#pragma weak MakeAtom
#endif
-weak Atom
-MakeAtom(char *string, unsigned len, int makeit)
+weak Atom
+MakeAtom(const char *string, unsigned len, int makeit)
{
AtomListPtr a;
int hash;
@@ -223,7 +223,7 @@ MakeAtom(char *string, unsigned len, int makeit)
#pragma weak ValidAtom
#endif
-weak int
+weak int
ValidAtom(Atom atom)
{
return (atom != None) && (atom <= lastAtom);
diff --git a/libXfont/src/util/fontxlfd.c b/libXfont/src/util/fontxlfd.c
index 81240376f..974128ee3 100644
--- a/libXfont/src/util/fontxlfd.c
+++ b/libXfont/src/util/fontxlfd.c
@@ -70,7 +70,7 @@ GetInt(char *ptr, int *val)
#ifndef NO_LOCALE
static struct lconv *locale = 0;
#endif
-static char *radix = ".", *plus = "+", *minus = "-";
+static const char *radix = ".", *plus = "+", *minus = "-";
static char *
readreal(char *ptr, double *result)
@@ -116,7 +116,6 @@ readreal(char *ptr, double *result)
static char *
xlfd_double_to_text(double value, char *buffer, int space_required)
{
- char formatbuf[40];
register char *p1;
int ndigits, exponent;
@@ -132,14 +131,12 @@ xlfd_double_to_text(double value, char *buffer, int space_required)
minus = locale->negative_sign;
}
#endif
- /* Compute a format to use to render the number */
- sprintf(formatbuf, "%%.%dle", XLFD_NDIGITS);
if (space_required)
*buffer++ = ' ';
/* Render the number using printf's idea of formatting */
- sprintf(buffer, formatbuf, value);
+ sprintf(buffer, "%.*le", XLFD_NDIGITS, value);
/* Find and read the exponent value */
for (p1 = buffer + strlen(buffer);
@@ -156,16 +153,14 @@ xlfd_double_to_text(double value, char *buffer, int space_required)
if (exponent >= XLFD_NDIGITS || ndigits - exponent > XLFD_NDIGITS + 1)
{
/* Scientific */
- sprintf(formatbuf, "%%.%dle", ndigits - 1);
- sprintf(buffer, formatbuf, value);
+ sprintf(buffer, "%.*le", ndigits - 1, value);
}
else
{
/* Fixed */
ndigits -= exponent + 1;
if (ndigits < 0) ndigits = 0;
- sprintf(formatbuf, "%%.%dlf", ndigits);
- sprintf(buffer, formatbuf, value);
+ sprintf(buffer, "%.*lf", ndigits, value);
if (exponent < 0)
{
p1 = buffer;
@@ -265,10 +260,9 @@ xlfd_round_double(double x)
* If not IEEE 754: Let printf() do it for you.
*/
- char formatbuf[40], buffer[40];
+ char buffer[40];
- sprintf(formatbuf, "%%.%dlg", XLFD_NDIGITS);
- sprintf(buffer, formatbuf, x);
+ sprintf(buffer, "%.*lg", XLFD_NDIGITS, x);
return atof(buffer);
}
}