diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-05-15 21:32:58 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-05-15 21:32:58 +0000 |
commit | 135a2518ecc14cce8a2d76e9d5081130743c3ac6 (patch) | |
tree | 098e679556559dbdb9986071962d5479a28b5268 | |
parent | fe1758e77f49b35e1b9c949688c37d6f99a03f80 (diff) |
Update xf86-video-openchrome to 0.2.905
47 files changed, 17108 insertions, 2222 deletions
diff --git a/driver/xf86-video-openchrome/ChangeLog b/driver/xf86-video-openchrome/ChangeLog index 9eaa0d9fa..36c1d0826 100644 --- a/driver/xf86-video-openchrome/ChangeLog +++ b/driver/xf86-video-openchrome/ChangeLog @@ -14,6 +14,240 @@ (viaRestoreVideo), (viaExitVideo):
* src/via_video.h:
+2011-05-10 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Workaround EXA crash with new libcairo2 (#298) + + * src/via_accel.c: (viaExaPrepareComposite): + +2011-05-08 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Fix cursor garbage after suspend/resume for Xserver 1.10 (#405) + + * src/via_video.c: (viaRestoreVideo): + +2011-05-04 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Fix XAA displaying issues + + * src/via_accel.c: (viaInitXAA): + +2011-01-23 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Enable hardware cursor for VX900 + + * src/via_cursor.c: (viaHWCursorInit): + * src/via_mode.c: (ViaModeSet): + +2010-12-16 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Merge vx900_branch - initial VX900 support + + * src/via_accel.c: (viaFlushPCI), (viaDisableVQ), + (viaInitialize2DEngine), (viaAccelSync), (viaPitchHelper), + (viaInitXAA): + * src/via_bandwidth.c: (ViaSetPrimaryFIFO), (ViaSetSecondaryFIFO): + * src/via_bios.h: + * src/via_crtc.c: (ViaFirstCRTCSetMode), (ViaSecondCRTCSetMode): + * src/via_cursor.c: (viaHWCursorInit), (viaCursorStore), + (viaCursorRestore), (viaShowCursor), (viaHideCursor), + (viaSetCursorPosition), (viaLoadCursorImage), (viaSetCursorColors): + * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit), + (VIALeaveVT), (VIASave), (VIARestore), (ViaMMIOEnable), + (ViaMMIODisable), (VIAMapFB), (VIAWriteMode), (VIACloseScreen): + * src/via_driver.h: + * src/via_id.c: + * src/via_id.h: + * src/via_mode.c: (ViaDFPDetect), (ViaOutputsDetect), + (ViaOutputsSelect), (ViaGetMemoryBandwidth), (ViaSetDotclock), + (ViaModeSet): + * src/via_mode.h: + * src/via_panel.c: (ViaPanelScaleDisable), (ViaPanelPreInit), + (ViaPanelGetSizeFromDDC): + * src/via_video.c: (DecideOverlaySupport): + * src/via_xvmc.c: (ViaInitXVMC): + +2010-12-15 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Enable the new mode switch and panel support on K8M800 and VM800 chipsets + + * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): + * src/via_mode.c: (ViaModeSet): + +2010-11-10 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Replace the deprecated functions + xalloc/xrealloc/xfree/xcalloc with + malloc/realloc/free/calloc. + Refer to "/xserver/include/os.h" + + * src/via_accel.c: (viaSetupCBuffer), (viaTearDownCBuffer), + (viaInitExa), (viaExitAccel), (viaFinishInitAccel): + * src/via_dga.c: (VIASetupDGAMode): + * src/via_dri.c: (VIAInitVisualConfigs), (VIADRIScreenInit), + (VIADRICloseScreen): + * src/via_driver.c: (VIAFreeRec), (VIAProbe), (VIAPreInit), + (VIACloseScreen): + * src/via_memcpy.c: (viaVidCopyInit): + * src/via_swov.c: (Upd_Video): + * src/via_vbe.c: (ViaVbeSetMode): + * src/via_video.c: (viaExitVideo), (viaStopVideo), + (viaDmaBlitImage): + * src/via_xvmc.c: (cleanupViaXvMC), (ViaCleanupXVMC), + (ViaXvMCCreateContext), (ViaXvMCCreateSurface), + (ViaXvMCCreateSubpicture), (ViaXvMCDestroyContext), + (ViaXvMCDestroySurface), (ViaXvMCDestroySubpicture), + (viaXvMCInitXv): + +2010-10-24 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Siragon ML-6200 laptop support + + * src/via_id.c: + +2010-06-24 Jon Nettleton <jon.nettleton@gmail.com> + + PM800 also uses the CME Engine. Setup the hqv_cme_regs + for it. + + * src/via_swov.c: (VIAVidHWDiffInit): + +2010-06-09 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Fix freeze on 64bit system for K8M800 chipset + + * src/via_dri.c: (VIADRIAgpInit): + +2010-05-04 Jon Nettleton <jon.nettleton@gmail.com> + + Re-enable the Virtual Queue for the VX800/VX855 chipsets. + + * src/via_accel.c: (viaDisableVQ), (viaInitialize2DEngine): + +2010-05-04 Jon Nettleton <jon.nettleton@gmail.com> + + Disable certain hardware clipping options for the VX855. + These cause the 2d engine to become unstable when in + 16-bit mode. + + * src/via_accel.c: (viaInitXAA): + +2010-05-04 Jon Nettleton <jon.nettleton@gmail.com> + + Add an undocumented option which allows certain I2C buses + to be probed at startup. This allows workarounds for custom + chipset makers that have used the VX855 I2C buses for other + purposes. + + * src/via_bios.h: + * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): + * src/via_driver.h: + * src/via_i2c.c: + +2010-05-04 Jon Nettleton <jon.nettleton@gmail.com> + + Improve 2d performance on chipsets that don't have + AGP/PCIe support yet. + + * src/via_accel.c: (viaSetupForScreenToScreenCopy), + (viaSetupForSolidFill), (viaSetupForMono8x8PatternFill), + (viaSetupForColor8x8PatternFill), + (viaSetupForCPUToScreenColorExpandFill), + (viaSubsequentScanlineCPUToScreenColorExpandFill), + (viaSetupForImageWrite), (viaSubsequentImageWriteRect), + (viaSetupForSolidLine), (viaSetupForDashedLine), (viaInitXAA): + +2010-05-04 Jon Nettleton <jon.nettleton@gmail.com> + + Put timeouts on our while statements. These codepaths + should be interrupted by a hardware state change, but + if something goes wrong they loop forevere. Let's try + and behave a little by putting a timeout on these loops. + + * src/via_swov.c: (viaWaitHQVFlip), (viaWaitHQVFlipClear), + (viaWaitHQVDone): + * src/via_video.c: (Flip): + +2010-05-04 Jon Nettleton <jon.nettleton@gmail.com> + + Add XVideo support for the VX855 Chipset. + To support this chipset I have added HWDiff->HQVCmeRegs + that allows handling differing register values, and + HWDiff->dwNewScaleCtl which allows selection of a + new Video scaling engine needed for the VX800/VX855 + chipsets. + + * src/via.h: + * src/via_bandwidth.c: (ViaSetSecondaryFIFO): + * src/via_driver.h: + * src/via_swov.c: (SaveVideoRegister), (VIAVidHWDiffInit), + (viaOverlayHQVCalcZoomWidth), (viaOverlayHQVCalcZoomHeight), + (ViaSwovSurfaceCreate), (SetHQVFetch), (Upd_Video): + * src/via_swov.h: + +2010-04-21 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Replace RegionsEqual with REGION_EQUAL and use + the xf86XVFillKeyHelperDrawable instead of xf86XVFillKeyHelper + + * src/via_video.c: (viaReputImage), (viaPutImage): + +2010-03-07 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Fix segfaults with EXA and XV (Ticket #359) + Tested on K8M890 and VN800 + + * src/via_video.c: (viaReputImage), (viaPutImage): + +2010-02-10 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Fix bug with suspend and VT switch on VX800 and 64bit systems + + * src/via_driver.h: + * src/via_video.c: (viaResetVideo), (viaSaveVideo), + (viaRestoreVideo), (viaExitVideo): + * src/via_video.h: + +2010-01-24 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Fix starting address restore and save (initial 64-bit support) + + * src/via_crtc.c: (ViaFirstCRTCSetMode), + (ViaFirstCRTCSetStartingAddress): + * src/via_dri.c: (VIADRIAgpInit): + * src/via_driver.c: (VIASave), (VIARestore): + * src/via_driver.h: + +2009-12-04 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Enable new mode switch for VM800 chipsets + + * src/via_driver.c: (VIASetupDefaultOptions): + +2009-11-21 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Add option to enable unaccelerated RandR rotation ("SWRandR"). + The accelerated option "HWRandR" is currently not implemented. + + * src/openchrome.man: + * src/via_driver.c: (VIAPreInit): + +2009-11-20 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Enabled new mode switch for PM800 chipset, + to resolve many bugs with resolution detecting and changing + (eg. switching to console) + + * src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit): + +2009-11-07 Bartosz Kosiorek <gang65@poczta.onet.pl> + + Add more comments to ViaSetSecondaryFIFO, add panel scale support for + CLE266 and KM400, fix bug with malloc. + + * src/via_bandwidth.c: (ViaSetSecondaryFIFO): + * src/via_panel.c: (ViaPanelScale), (ViaPanelGetNativeDisplayMode): + 2009-09-26 Bartosz Kosiorek <gang65@poczta.onet.pl> Save/restore ECK Clock Synthesizer diff --git a/driver/xf86-video-openchrome/Makefile.am b/driver/xf86-video-openchrome/Makefile.am index a3c5a91a7..aa9cf4a59 100644 --- a/driver/xf86-video-openchrome/Makefile.am +++ b/driver/xf86-video-openchrome/Makefile.am @@ -19,6 +19,11 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AUTOMAKE_OPTIONS = foreign -SUBDIRS = src man libxvmc +SUBDIRS = src man libxvmc tools EXTRA_DIST = COPYING NEWS README + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog diff --git a/driver/xf86-video-openchrome/Makefile.in b/driver/xf86-video-openchrome/Makefile.in index 2f1403773..5225243ea 100644 --- a/driver/xf86-video-openchrome/Makefile.in +++ b/driver/xf86-video-openchrome/Makefile.in @@ -93,25 +93,34 @@ GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ DRI_CFLAGS = @DRI_CFLAGS@ @@ -126,9 +135,12 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -138,6 +150,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -146,6 +160,9 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -166,12 +183,16 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ +TOOLS_FALSE = @TOOLS_FALSE@ +TOOLS_TRUE = @TOOLS_TRUE@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@ XVMC_CFLAGS = @XVMC_CFLAGS@ @@ -227,7 +248,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = src man libxvmc +SUBDIRS = src man libxvmc tools EXTRA_DIST = COPYING NEWS README all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -470,6 +491,9 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ @@ -651,7 +675,7 @@ uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-shar dist-tarZ dist-zip distcheck distclean \ + dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ @@ -663,6 +687,11 @@ uninstall-info: uninstall-info-recursive mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/driver/xf86-video-openchrome/NEWS b/driver/xf86-video-openchrome/NEWS index bae9d2fe0..a54dde541 100644 --- a/driver/xf86-video-openchrome/NEWS +++ b/driver/xf86-video-openchrome/NEWS @@ -1,3 +1,76 @@ +openchrome 0.2.905 (10/02/2012) +------------------------------- +* New features : +- VX900 support (Xv not supported yet). +- VX855 XVideo support. + +* Bugfixes and enhancements : +- More debug information to video decoding. +- Add secondary FIFO support for K8M890 and P4M890. +- Check the primary FIFO for VX855. +- Add panel scale support for CLE266 and KM400. +- Fix bug with malloc. +- Enabled new mode switch for PM800 chipset. +- Add option to enable unaccelerated RandR rotation ("SWRandR"). +- Enable new mode switch for VM800 chipsets. +- More debug traces to via_video.c. +- Fix manual and add more comments. +- Fix start address. +- Optimization of the hardware accelerated cursor and XAA (K8M890 chipset). +- Code clean up. +- Fix bug with suspend and VT switch on VX800 chipset and 64bit systems. +- Synchronize via_drm.h with drm-2.4.17. +- Fix segfaults with EXA and XV. +- Fix build on old kernels. +- Replace RegionsEqual with REGION_EQUAL and use + the xf86XVFillKeyHelperDrawable instead of xf86XVFillKeyHelper. +- Fix DFP parameter description for the ActiveDevice option. +- Manpage update and some minor changes. +- Set colorkey for 2nd_monitor. +- Add timeouts to HQV while loops. +- Improve 2d performance on chipsets without AGP/PCIe. +- Add option I2CDevices. +- Disable Hardware Clipping for the VX855. +- Re-Enable the VQ for VX800/VX855. +- Disable AGP and DMA by default for VX800 and VX855. +- Fixed freeze on 64bit system for K8M800 chipset. +- Increase bandwidth to handle 1920x1200 resolution with DDR266. +- Fix XV crash on PM800 post VX855 rework. +- Fix several typo in code comments. +- Update VX855 FIFO. +- Fix bug with TV out flickering. +- Replace the deprecated functions with new ones. + Refer to "/xserver/include/os.h". +- Replace remaining xalloc to malloc. +- Change maximum line pitch and virtual height according to chipset. +- Update 1024x600 modeline. +- Add workaround for memory autodetection. +- Enable new mode switch and panel support on K8M800 and VM800. +- Fix type in VIASave. +- Use DRICreatePCIBusID when available to create Bus ID string. +- Restore video interrupt flag. +- Fix OpenGL application crash on VX900 chipset. +- Fix VIA VB8001 Mini-ITX Board (P4M900) support. +- Add workaround for bad memory detection on some P4M800. +- Fix resolution detection for OLPC 1.5. +- Fix Xvideo crash on X.Org server 1.10. +- Fix XAA displaying issues. +- Fix cursor garbare after suspend/hibernate/resume on VX855/VX900. +- Workaround EXA crash with new libcairo2. +- Handle X server 1.12 (videoabi 12). +- Add support for I420 Xv surface. +- Limit video RAM size to 256 MB, PCI BAR can't handle more. +- Add Harald Welte's registers dump tool. + +* New boards : +- ASRock PV530, ECS P4M800PRO-M2 (V2.0) , FIC CE2A1, FIC PTM800Pro LF, + Guillemot-Hercules ECafe EC900B, Hewlett Packard DX2020, + Hewlett Packard t5550 Thin Client, Lenovo ThinkCenter E51 8714, + MSI K8M890M2-V, MSI PM8M-V, MSI PM9M-V, OLPC XO 1.5, + Semp Informática Notebook IS 1462, Sharp Mebius PC-CS30H, Siragon ML-6200, + Twinhead K15V + + openchrome 0.2.904 (09/10/2009) ------------------------------- * New features : diff --git a/driver/xf86-video-openchrome/README b/driver/xf86-video-openchrome/README index c94e3034b..48ad4e5fe 100644 --- a/driver/xf86-video-openchrome/README +++ b/driver/xf86-video-openchrome/README @@ -15,6 +15,7 @@ SUPPORTED CHIPSETS : - P4M900/VN896 (VT3364) - VX800 (VT3353) - VX855 (VT3409) +- VX900 (VT3410) SUPPORTED FEATURES : @@ -26,13 +27,6 @@ SUPPORTED FEATURES : - Hardware MPEG2 acceleration. -IMPORTANT NOTE : ----------------- -- The driver name is now 'openchrome', and this is what you need to use in - your xorg.conf now (instead of 'via'). The XvMC libraries have also been - renamed, to 'libchromeXvMC.so' and 'libchromeXvMCPro.so'. - - KNOWN BUGS/LIMITATIONS : ------------------------ * Laptop panel @@ -64,6 +58,9 @@ KNOWN BUGS/LIMITATIONS : - Chrome9 chipsets' family (P4M900, K8M890, VX800, VX855) currently doesn't support neither AGP DMA nor 3D acceleration. +* VX900 +- Xv is not yet supported. + Please note that 3D acceleration is provided by Mesa (http://mesa3d.org) and is not directly related to openchrome. diff --git a/driver/xf86-video-openchrome/aclocal.m4 b/driver/xf86-video-openchrome/aclocal.m4 index e479f332b..2b13d840c 100644 --- a/driver/xf86-video-openchrome/aclocal.m4 +++ b/driver/xf86-video-openchrome/aclocal.m4 @@ -9582,4 +9582,1857 @@ 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.16.2]) +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_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) +# ------------------------------------------------------ +# Minimum version: 1.17.0 +# +# This macro enables a builder to enable/disable integration testing +# It makes no assumption about the test cases' implementation +# Test cases may or may not use Automake "Support for test suites" +# +# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support +# usually requires less dependencies and may be built and run under less +# stringent environments than integration tests. +# +# Interface to module: +# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests +# enable_integration_tests: used in configure.ac for additional configuration +# --enable-integration-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_INTEGRATION_TESTS],[ +AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) +m4_define([_defopt], m4_default([$1], [auto])) +AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], + [Enable building integration test cases (default: ]_defopt[)]), + [enable_integration_tests=$enableval], + [enable_integration_tests=]_defopt) +m4_undefine([_defopt]) +AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], + [test "x$enable_integration_tests" != xno]) +AC_MSG_CHECKING([whether to build unit test cases]) +AC_MSG_RESULT([$enable_integration_tests]) +]) # XORG_ENABLE_INTEGRATION_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. +# +# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit +# test support usually requires less dependencies and may be built and run under +# less stringent environments than integration tests. +# +# 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]) + define([CACHE_PREFIX], [cc]) + define([COMPILER], [$CC]) + ], + [C++], [ + define([PREFIX], [CXX]) + define([CACHE_PREFIX], [cxx]) + define([COMPILER], [$CXX]) + ] +) + +[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" + +if test "x$[xorg_testset_]CACHE_PREFIX[_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_]CACHE_PREFIX[_flag_unknown_warning_option], + AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], + [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], + [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) + [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] + PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" +fi + +if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then + if test "x$[xorg_testset_]CACHE_PREFIX[_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_]CACHE_PREFIX[_flag_unused_command_line_argument], + AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], + [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], + [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) + [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_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 ]COMPILER[ supports]flag[]) + cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) + AC_CACHE_VAL($cacheid, + [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], + [eval $cacheid=yes], + [eval $cacheid=no])]) + + PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" + + eval supported=\$$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 + m4_include([acinclude.m4]) diff --git a/driver/xf86-video-openchrome/compile b/driver/xf86-video-openchrome/compile new file mode 100755 index 000000000..1b1d23216 --- /dev/null +++ b/driver/xf86-video-openchrome/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# 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 2, 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/driver/xf86-video-openchrome/config.h.in b/driver/xf86-video-openchrome/config.h.in index 9a3e95a25..b1b072b81 100644 --- a/driver/xf86-video-openchrome/config.h.in +++ b/driver/xf86-video-openchrome/config.h.in @@ -75,6 +75,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Enable build of registers dumper tool */ +#undef TOOLS + /* Version number of package */ #undef VERSION diff --git a/driver/xf86-video-openchrome/configure b/driver/xf86-video-openchrome/configure index 02236e389..179720c2e 100755 --- a/driver/xf86-video-openchrome/configure +++ b/driver/xf86-video-openchrome/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.62 for xf86-video-openchrome 0.2.904. +# Generated by GNU Autoconf 2.62 for xf86-video-openchrome 0.2.905. # # Report bugs to <http://www.openchrome.org/trac/report/1>. # @@ -616,8 +616,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xf86-video-openchrome' PACKAGE_TARNAME='xf86-video-openchrome' -PACKAGE_VERSION='0.2.904' -PACKAGE_STRING='xf86-video-openchrome 0.2.904' +PACKAGE_VERSION='0.2.905' +PACKAGE_STRING='xf86-video-openchrome 0.2.905' PACKAGE_BUGREPORT='http://www.openchrome.org/trac/report/1' ac_unique_file="Makefile.am" @@ -697,6 +697,46 @@ target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +BASE_CFLAGS +CWARNFLAGS +STRICT_CFLAGS +CHANGELOG_CMD +PKG_CONFIG +INSTALL_CMD +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +SED +APP_MAN_SUFFIX +LIB_MAN_SUFFIX +FILE_MAN_SUFFIX +MISC_MAN_SUFFIX +DRIVER_MAN_SUFFIX +ADMIN_MAN_SUFFIX +APP_MAN_DIR +LIB_MAN_DIR +FILE_MAN_DIR +MISC_MAN_DIR +DRIVER_MAN_DIR +ADMIN_MAN_DIR +XORG_MAN_PAGE +MAN_SUBSTS +AM_DEFAULT_VERBOSITY CYGPATH_W PACKAGE VERSION @@ -715,25 +755,6 @@ am__leading_dot AMTAR am__tar am__untar -MAINTAINER_MODE_TRUE -MAINTAINER_MODE_FALSE -MAINT -LIBTOOL -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT DEPDIR am__include am__quote @@ -743,9 +764,10 @@ AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE -SED -GREP -EGREP +MAINTAINER_MODE_TRUE +MAINTAINER_MODE_FALSE +MAINT +LIBTOOL FGREP LD DUMPBIN @@ -763,8 +785,6 @@ NMEDIT LIPO OTOOL OTOOL64 -CPP -PKG_CONFIG XORG_CFLAGS XORG_LIBS XEXT_CFLAGS @@ -787,20 +807,24 @@ DEBUG_TRUE DEBUG_FALSE XV_DEBUG_TRUE XV_DEBUG_FALSE +TOOLS_TRUE +TOOLS_FALSE moduledir DRIVER_NAME -DRIVER_MAN_SUFFIX LIBOBJS LTLIBOBJS' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_selective_werror +enable_strict_compilation +with_release_version +enable_dependency_tracking enable_maintainer_mode enable_static enable_shared with_pic enable_fast_install -enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock @@ -808,7 +832,7 @@ with_xorg_module_dir enable_dri enable_debug enable_xv_debug -with_release_version +enable_viaregtool ' ac_precious_vars='build_alias host_alias @@ -1382,7 +1406,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 xf86-video-openchrome 0.2.904 to adapt to many kinds of systems. +\`configure' configures xf86-video-openchrome 0.2.905 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1441,7 +1465,7 @@ _ACEOF cat <<\_ACEOF Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names + --program-prefix=C prepend C to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names @@ -1453,7 +1477,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-openchrome 0.2.904:";; + short | recursive ) echo "Configuration of xf86-video-openchrome 0.2.905:";; esac cat <<\_ACEOF @@ -1461,22 +1485,31 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-selective-werror + Turn off selective compiler errors. (default: + enabled) + --enable-strict-compilation + Enable all warnings from compiler and make them + errors (default: disabled) + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] - --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-dri Disable DRI support [default=auto] --enable-debug Enable debugging support [default=no] --enable-xv-debug Enable XVideo debugging support [default=no] + --enable-viaregtool Enable build of registers dumper tool [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-release-version=STRING + Use release version string in package name --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] @@ -1485,8 +1518,6 @@ Optional Packages: --with-xorg-module-dir=DIR Default xorg module directory [default=$libdir/xorg/modules] - --with-release-version=STRING - Use release version string in package name Some influential environment variables: CC C compiler command @@ -1577,7 +1608,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-openchrome configure 0.2.904 +xf86-video-openchrome configure 0.2.905 generated by GNU Autoconf 2.62 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1591,7 +1622,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 xf86-video-openchrome $as_me 0.2.904, which was +It was created by xf86-video-openchrome $as_me 0.2.905, which was generated by GNU Autoconf 2.62. Invocation command line was $ $0 $@ @@ -1993,7 +2024,18 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -am__api_version="1.9" +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS + + + + + + + + + + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -2087,610 +2129,6 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(SHELL) $(install_sh) -d' - fi -fi - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='xf86-video-openchrome' - VERSION='0.2.904' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -# Checks for programs. -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=no -fi - - - - - - - - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:$LINENO: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:$LINENO: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:$LINENO: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:$LINENO: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3622,6 +3060,11321 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if test "${ac_cv_prog_cc_c99+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c99=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if test `eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + +{ $as_echo "$as_me:$LINENO: checking whether __clang__ is declared" >&5 +$as_echo_n "checking whether __clang__ is declared... " >&6; } +if test "${ac_cv_have_decl___clang__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef __clang__ + (void) __clang__; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl___clang__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl___clang__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___clang__" >&5 +$as_echo "$ac_cv_have_decl___clang__" >&6; } +if test $ac_cv_have_decl___clang__ = yes; then + CLANGCC="yes" +else + CLANGCC="no" +fi + +{ $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5 +$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; } +if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef __INTEL_COMPILER + (void) __INTEL_COMPILER; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl___INTEL_COMPILER=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl___INTEL_COMPILER=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5 +$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; } +if test $ac_cv_have_decl___INTEL_COMPILER = yes; then + INTELCC="yes" +else + INTELCC="no" +fi + +{ $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5 +$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; } +if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef __SUNPRO_C + (void) __SUNPRO_C; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl___SUNPRO_C=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl___SUNPRO_C=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5 +$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; } +if test $ac_cv_have_decl___SUNPRO_C = yes; then + SUNCC="yes" +else + SUNCC="no" +fi + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + + + + +# Check whether --enable-selective-werror was given. +if test "${enable_selective_werror+set}" = set; then + enableval=$enable_selective_werror; SELECTIVE_WERROR=$enableval +else + 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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wall" >&5 +$as_echo_n "checking if $CC supports-Wall... " >&6; } + cacheid=xorg_cv_cc_flag__Wall + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wpointer-arith" >&5 +$as_echo_n "checking if $CC supports-Wpointer-arith... " >&6; } + cacheid=xorg_cv_cc_flag__Wpointer_arith + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wmissing-declarations" >&5 +$as_echo_n "checking if $CC supports-Wmissing-declarations... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_declarations + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wformat=2" >&5 +$as_echo_n "checking if $CC supports-Wformat=2... " >&6; } + cacheid=xorg_cv_cc_flag__Wformat_2 + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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:$LINENO: checking if $CC supports-Wformat" >&5 +$as_echo_n "checking if $CC supports-Wformat... " >&6; } + cacheid=xorg_cv_cc_flag__Wformat + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wstrict-prototypes" >&5 +$as_echo_n "checking if $CC supports-Wstrict-prototypes... " >&6; } + cacheid=xorg_cv_cc_flag__Wstrict_prototypes + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wmissing-prototypes" >&5 +$as_echo_n "checking if $CC supports-Wmissing-prototypes... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_prototypes + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wnested-externs" >&5 +$as_echo_n "checking if $CC supports-Wnested-externs... " >&6; } + cacheid=xorg_cv_cc_flag__Wnested_externs + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wbad-function-cast" >&5 +$as_echo_n "checking if $CC supports-Wbad-function-cast... " >&6; } + cacheid=xorg_cv_cc_flag__Wbad_function_cast + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wold-style-definition" >&5 +$as_echo_n "checking if $CC supports-Wold-style-definition... " >&6; } + cacheid=xorg_cv_cc_flag__Wold_style_definition + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wdeclaration-after-statement" >&5 +$as_echo_n "checking if $CC supports-Wdeclaration-after-statement... " >&6; } + cacheid=xorg_cv_cc_flag__Wdeclaration_after_statement + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wunused" >&5 +$as_echo_n "checking if $CC supports-Wunused... " >&6; } + cacheid=xorg_cv_cc_flag__Wunused + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wuninitialized" >&5 +$as_echo_n "checking if $CC supports-Wuninitialized... " >&6; } + cacheid=xorg_cv_cc_flag__Wuninitialized + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wshadow" >&5 +$as_echo_n "checking if $CC supports-Wshadow... " >&6; } + cacheid=xorg_cv_cc_flag__Wshadow + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wcast-qual" >&5 +$as_echo_n "checking if $CC supports-Wcast-qual... " >&6; } + cacheid=xorg_cv_cc_flag__Wcast_qual + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wmissing-noreturn" >&5 +$as_echo_n "checking if $CC supports-Wmissing-noreturn... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_noreturn + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wmissing-format-attribute" >&5 +$as_echo_n "checking if $CC supports-Wmissing-format-attribute... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_format_attribute + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wredundant-decls" >&5 +$as_echo_n "checking if $CC supports-Wredundant-decls... " >&6; } + cacheid=xorg_cv_cc_flag__Wredundant_decls + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=implicit" >&5 +$as_echo_n "checking if $CC supports-Werror=implicit... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_implicit + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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:$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=xorg_cv_cc_flag__errwarn_E_NO_EXPLICIT_TYPE_GIVEN__errwarn_E_NO_IMPLICIT_DECL_ALLOWED + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=nonnull" >&5 +$as_echo_n "checking if $CC supports-Werror=nonnull... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_nonnull + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=init-self" >&5 +$as_echo_n "checking if $CC supports-Werror=init-self... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_init_self + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=main" >&5 +$as_echo_n "checking if $CC supports-Werror=main... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_main + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=missing-braces" >&5 +$as_echo_n "checking if $CC supports-Werror=missing-braces... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_missing_braces + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=sequence-point" >&5 +$as_echo_n "checking if $CC supports-Werror=sequence-point... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_sequence_point + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=return-type" >&5 +$as_echo_n "checking if $CC supports-Werror=return-type... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_return_type + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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:$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=xorg_cv_cc_flag__errwarn_E_FUNC_HAS_NO_RETURN_STMT + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=trigraphs" >&5 +$as_echo_n "checking if $CC supports-Werror=trigraphs... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_trigraphs + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=array-bounds" >&5 +$as_echo_n "checking if $CC supports-Werror=array-bounds... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_array_bounds + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=write-strings" >&5 +$as_echo_n "checking if $CC supports-Werror=write-strings... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_write_strings + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=address" >&5 +$as_echo_n "checking if $CC supports-Werror=address... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_address + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$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=xorg_cv_cc_flag__Werror_int_to_pointer_cast + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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:$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=xorg_cv_cc_flag__errwarn_E_BAD_PTR_INT_COMBINATION + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$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=xorg_cv_cc_flag__Werror_pointer_to_int_cast + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wimplicit" >&5 +$as_echo_n "checking if $CC supports-Wimplicit... " >&6; } + cacheid=xorg_cv_cc_flag__Wimplicit + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wnonnull" >&5 +$as_echo_n "checking if $CC supports-Wnonnull... " >&6; } + cacheid=xorg_cv_cc_flag__Wnonnull + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Winit-self" >&5 +$as_echo_n "checking if $CC supports-Winit-self... " >&6; } + cacheid=xorg_cv_cc_flag__Winit_self + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wmain" >&5 +$as_echo_n "checking if $CC supports-Wmain... " >&6; } + cacheid=xorg_cv_cc_flag__Wmain + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wmissing-braces" >&5 +$as_echo_n "checking if $CC supports-Wmissing-braces... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_braces + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wsequence-point" >&5 +$as_echo_n "checking if $CC supports-Wsequence-point... " >&6; } + cacheid=xorg_cv_cc_flag__Wsequence_point + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wreturn-type" >&5 +$as_echo_n "checking if $CC supports-Wreturn-type... " >&6; } + cacheid=xorg_cv_cc_flag__Wreturn_type + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wtrigraphs" >&5 +$as_echo_n "checking if $CC supports-Wtrigraphs... " >&6; } + cacheid=xorg_cv_cc_flag__Wtrigraphs + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Warray-bounds" >&5 +$as_echo_n "checking if $CC supports-Warray-bounds... " >&6; } + cacheid=xorg_cv_cc_flag__Warray_bounds + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wwrite-strings" >&5 +$as_echo_n "checking if $CC supports-Wwrite-strings... " >&6; } + cacheid=xorg_cv_cc_flag__Wwrite_strings + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Waddress" >&5 +$as_echo_n "checking if $CC supports-Waddress... " >&6; } + cacheid=xorg_cv_cc_flag__Waddress + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wint-to-pointer-cast" >&5 +$as_echo_n "checking if $CC supports-Wint-to-pointer-cast... " >&6; } + cacheid=xorg_cv_cc_flag__Wint_to_pointer_cast + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Wpointer-to-int-cast" >&5 +$as_echo_n "checking if $CC supports-Wpointer-to-int-cast... " >&6; } + cacheid=xorg_cv_cc_flag__Wpointer_to_int_cast + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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 + + + + + + + + +# Check whether --enable-strict-compilation was given. +if test "${enable_strict_compilation+set}" = set; then + enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval +else + STRICT_COMPILE=no +fi + + + + + + +STRICT_CFLAGS="" + + + + + + + + + + + + + +xorg_testset_save_CFLAGS="$CFLAGS" + +if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-pedantic" >&5 +$as_echo_n "checking if $CC supports-pedantic... " >&6; } + cacheid=xorg_cv_cc_flag__pedantic + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror" >&5 +$as_echo_n "checking if $CC supports-Werror... " >&6; } + cacheid=xorg_cv_cc_flag__Werror + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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:$LINENO: checking if $CC supports-errwarn" >&5 +$as_echo_n "checking if $CC supports-errwarn... " >&6; } + cacheid=xorg_cv_cc_flag__errwarn + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unknown_warning_option=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unknown_warning_option=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + xorg_cv_cc_flag_unused_command_line_argument=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + xorg_cv_cc_flag_unused_command_line_argument=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_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:$LINENO: checking if $CC supports-Werror=attributes" >&5 +$as_echo_n "checking if $CC supports-Werror=attributes... " >&6; } + cacheid=xorg_cv_cc_flag__Werror_attributes + if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval $cacheid=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval $cacheid=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:$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 + + + + + + +# Check whether --with-release-version was given. +if test "${with_release_version+set}" = set; then + withval=$with_release_version; RELEASE_VERSION="$withval" +else + RELEASE_VERSION="" +fi + + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 +$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;} + fi + + +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)" + + + + +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)" + + + + + + +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 + + + + + + + + + + + + + + + +XORG_MAN_PAGE="X Version 11" + +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'" + + + +AM_DEFAULT_VERBOSITY=1 + + + +am__api_version="1.9" +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(SHELL) $(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='xf86-video-openchrome' + VERSION='0.2.905' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 @@ -3731,6 +14484,159 @@ else fi + + +{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +# Checks for programs. +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=no +fi + + + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:$LINENO: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:$LINENO: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:$LINENO: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:$LINENO: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then @@ -3815,140 +14721,6 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - { $as_echo "$as_me:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then @@ -5178,7 +15950,6 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - if test -n "$ac_tool_prefix"; then for ac_prog in ar do @@ -7005,491 +17776,6 @@ $as_echo "$lt_cv_ld_force_load" >&6; } ;; esac -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if test `eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - for ac_header in dlfcn.h do @@ -12650,115 +22936,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - @@ -12796,6 +22973,14 @@ else fi +# Check whether --enable-viaregtool was given. +if test "${enable_viaregtool+set}" = set; then + enableval=$enable_viaregtool; TOOLS="$enableval" +else + TOOLS=no +fi + + # Checks for extensions SAVE_CFLAGS="$CFLAGS" @@ -13095,126 +23280,6 @@ $as_echo "$_EXT_CHECK" >&6; } # Checks for pkg-config packages - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi - -fi - pkg_failed=no { $as_echo "$as_me:$LINENO: checking for XORG" >&5 $as_echo_n "checking for XORG... " >&6; } @@ -14411,6 +24476,24 @@ fi +if test x$TOOLS = xyes; then + TOOLS_TRUE= + TOOLS_FALSE='#' +else + TOOLS_TRUE='#' + TOOLS_FALSE= +fi + +if test "$TOOLS" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TOOLS 1 +_ACEOF + +fi + + + DRIVER_NAME=openchrome @@ -14457,7 +24540,7 @@ $as_echo "$as_me: Building with package name set to $PACKAGE" >&6;} fi -ac_config_files="$ac_config_files Makefile libxvmc/Makefile man/Makefile src/Makefile" +ac_config_files="$ac_config_files Makefile libxvmc/Makefile man/Makefile src/Makefile tools/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -14556,13 +24639,6 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -14577,10 +24653,10 @@ $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -14626,6 +24702,13 @@ $as_echo "$as_me: error: conditional \"XV_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${TOOLS_TRUE}" && test -z "${TOOLS_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"TOOLS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"TOOLS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 @@ -14948,7 +25031,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-video-openchrome $as_me 0.2.904, which was +This file was extended by xf86-video-openchrome $as_me 0.2.905, which was generated by GNU Autoconf 2.62. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15001,7 +25084,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -xf86-video-openchrome config.status 0.2.904 +xf86-video-openchrome config.status 0.2.905 configured by $0, generated by GNU Autoconf 2.62, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -15407,6 +25490,7 @@ do "libxvmc/Makefile") CONFIG_FILES="$CONFIG_FILES libxvmc/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} diff --git a/driver/xf86-video-openchrome/configure.ac b/driver/xf86-video-openchrome/configure.ac index f0f7f3d00..c653cb5b7 100644 --- a/driver/xf86-video-openchrome/configure.ac +++ b/driver/xf86-video-openchrome/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-openchrome], - 0.2.904, + 0.2.905, [http://www.openchrome.org/trac/report/1], xf86-video-openchrome) @@ -30,6 +30,12 @@ AC_CONFIG_SRCDIR([Makefile.am]) AM_CONFIG_HEADER([config.h]) AC_CONFIG_AUX_DIR(.) +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.8) +XORG_DEFAULT_OPTIONS + AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE @@ -62,6 +68,11 @@ AC_ARG_ENABLE(xv-debug, AC_HELP_STRING([--enable-xv-debug], [XV_DEBUG="$enableval"], [XV_DEBUG=no]) +AC_ARG_ENABLE(viaregtool, AC_HELP_STRING([--enable-viaregtool], + [Enable build of registers dumper tool [[default=no]]]), + [TOOLS="$enableval"], + [TOOLS=no]) + # Checks for extensions XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(RENDER, renderproto) @@ -161,6 +172,11 @@ if test "$XV_DEBUG" = yes; then AC_DEFINE(XV_DEBUG,1,[Enable XVideo debug support]) fi +AM_CONDITIONAL(TOOLS, test x$TOOLS = xyes) +if test "$TOOLS" = yes; then + AC_DEFINE(TOOLS,1,[Enable build of registers dumper tool]) +fi + AC_SUBST([DRI_CFLAGS]) AC_SUBST([XORG_CFLAGS]) AC_SUBST([moduledir]) @@ -183,4 +199,5 @@ AC_OUTPUT([ libxvmc/Makefile man/Makefile src/Makefile + tools/Makefile ]) diff --git a/driver/xf86-video-openchrome/libxvmc/Makefile.in b/driver/xf86-video-openchrome/libxvmc/Makefile.in index 28f650b3f..1f81e4a61 100644 --- a/driver/xf86-video-openchrome/libxvmc/Makefile.in +++ b/driver/xf86-video-openchrome/libxvmc/Makefile.in @@ -95,25 +95,34 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ DRI_CFLAGS = @DRI_CFLAGS@ @@ -128,9 +137,12 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -140,6 +152,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -148,6 +162,9 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -168,12 +185,16 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ +TOOLS_FALSE = @TOOLS_FALSE@ +TOOLS_TRUE = @TOOLS_TRUE@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@ XVMC_CFLAGS = @XVMC_CFLAGS@ diff --git a/driver/xf86-video-openchrome/man/Makefile.in b/driver/xf86-video-openchrome/man/Makefile.in index 8ddec8e57..15ae47c7c 100644 --- a/driver/xf86-video-openchrome/man/Makefile.in +++ b/driver/xf86-video-openchrome/man/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.7 2012/03/13 21:35:51 matthieu Exp $ +# $Id: Makefile.in,v 1.8 2012/05/15 21:32:57 matthieu Exp $ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # @@ -86,25 +86,34 @@ drivermanDATA_INSTALL = $(INSTALL_DATA) DATA = $(driverman_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ DRI_CFLAGS = @DRI_CFLAGS@ @@ -119,9 +128,12 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -131,6 +143,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -139,6 +153,20 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -159,12 +187,16 @@ RANLIB = @RANLIB@ SED = sed SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ +TOOLS_FALSE = @TOOLS_FALSE@ +TOOLS_TRUE = @TOOLS_TRUE@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@ XVMC_CFLAGS = @XVMC_CFLAGS@ @@ -228,18 +260,6 @@ CLEANFILES = $(driverman_DATA) # Strings to replace in man pages XORGRELSTRING = @PACKAGE_STRING@ XORGMANNAME = X Version 11 -MAN_SUBSTS = \ - -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xservername__|Xorg|g' \ - -e 's|__xconfigfile__|xorg.conf|g' \ - -e 's|__projectroot__|$(prefix)|g' \ - -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ - -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ - -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ - -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ - -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' - SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man all: all-am diff --git a/driver/xf86-video-openchrome/man/openchrome.man b/driver/xf86-video-openchrome/man/openchrome.man index fae904c6a..e20b68ede 100644 --- a/driver/xf86-video-openchrome/man/openchrome.man +++ b/driver/xf86-video-openchrome/man/openchrome.man @@ -22,7 +22,7 @@ The .B openchrome driver supports the following chipsets: CLE266, KM400/KN400/KM400A/P4M800, CN400/PM800/PN800/PM880, K8M800, CN700/VM800/P4M800Pro, CX700, P4M890, K8M890, -P4M900/VN896/CN896, VX800 and VX855. +P4M900/VN896/CN896, VX800, VX855 and VX900. The driver includes 2D acceleration and Xv video overlay extensions. Flat panel, TV, and VGA outputs are supported, depending on the hardware configuration. @@ -59,16 +59,18 @@ are supported: .BI "Option \*qAccelMethod\*q \*q" string \*q The driver supports "XAA" and "EXA" acceleration methods. The default method is XAA, since EXA is still experimental. Contrary to XAA, EXA -implements acceleration for screen uploads and downlads (if DRI is +implements acceleration for screen uploads and downloads (if DRI is enabled) and for the Render/Composite extension. .TP .BI "Option \*qActiveDevice\*q \*q" string \*q Specifies the active device combination. Any string containing "CRT", "LCD", "DFP", "TV" should be possible. "CRT" represents anything that -is connected to the VGA port, "LCD" and "DFP" are for laptop panels -(not TFT screens attached to the VGA port), "TV" is self-explanatory. +is connected to the VGA port, "LCD" is for laptop panels (not TFT screens +attached to the VGA port), "DFP" is for screens connected to the DVI port, +"TV" is self-explanatory. The default is to use what is detected. The driver is currently unable -to use LCD and TV simultaneously, and will favour the LCD. +to use LCD and TV simultaneously, and will favour the LCD. The DVI port is +not properly probed and needs to be enabled with this option. .TP .BI "Option \*qAGPMem\*q \*q" integer \*q Sets the amount of AGP memory that is allocated at X server startup. @@ -81,7 +83,7 @@ EXA scratch area in AGP space, it will be allocated from VRAM. If there is no room for DRI textures, they will be allocated from the DRI part of VRAM (see the option "MaxDRIMem"). The default amount of AGP is 32768 kB. Note that the AGP aperture set in the BIOS must be able -to accomodate the amount of AGP memory specified here. Otherwise no +to accommodate the amount of AGP memory specified here. Otherwise no AGP memory will be available. It is safe to set a very large AGP aperture in the BIOS. .TP @@ -131,10 +133,10 @@ as possible to the EXA pixmap storage area. .TP .BI "Option \*qMigrationHeuristic\*q \*q" string \*q Sets the heuristic for EXA pixmap migration. This is an EXA core -option, and on Xorg server versions after 1.1.0 this defaults to -"smart". The openchrome driver performs best with "greedy", so you +option, and starting from __xservername__ server version 1.3.0 this defaults to +"always". The openchrome driver performs best with "greedy", so you should really add this option to your configuration file. The third -possibility is "always", which might become more useful in the future. +possibility is "smart". .TP .BI "Option \*qNoAccel\*q \*q" boolean \*q Disables the use of hardware acceleration. Acceleration is enabled @@ -159,9 +161,16 @@ Specifies the size (width x height) of the LCD panel attached to the system. The sizes 640x480, 800x600, 1024x768, 1280x1024, and 1400x1050 are supported. .TP +.BI "Option \*qRotationType\*q \*q" string \*q +Enabled rotation by using RandR. The driver only support unaccelerated +RandR rotations "SWRandR". Hardware rotations "HWRandR" is currently +unimplemented. +.TP .BI "Option \*qRotate\*q \*q" string \*q Rotates the display either clockwise ("CW"), counterclockwise ("CCW") and -upside-down ("UD"). Rotation is only supported unaccelerated. +upside-down ("UD"). Rotation is only supported unaccelerated. Adding +option "Rotate", enables RandR rotation feature. The RandR allows +clients to dynamically change X screens. .TP .BI "Option \*qShadowFB\*q \*q" boolean \*q Enables the use of a shadow frame buffer. This is required when @@ -234,6 +243,6 @@ overscan). These modes are made available by the driver; modelines provided in __xconfigfile__ will be ignored. .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), EXA(__filemansuffix__), Xv(__filemansuffix__) .SH AUTHORS Authors include: ... diff --git a/driver/xf86-video-openchrome/src/Makefile.am b/driver/xf86-video-openchrome/src/Makefile.am index cdc650596..a5a6c6c4d 100644 --- a/driver/xf86-video-openchrome/src/Makefile.am +++ b/driver/xf86-video-openchrome/src/Makefile.am @@ -24,9 +24,9 @@ # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -BUILT_SOURCES = svnversion.h -EXTRA_DIST = svnversion.h -CONFIG_CLEAN_FILES= svnversion.h +BUILT_SOURCES = version.h +EXTRA_DIST = version.h +CONFIG_CLEAN_FILES= version.h AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ openchrome_drv_la_LTLIBRARIES = openchrome_drv.la openchrome_drv_la_LDFLAGS = -module -avoid-version @@ -92,21 +92,26 @@ EXTRA_DIST += \ endif -via_driver.lo: svnversion.h -svnversion.h: $(openchrome_drv_la_SOURCES) - @if [ -d .svn ]; then \ - echo '#define BUILDCOMMENT "(development build, at svn revision '\ - "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \ - else \ - date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \ - > $@.tmp; \ - fi +via_driver.lo: version.h +version.h: $(openchrome_drv_la_SOURCES) + @if [ -d ../.git ]; then \ + echo '#define BUILDCOMMENT "(developement build, at revision '\ + "`git log -1 --pretty=format:%h | head -1`"')"' > $@.tmp; \ + else \ + if [ -d .svn ]; then \ + echo '#define BUILDCOMMENT "(development build, at revision '\ + "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \ + else \ + date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \ + > $@.tmp; \ + fi; \ + fi @chmod 666 $@.tmp @mv $@.tmp $@ @echo "created $@" dist-hook: - rm svnversion.h; + rm version.h; echo '#define BUILDCOMMENT "(openchrome '$(VERSION)' release)"' \ - > svnversion.h + > version.h diff --git a/driver/xf86-video-openchrome/src/Makefile.in b/driver/xf86-video-openchrome/src/Makefile.in index 5e85617b9..871539297 100644 --- a/driver/xf86-video-openchrome/src/Makefile.in +++ b/driver/xf86-video-openchrome/src/Makefile.in @@ -130,25 +130,34 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_FALSE = @DEBUG_FALSE@ DEBUG_TRUE = @DEBUG_TRUE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ DRI_CFLAGS = @DRI_CFLAGS@ @@ -163,9 +172,12 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ +INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -175,6 +187,8 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -183,6 +197,9 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -203,12 +220,16 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ +TOOLS_FALSE = @TOOLS_FALSE@ +TOOLS_TRUE = @TOOLS_TRUE@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@ XVMC_CFLAGS = @XVMC_CFLAGS@ @@ -263,9 +284,9 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -BUILT_SOURCES = svnversion.h -EXTRA_DIST = svnversion.h $(am__append_2) -CONFIG_CLEAN_FILES = svnversion.h +BUILT_SOURCES = version.h +EXTRA_DIST = version.h $(am__append_2) +CONFIG_CLEAN_FILES = version.h AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ openchrome_drv_la_LTLIBRARIES = openchrome_drv.la openchrome_drv_la_LDFLAGS = -module -avoid-version @@ -584,24 +605,29 @@ uninstall-am: uninstall-info-am uninstall-openchrome_drv_laLTLIBRARIES uninstall-openchrome_drv_laLTLIBRARIES -via_driver.lo: svnversion.h -svnversion.h: $(openchrome_drv_la_SOURCES) - @if [ -d .svn ]; then \ - echo '#define BUILDCOMMENT "(development build, at svn revision '\ - "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \ - else \ - date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \ - > $@.tmp; \ - fi +via_driver.lo: version.h +version.h: $(openchrome_drv_la_SOURCES) + @if [ -d ../.git ]; then \ + echo '#define BUILDCOMMENT "(developement build, at revision '\ + "`git log -1 --pretty=format:%h | head -1`"')"' > $@.tmp; \ + else \ + if [ -d .svn ]; then \ + echo '#define BUILDCOMMENT "(development build, at revision '\ + "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \ + else \ + date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \ + > $@.tmp; \ + fi; \ + fi @chmod 666 $@.tmp @mv $@.tmp $@ @echo "created $@" dist-hook: - rm svnversion.h; + rm version.h; echo '#define BUILDCOMMENT "(openchrome '$(VERSION)' release)"' \ - > svnversion.h + > version.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/driver/xf86-video-openchrome/src/svnversion.h b/driver/xf86-video-openchrome/src/svnversion.h deleted file mode 100644 index 5a7f5acaa..000000000 --- a/driver/xf86-video-openchrome/src/svnversion.h +++ /dev/null @@ -1 +0,0 @@ -#define BUILDCOMMENT "(openchrome 0.2.904 release)" diff --git a/driver/xf86-video-openchrome/src/version.h b/driver/xf86-video-openchrome/src/version.h new file mode 100644 index 000000000..7062c5fbb --- /dev/null +++ b/driver/xf86-video-openchrome/src/version.h @@ -0,0 +1 @@ +#define BUILDCOMMENT "(openchrome 0.2.905 release)" diff --git a/driver/xf86-video-openchrome/src/via.h b/driver/xf86-video-openchrome/src/via.h index c961e1a51..9d886d598 100644 --- a/driver/xf86-video-openchrome/src/via.h +++ b/driver/xf86-video-openchrome/src/via.h @@ -34,7 +34,7 @@ /* Video Engines */ #define VIDEO_ENGINE_UNK 0 /* Unknown video engine */ -#define VIDEO_ENGINE_CLE 1 /* CLE First generaion video engine */ +#define VIDEO_ENGINE_CLE 1 /* CLE First generation video engine */ #define VIDEO_ENGINE_CME 2 /* CME Second generation video engine */ /* Video status flag */ @@ -215,6 +215,9 @@ #define HQV_DST_STRIDE 0x1F4 #define HQV_SRC_STRIDE 0x1F8 +#define HQV_H_SCALE_CONTROL 0x1B0 +#define HQV_V_SCALE_CONTROL 0x1B4 + #define PRO_HQV1_OFFSET 0x1000 /* * Video command definition @@ -515,6 +518,22 @@ #define HQV_FIFO_STATUS 0x00001000 #define HQV_GEN_IRQ 0x00000080 #define HQV_FIFO_DEPTH_1 0x00010000 +/* for CME engine */ +#define HQV_SW_FLIP_QUEUE_ENABLE 0x00100000 + +/* for hwDiff->dwNewScaleCtl */ +#define HQV_H_SCALE_ENABLE 0x80000000 +#define HQV_H_SCALE_UP 0x00000000 +#define HQV_H_SCALE_DOWN_FOURTH_TO_1 0x10000000 +#define HQV_H_SCALE_DOWN_FOURTH_TO_EIGHTH 0x20000000 +#define HQV_H_SCALE_DOWN_UNDER_EIGHTH 0x30000000 + +#define HQV_V_SCALE_ENABLE 0x80000000 +#define HQV_V_SCALE_UP 0x00000000 +#define HQV_V_SCALE_DOWN 0x10000000 + +/* HQV Default Vodeo Color 0x3B8 */ +#define HQV_FIX_COLOR 0x0643212c /* HQV_FILTER_CONTROL 0x3E4 */ #define HQV_H_LOWPASS_2TAP 0x00000001 @@ -575,6 +594,25 @@ #define HQV_VDEBLOCK_FILTER 0x80000000 #define HQV_HDEBLOCK_FILTER 0x00008000 +/* new added registers for VT3409.For some registers have different meanings + * but the same address,we add postfix _409 to distinguish */ +#define HQV_COLOR_ADJUSTMENT_PRE_CTRL1 0x160 +#define HQV_COLOR_ADJUSTMENT_PRE_CTRL2 0x164 +#define HQV_COLOR_ADJUSTMENT_PRE_CTRL3 0x168 +#define HQV_COLOR_ADJUSTMENT_PRE_CTRL4 0x16C +#define HQV_SRC_DATA_OFFSET_CTRL1_409 0x170 +#define HQV_SRC_DATA_OFFSET_CTRL2_409 0x174 +#define HQV_SRC_DATA_OFFSET_CTRL3_409 0x178 +#define HQV_SRC_DATA_OFFSET_CTRL4_409 0x17C +#define HQV_DST_DATA_OFFSET_CTRL1 0x180 +#define HQV_DST_DATA_OFFSET_CTRL2 0x184 +#define HQV_DST_DATA_OFFSET_CTRL3 0x188 +#define HQV_DST_DATA_OFFSET_CTRL4 0x18C +#define HQV_RESIDUE_PIXEL_FRAME_STARTADDR 0x1BC +#define HQV_BACKGROUND_DATA_OFFSET 0x1CC +#define HQV_SUBP_HSCALE_CTRL 0x1E0 +#define HQV_SUBP_VSCALE_CTRL 0x1E8 + /* Add new HQV Registers for VT3353: */ #define HQV_SRC_DATA_OFFSET_CONTROL1 0x180 #define HQV_SRC_DATA_OFFSET_CONTROL2 0x184 @@ -588,6 +626,7 @@ #define HQV_COLOR_ADJUSTMENT_CONTROL2 0x1A4 #define HQV_COLOR_ADJUSTMENT_CONTROL3 0x1A8 #define HQV_COLOR_ADJUSTMENT_CONTROL5 0x1AC +#define HQV_DEFAULT_VIDEO_COLOR 0x1B8 #define CHROMA_KEY_LOW 0x00FFFFFF #define CHROMA_KEY_HIGH 0x00FFFFFF diff --git a/driver/xf86-video-openchrome/src/via_accel.c b/driver/xf86-video-openchrome/src/via_accel.c index b3c825de0..2cff9a9fa 100644 --- a/driver/xf86-video-openchrome/src/via_accel.c +++ b/driver/xf86-video-openchrome/src/via_accel.c @@ -196,6 +196,7 @@ viaFlushPCI(ViaCommandBuffer * buf) switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: + case VIA_VX900: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5)) && (loop++ < MAXLOOP)) ; @@ -287,7 +288,7 @@ viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer * buf, unsigned size) buf->pScrn = pScrn; buf->bufSize = ((size == 0) ? VIA_DMASIZE : size) >> 2; - buf->buf = (CARD32 *) xcalloc(buf->bufSize, sizeof(CARD32)); + buf->buf = (CARD32 *) calloc(buf->bufSize, sizeof(CARD32)); if (!buf->buf) return BadAlloc; buf->waitFlags = 0; @@ -312,7 +313,7 @@ void viaTearDownCBuffer(ViaCommandBuffer * buf) { if (buf && buf->buf) - xfree(buf->buf); + free(buf->buf); buf->buf = NULL; } @@ -417,6 +418,9 @@ viaDisableVQ(ScrnInfoPtr pScrn) switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + case VIA_VX900: VIASETREG(0x41c, 0x00100000); VIASETREG(0x420, 0x74301000); break; @@ -472,16 +476,25 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn) VIASETREG(i, 0x0); } - if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) { - for (i = 0x44; i < 0x5c; i += 4) { + if (pVia->Chipset == VIA_VX800 || + pVia->Chipset == VIA_VX855 || + pVia->Chipset == VIA_VX900) { + for (i = 0x44; i <= 0x5c; i += 4) { VIASETREG(i, 0x0); } } + if (pVia->Chipset == VIA_VX900) + { + /*410 redefine 0x30 34 38*/ + VIASETREG(0x60, 0x0); /*already useable here*/ + } + /* Make the VIA_REG() macro magic work */ switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: + case VIA_VX900: pVia->TwodRegs = via_2d_regs_m1; break; default: @@ -492,6 +505,9 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn) switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + case VIA_VX900: viaInitPCIe(pVia); break; default: @@ -503,6 +519,9 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn) switch (pVia->Chipset) { case VIA_K8M890: case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + case VIA_VX900: viaEnablePCIeVQ(pVia); break; default: @@ -530,6 +549,7 @@ viaAccelSync(ScrnInfoPtr pScrn) switch (pVia->Chipset) { case VIA_VX800: case VIA_VX855: + case VIA_VX900: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5 | VIA_3D_ENG_BUSY_H5)) && (loop++ < MAXLOOP)) ; @@ -582,7 +602,7 @@ viaDisableClipping(ScrnInfoPtr pScrn) /* * This is a small helper to wrap around a PITCH register write - * to deal with the sublte differences of M1 and old 2D engine + * to deal with the subtle differences of M1 and old 2D engine */ static void viaPitchHelper(VIAPtr pVia, unsigned dstPitch, unsigned srcPitch) @@ -590,7 +610,9 @@ viaPitchHelper(VIAPtr pVia, unsigned dstPitch, unsigned srcPitch) unsigned val = (dstPitch >> 3) << 16 | (srcPitch >> 3); RING_VARS; - if (pVia->Chipset != VIA_VX800 && pVia->Chipset != VIA_VX855) { + if (pVia->Chipset != VIA_VX800 && + pVia->Chipset != VIA_VX855 && + pVia->Chipset != VIA_VX900) { val |= VIA_PITCH_ENABLE; } OUT_RING_H1(VIA_REG(pVia, PITCH), val); @@ -759,6 +781,7 @@ viaSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, tdc->cmd = cmd; viaAccelTransparentHelper(pVia, (trans_color != -1) ? 0x4000 : 0x0000, trans_color, FALSE); + ADVANCE_RING; } static void @@ -796,6 +819,7 @@ viaSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, unsigned planemask) tdc->cmd = VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | VIAACCELPATTERNROP(rop); tdc->fgColor = color; viaAccelTransparentHelper(pVia, 0x00, 0x00, FALSE); + ADVANCE_RING; } static void @@ -852,6 +876,7 @@ viaSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattern0, int pattern1, tdc->pattern0 = pattern0; tdc->pattern1 = pattern1; viaAccelTransparentHelper(pVia, 0x00, 0x00, FALSE); + ADVANCE_RING; } static void @@ -901,6 +926,7 @@ viaSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patternx, int patterny, tdc->patternAddr = (patternx * pVia->Bpp + patterny * pVia->Bpl); viaAccelTransparentHelper(pVia, (trans_color != -1) ? 0x4000 : 0x0000, trans_color, FALSE); + ADVANCE_RING; } static void @@ -962,9 +988,9 @@ viaSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg, tdc->fgColor = fg; tdc->bgColor = bg; - ADVANCE_RING; - viaAccelTransparentHelper(pVia, 0x0, 0x0, FALSE); + + ADVANCE_RING; } static void @@ -991,7 +1017,7 @@ viaSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, pScrn->fbOffset + sub * pVia->Bpl, tdc->mode, pVia->Bpl, pVia->Bpl, tdc->cmd); - viaFlushPCI(cb); + ADVANCE_RING; viaDisableClipping(pScrn); } @@ -1005,9 +1031,9 @@ viaSetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned planemask, RING_VARS; tdc->cmd = VIA_GEC_BLT | VIA_GEC_SRC_SYS | VIAACCELCOPYROP(rop); - ADVANCE_RING; viaAccelTransparentHelper(pVia, (trans_color != -1) ? 0x4000 : 0x0000, trans_color, FALSE); + ADVANCE_RING; } static void @@ -1030,7 +1056,7 @@ viaSubsequentImageWriteRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, pScrn->fbOffset + pVia->Bpl * sub, tdc->mode, pVia->Bpl, pVia->Bpl, tdc->cmd); - viaFlushPCI(cb); + ADVANCE_RING; viaDisableClipping(pScrn); } @@ -1052,6 +1078,7 @@ viaSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop, OUT_RING_H1(VIA_REG(pVia, GEMODE), tdc->mode); OUT_RING_H1(VIA_REG(pVia, MONOPAT0), 0xFF); OUT_RING_H1(VIA_REG(pVia, MONOPATFGC), tdc->fgColor); + ADVANCE_RING; } static void @@ -1189,6 +1216,7 @@ viaSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop, OUT_RING_H1(VIA_REG(pVia, MONOPATFGC), tdc->fgColor); OUT_RING_H1(VIA_REG(pVia, MONOPATBGC), tdc->bgColor); OUT_RING_H1(VIA_REG(pVia, MONOPAT0), tdc->pattern0); + ADVANCE_RING; } static void @@ -1210,7 +1238,8 @@ viaInitXAA(ScreenPtr pScreen) /* General acceleration flags. */ xaaptr->Flags = (PIXMAP_CACHE | - OFFSCREEN_PIXMAPS | LINEAR_FRAMEBUFFER | + OFFSCREEN_PIXMAPS | + LINEAR_FRAMEBUFFER | MICROSOFT_ZERO_LINE_BIAS | 0); if (pScrn->bitsPerPixel == 8) @@ -1218,24 +1247,31 @@ viaInitXAA(ScreenPtr pScreen) xaaptr->SetClippingRectangle = viaSetClippingRectangle; xaaptr->DisableClipping = viaDisableClipping; - xaaptr->ClippingFlags = (HARDWARE_CLIP_SOLID_FILL | - HARDWARE_CLIP_SOLID_LINE | - HARDWARE_CLIP_DASHED_LINE | - HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | + xaaptr->ClippingFlags = (HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | HARDWARE_CLIP_MONO_8x8_FILL | HARDWARE_CLIP_COLOR_8x8_FILL | HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND | 0); + if (pVia->Chipset != VIA_VX800 && + pVia->Chipset != VIA_VX855 && + pVia->Chipset != VIA_VX900) + xaaptr->ClippingFlags |= (HARDWARE_CLIP_SOLID_FILL | + HARDWARE_CLIP_SOLID_LINE | + HARDWARE_CLIP_DASHED_LINE); + xaaptr->Sync = viaAccelSync; + /* ScreenToScreen copies */ xaaptr->SetupForScreenToScreenCopy = viaSetupForScreenToScreenCopy; xaaptr->SubsequentScreenToScreenCopy = viaSubsequentScreenToScreenCopy; xaaptr->ScreenToScreenCopyFlags = NO_PLANEMASK | ROP_NEEDS_SOURCE; + /* Solid filled rectangles */ xaaptr->SetupForSolidFill = viaSetupForSolidFill; xaaptr->SubsequentSolidFillRect = viaSubsequentSolidFillRect; xaaptr->SolidFillFlags = NO_PLANEMASK | ROP_NEEDS_SOURCE; + /* Mono 8x8 pattern fills */ xaaptr->SetupForMono8x8PatternFill = viaSetupForMono8x8PatternFill; xaaptr->SubsequentMono8x8PatternFillRect = viaSubsequentMono8x8PatternFillRect; @@ -1244,6 +1280,7 @@ viaInitXAA(ScreenPtr pScreen) HARDWARE_PATTERN_PROGRAMMED_ORIGIN | BIT_ORDER_IN_BYTE_MSBFIRST | 0); + /* Color 8x8 pattern fills */ xaaptr->SetupForColor8x8PatternFill = viaSetupForColor8x8PatternFill; xaaptr->SubsequentColor8x8PatternFillRect = viaSubsequentColor8x8PatternFillRect; @@ -1252,12 +1289,14 @@ viaInitXAA(ScreenPtr pScreen) HARDWARE_PATTERN_PROGRAMMED_BITS | HARDWARE_PATTERN_PROGRAMMED_ORIGIN | 0); + /* Solid lines */ xaaptr->SetupForSolidLine = viaSetupForSolidLine; xaaptr->SubsequentSolidTwoPointLine = viaSubsequentSolidTwoPointLine; xaaptr->SubsequentSolidHorVertLine = viaSubsequentSolidHorVertLine; xaaptr->SolidBresenhamLineErrorTermBits = 14; xaaptr->SolidLineFlags = NO_PLANEMASK | ROP_NEEDS_SOURCE; + /* Dashed line */ xaaptr->SetupForDashedLine = viaSetupForDashedLine; xaaptr->SubsequentDashedTwoPointLine = viaSubsequentDashedTwoPointLine; xaaptr->DashPatternMaxLength = 8; @@ -1266,49 +1305,50 @@ viaInitXAA(ScreenPtr pScreen) LINE_PATTERN_POWER_OF_2_ONLY | LINE_PATTERN_MSBFIRST_LSBJUSTIFIED | 0); + /* CPU to Screen color expansion */ xaaptr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK | - CPU_TRANSFER_PAD_DWORD | - SCANLINE_PAD_DWORD | - BIT_ORDER_IN_BYTE_MSBFIRST | - LEFT_EDGE_CLIPPING | ROP_NEEDS_SOURCE | 0; + CPU_TRANSFER_PAD_DWORD | + SCANLINE_PAD_DWORD | + BIT_ORDER_IN_BYTE_MSBFIRST | + LEFT_EDGE_CLIPPING | + ROP_NEEDS_SOURCE | 0; xaaptr->SetupForScanlineCPUToScreenColorExpandFill = viaSetupForCPUToScreenColorExpandFill; xaaptr->SubsequentScanlineCPUToScreenColorExpandFill = viaSubsequentScanlineCPUToScreenColorExpandFill; xaaptr->ColorExpandBase = pVia->BltBase; - xaaptr->ColorExpandRange = VIA_MMIO_BLTSIZE; + if (pVia->Chipset == VIA_VX800 || + pVia->Chipset == VIA_VX855 || + pVia->Chipset == VIA_VX900) + xaaptr->ColorExpandRange = VIA_MMIO_BLTSIZE; + else + xaaptr->ColorExpandRange = (64 * 1024); + /* ImageWrite */ xaaptr->ImageWriteFlags = (NO_PLANEMASK | CPU_TRANSFER_PAD_DWORD | SCANLINE_PAD_DWORD | BIT_ORDER_IN_BYTE_MSBFIRST | - LEFT_EDGE_CLIPPING | ROP_NEEDS_SOURCE | 0); - // SYNC_AFTER_IMAGE_WRITE | 0); + LEFT_EDGE_CLIPPING | + ROP_NEEDS_SOURCE | + NO_GXCOPY | 0); /* * Most Unichromes are much faster using processor-to-framebuffer writes * than when using the 2D engine for this. - * test with x11perf -shmput500! + * test with "x11perf -shmput500" + * Example: K8M890 chipset; with GPU=86.3/sec; without GPU=132.0/sec + * TODO Check speed for other chipsets */ - switch (pVia->Chipset) { - case VIA_K8M800: - case VIA_K8M890: - case VIA_P4M900: - case VIA_VX800: - case VIA_VX855: - break; - default: - xaaptr->ImageWriteFlags |= NO_GXCOPY; - break; - } - xaaptr->SetupForImageWrite = viaSetupForImageWrite; xaaptr->SubsequentImageWriteRect = viaSubsequentImageWriteRect; xaaptr->ImageWriteBase = pVia->BltBase; - if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) + if (pVia->Chipset == VIA_VX800 || + pVia->Chipset == VIA_VX855 || + pVia->Chipset == VIA_VX900) xaaptr->ImageWriteRange = VIA_MMIO_BLTSIZE; else xaaptr->ImageWriteRange = (64 * 1024); @@ -2162,6 +2202,13 @@ viaExaPrepareComposite(int op, PicturePtr pSrcPicture, Bool isAGP; unsigned long offset; + /* Workaround: EXA crash with new libcairo2 on a VIA VX800 (#298) */ + /* TODO Add real source only pictures */ + if (!pSrc) { + ErrorF("pSrc is NULL\n"); + return FALSE; + } + v3d->setDestination(v3d, exaGetPixmapOffset(pDst), exaGetPixmapPitch(pDst), pDstPicture->format); v3d->setCompositeOperator(v3d, op); @@ -2344,7 +2391,7 @@ viaInitExa(ScreenPtr pScreen) } if (!exaDriverInit(pScreen, pExa)) { - xfree(pExa); + free(pExa); return NULL; } @@ -2354,7 +2401,7 @@ viaInitExa(ScreenPtr pScreen) /* - * Acceleration initializatuon function. Sets up offscreen memory disposition, + * Acceleration initialization function. Sets up offscreen memory disposition, * and initializes engines and acceleration method. */ Bool @@ -2542,7 +2589,7 @@ viaExitAccel(ScreenPtr pScreen) } } if (pVia->dBounce) - xfree(pVia->dBounce); + free(pVia->dBounce); #endif /* OPENCHROMEDRI */ if (pVia->scratchAddr) { exaOffscreenFree(pScreen, pVia->scratchFBBuffer); @@ -2551,7 +2598,7 @@ viaExitAccel(ScreenPtr pScreen) if (pVia->exaDriverPtr) { exaDriverFini(pScreen); } - xfree(pVia->exaDriverPtr); + free(pVia->exaDriverPtr); pVia->exaDriverPtr = NULL; return; } @@ -2577,7 +2624,7 @@ viaFinishInitAccel(ScreenPtr pScreen) if (pVia->directRenderingEnabled && pVia->useEXA) { - pVia->dBounce = xcalloc(VIA_DMA_DL_SIZE * 2, 1); + pVia->dBounce = calloc(VIA_DMA_DL_SIZE * 2, 1); if (!pVia->IsPCI) { diff --git a/driver/xf86-video-openchrome/src/via_bandwidth.c b/driver/xf86-video-openchrome/src/via_bandwidth.c index fd02a6620..2b413b80a 100644 --- a/driver/xf86-video-openchrome/src/via_bandwidth.c +++ b/driver/xf86-video-openchrome/src/via_bandwidth.c @@ -194,6 +194,7 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) else ViaSeqMask(hwp, 0x22, 0x00, 0x1F); /* 128/4 = overflow = 0 */ break; + /* PM800/PM880/CN400 */ case VIA_PM800: hwp->writeSeq(hwp, 0x17, 0x5F); /* 95 */ ViaSeqMask(hwp, 0x16, 0x20, 0xBF); /* 32 */ @@ -204,9 +205,10 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) else ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 31 */ break; + /* P4M800Pro/VN800/CN700 */ case VIA_VM800: hwp->writeSeq(hwp, 0x17, 0x2F); - ViaSeqMask(hwp, 0x16, 0x14, 0xBF); + ViaSeqMask(hwp, 0x16, 0x14, 0xBF); /* 80/4 = 20 = 0x14 */ ViaSeqMask(hwp, 0x18, 0x08, 0xBF); if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) @@ -215,40 +217,60 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaSeqMask(hwp, 0x22, 0x00, 0x1F); break; case VIA_K8M890: - hwp->writeSeq(hwp, 0x16, 0x92); - hwp->writeSeq(hwp, 0x17, 0xB3); - hwp->writeSeq(hwp, 0x18, 0x8A); + /* depth location: {SR17,0,7} */ + hwp->writeSeq(hwp, 0x17, 0xB3); /* 360/2-1 = 179 = 0xB3 */ + /* Formula (x & 0x3F) | ((x & 0x40) << 1) */ + /* threshold location: {SR16,0,5},{SR16,7,7} */ + ViaSeqMask(hwp, 0x16, 0x92, 0xBF); /* 328/4 = 82 = 0x52 */ + /* high threshold location: {SR18,0,5},{SR18,7,7} */ + ViaSeqMask(hwp, 0x18, 0x8A, 0xBF); /* 296/4 = 74 = 0x4A */ + /* display queue expire num location: {SR22,0,4}. */ + ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 124/4 = 31 = 0x1F */ break; case VIA_P4M900: - ViaSeqMask(hwp, 0x17, 0x2F, 0xFF); - ViaSeqMask(hwp, 0x16, 0x13, 0x3F); - ViaSeqMask(hwp, 0x16, 0x00, 0x80); - ViaSeqMask(hwp, 0x18, 0x13, 0x3F); - ViaSeqMask(hwp, 0x18, 0x00, 0x80); + /* location: {SR17,0,7} */ + hwp->writeSeq(hwp, 0x17, 0x2F); /* 96/2-1 = 47 = 0x2F */ + /* location: {SR16,0,5},{SR16,7,7} */ + ViaSeqMask(hwp, 0x16, 0x13, 0xBF); /* 76/4 = 19 = 0x13 */ + /* location: {SR18,0,5},{SR18,7,7} */ + ViaSeqMask(hwp, 0x18, 0x13, 0xBF); /* 76/4 = 19 = 0x13 */ + /* location: {SR22,0,4}. */ + ViaSeqMask(hwp, 0x22, 0x08, 0x1F); /* 32/4 = 8 = 0x08 */ break; case VIA_P4M890: - hwp->writeSeq(hwp, 0x16, 0x13); - hwp->writeSeq(hwp, 0x17, 0x2F); - hwp->writeSeq(hwp, 0x18, 0x53); - hwp->writeSeq(hwp, 0x22, 0x10); + hwp->writeSeq(hwp, 0x17, 0x2F); /* 96/2-1 = 47 = 0x2F */ + ViaSeqMask(hwp, 0x16, 0x13, 0xBF); /* 76/4 = 19 = 0x13 */ + ViaSeqMask(hwp, 0x18, 0x10, 0xBF); /* 64/4 = 16 = 0x10 */ + ViaSeqMask(hwp, 0x22, 0x08, 0x1F); /* 32/4 = 8 = 0x08 */ break; case VIA_CX700: - hwp->writeSeq(hwp, 0x16, 0x26); hwp->writeSeq(hwp, 0x17, 0x5F); - hwp->writeSeq(hwp, 0x18, 0x66); - hwp->writeSeq(hwp, 0x22, 0x1F); + ViaSeqMask(hwp, 0x16, 0x20, 0xBF); /* 128/4 = 32 = 0x20 */ + ViaSeqMask(hwp, 0x18, 0x20, 0xBF); /* 128/4 = 32 = 0x20 */ + ViaSeqMask(hwp, 0x22, 0x1F, 0x1F); /* 124/4 = 31 = 0x1F */ break; case VIA_VX800: - hwp->writeSeq(hwp, 0x16, 0x26); /* 152/4 = 38 */ - hwp->writeSeq(hwp, 0x17, 0x5F); /* 192/2-1 = 95 */ + hwp->writeSeq(hwp, 0x17, 0x5F); /* 192/2-1 = 95 = 0x5F */ + hwp->writeSeq(hwp, 0x16, 0x26); /* 152/4 = 38 = 0x26 */ hwp->writeSeq(hwp, 0x18, 0x26); /* 152/4 = 38 */ hwp->writeSeq(hwp, 0x22, 0x10); /* 64/4 = 16 */ break; case VIA_VX855: - hwp->writeSeq(hwp, 0x16, 0x50); /* 320/4 = 80 */ - hwp->writeSeq(hwp, 0x17, 0xC7); /* 400/2-1 = 199 */ - hwp->writeSeq(hwp, 0x18, 0x50); /* 320/4 = 80 */ - hwp->writeSeq(hwp, 0x22, 0x28); /* 160/4 = 40 */ + hwp->writeSeq(hwp, 0x17, 0xC7); /* 400/2-1 = 199 = 0xC7 */ + /* Formula for {SR16,0,5},{SR16,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ + hwp->writeSeq(hwp, 0x16, 0x90); /* 320/4 = 80 = 0x50 */ + /* Formula for {SR18,0,5},{SR18,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ + hwp->writeSeq(hwp, 0x18, 0x90); /* 320/4 = 80 = 0x50 */ + hwp->writeSeq(hwp, 0x22, 0x28); /* 160/4 = 40 = 0x28 */ + break; + case VIA_VX900: + hwp->writeSeq(hwp, 0x17, 0xC7); /* 400/2-1 = 199 = 0xC7 */ + /* Formula for {SR16,0,5},{SR16,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ + hwp->writeSeq(hwp, 0x16, 0x90); /* 320/4 = 80 = 0x50 */ + /* Formula for {SR18,0,5},{SR18,7,7} is: (0x50 & 0x3F) | ((0x50 & 0x40) << 1) = 0x90 */ + hwp->writeSeq(hwp, 0x18, 0x90); /* 320/4 = 80 = 0x50 */ + hwp->writeSeq(hwp, 0x22, 0x28); /* 160/4 = 40 = 0x28 */ + break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetPrimaryFIFO: " "Chipset %d not implemented\n", pVia->Chipset); @@ -371,7 +393,38 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); break; case VIA_P4M890: + /* depth location: {CR68,4,7},{CR94,7,7},{CR95,7,7} */ + ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); /* 96/8-1 = 11 = 0x0B */ + ViaCrtcMask(hwp, 0x94, 0x00, 0x80); + ViaCrtcMask(hwp, 0x95, 0x00, 0x80); + + /* location: {CR68,0,3},{CR95,4,6} */ + ViaCrtcMask(hwp, 0x68, 0x03, 0x0F); /* 76/4 = 19 = 0x13 */ + ViaCrtcMask(hwp, 0x95, 0x10, 0x70); + + /* location: {CR92,0,3},{CR95,0,2} */ + ViaCrtcMask(hwp, 0x92, 0x00, 0x0F); /* 64/4 = 16 = 0x10 */ + ViaCrtcMask(hwp, 0x95, 0x01, 0x07); + + /* location: {CR94,0,6} */ + ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); /* 32/4 = 8 = 0x08 */ + break; case VIA_K8M890: + /* Display Queue Depth, location: {CR68,4,7},{CR94,7,7},{CR95,7,7} */ + ViaCrtcMask(hwp, 0x68, 0xC0, 0xF0); /* 360/8-1 = 44 = 0x2C; 0x2C << 4 = 0xC0 */ + ViaCrtcMask(hwp, 0x94, 0x00, 0x80); /* 0x2C << 3 = 0x00 */ + ViaCrtcMask(hwp, 0x95, 0x80, 0x80); /* 0x2C << 2 = 0x80 */ + + /* Display Queue Read Threshold 1, location: {CR68,0,3},{CR95,4,6} */ + ViaCrtcMask(hwp, 0x68, 0x02, 0x0F); /* 328/4 = 82 = 0x52 */ + ViaCrtcMask(hwp, 0x95, 0x50, 0x70); + + /* location: {CR92,0,3},{CR95,0,2} */ + ViaCrtcMask(hwp, 0x92, 0x0A, 0x0F); /* 296/4 = 74 = 0x4A */ + ViaCrtcMask(hwp, 0x95, 0x04, 0x07); /* 0x4A >> 4 = 0x04 */ + + /* Display Expire Number Bits, location: {CR94,0,6} */ + ViaCrtcMask(hwp, 0x94, 0x1F, 0x7F); /* 124/4 = 31 = 0x1F */ break; case VIA_P4M900: ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); @@ -402,8 +455,8 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) break; case VIA_VX800: /* {CR68,4,7},{CR94,7,7},{CR95,7,7} : 96/8-1 = 0x0B */ - ViaCrtcMask(hwp, 0x68, 0xA0, 0xF0); - ViaCrtcMask(hwp, 0x94, 0x00, 0x80); + ViaCrtcMask(hwp, 0x68, 0xB0, 0xF0); /* ((0x0B & 0x0F) << 4)) = 0xB0 */ + ViaCrtcMask(hwp, 0x94, 0x00, 0x80); /* ((0x0B & 0x10) << 3)) = 0x00 */ ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* {CR68,0,3},{CR95,4,6} : 64/4 = 0x10 */ ViaCrtcMask(hwp, 0x68, 0x04, 0x0F); @@ -418,6 +471,38 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); break; case VIA_VX855: + /* {CR68,4,7},{CR94,7,7},{CR95,7,7} : 200/8-1 = 24 = 0x18 */ + ViaCrtcMask(hwp, 0x68, 0x80, 0xF0); /* ((0x18 & 0x0F) << 4)) = 0x80 */ + ViaCrtcMask(hwp, 0x94, 0x80, 0x80); /* ((0x18 & 0x10) << 3)) = 0x80 */ + ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* ((0x18 & 0x20) << 2)) = 0x00 */ + /* {CR68,0,3},{CR95,4,6} : 160/4 = 0x28 */ + ViaCrtcMask(hwp, 0x68, 0x08, 0x0F); /* (0x28 & 0x0F) = 0x08 */ + ViaCrtcMask(hwp, 0x95, 0x20, 0x70); /* (0x28 & 0x70) = 0x20 */ + /* {CR92,0,3},{CR95,0,2} : 160/4 = 0x28 */ + ViaCrtcMask(hwp, 0x92, 0x08, 0x08); /* (0x28 & 0x0F) = 0x08 */ + ViaCrtcMask(hwp, 0x95, 0x02, 0x07); /* ((0x28 & 0x70) >> 4)) = 0x02 */ + /* {CR94,0,6} : 320/4 = 0x50 */ + if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) + ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); + else + ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); + break; + case VIA_VX900: + /* {CR68,4,7},{CR94,7,7},{CR95,7,7} : 192/8-1 = 23 = 0x17 */ + ViaCrtcMask(hwp, 0x68, 0x70, 0xF0); /* ((0x17 & 0x0F) << 4)) = 0x70 */ + ViaCrtcMask(hwp, 0x94, 0x80, 0x80); /* ((0x17 & 0x10) << 3)) = 0x80 */ + ViaCrtcMask(hwp, 0x95, 0x00, 0x80); /* ((0x17 & 0x20) << 2)) = 0x00 */ + /* {CR68,0,3},{CR95,4,6} : 160/4 = 0x28 */ + ViaCrtcMask(hwp, 0x68, 0x08, 0x0F); /* (0x28 & 0x0F) = 0x08 */ + ViaCrtcMask(hwp, 0x95, 0x20, 0x70); /* (0x28 & 0x70) = 0x20 */ + /* {CR92,0,3},{CR95,0,2} : 160/4 = 0x28 */ + ViaCrtcMask(hwp, 0x92, 0x08, 0x08); /* (0x28 & 0x0F) = 0x08 */ + ViaCrtcMask(hwp, 0x95, 0x02, 0x07); /* ((0x28 & 0x70) >> 4)) = 0x2 */ + /* {CR94,0,6} : 320/4 = 0x50 */ + if ((mode->HDisplay >= 1400) && (pScrn->bitsPerPixel == 32)) + ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); + else + ViaCrtcMask(hwp, 0x94, 0x08, 0x7F); break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetSecondaryFIFO: " diff --git a/driver/xf86-video-openchrome/src/via_bios.h b/driver/xf86-video-openchrome/src/via_bios.h index 06809b992..6d945f708 100644 --- a/driver/xf86-video-openchrome/src/via_bios.h +++ b/driver/xf86-video-openchrome/src/via_bios.h @@ -82,6 +82,11 @@ #define VIA_DEVICE_TV 0x04 #define VIA_DEVICE_DFP 0x08 +#define VIA_I2C_NONE 0x00 +#define VIA_I2C_BUS1 0x01 +#define VIA_I2C_BUS2 0x02 +#define VIA_I2C_BUS3 0x04 + /* System Memory CLK */ #define VIA_MEM_SDR66 0x00 #define VIA_MEM_SDR100 0x01 @@ -92,7 +97,9 @@ #define VIA_MEM_DDR400 0x06 #define VIA_MEM_DDR533 0x07 #define VIA_MEM_DDR667 0x08 -#define VIA_MEM_END 0x09 +#define VIA_MEM_DDR800 0x09 +#define VIA_MEM_DDR1066 0x0A +#define VIA_MEM_END 0x0B #define VIA_MEM_NONE 0xFF /* Digital Output Bus Width */ diff --git a/driver/xf86-video-openchrome/src/via_crtc.c b/driver/xf86-video-openchrome/src/via_crtc.c index 4e2be975a..df5ffd785 100644 --- a/driver/xf86-video-openchrome/src/via_crtc.c +++ b/driver/xf86-video-openchrome/src/via_crtc.c @@ -174,6 +174,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default: ViaSeqMask(hwp, 0x16, 0x08, 0xBF); @@ -234,8 +235,8 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) /* Primary starting address -> 0x00, adjustframe does the rest */ hwp->writeCrtc(hwp, 0x0C, 0x00); hwp->writeCrtc(hwp, 0x0D, 0x00); - hwp->writeCrtc(hwp, 0x34, 0x00); ViaCrtcMask(hwp, 0x48, 0x00, 0x03); /* is this even possible on CLE266A ? */ + hwp->writeCrtc(hwp, 0x34, 0x00); /* vertical sync start : 2047 */ temp = mode->CrtcVSyncStart; @@ -278,6 +279,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default: /* some leftovers */ @@ -314,6 +316,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default: /* some leftovers */ @@ -331,15 +334,20 @@ ViaFirstCRTCSetStartingAddress(ScrnInfoPtr pScrn, int x, int y) CARD32 Base; CARD32 tmp; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaFirstCRTCSetStartingAddress\n")); + Base = (y * pScrn->displayWidth + x) * (pScrn->bitsPerPixel / 8); Base = Base >> 1; hwp->writeCrtc(hwp, 0x0C, (Base & 0xFF00) >> 8); hwp->writeCrtc(hwp, 0x0D, Base & 0xFF); - hwp->writeCrtc(hwp, 0x34, (Base & 0xFF0000) >> 16); - + /* FIXME The proper starting address for CR48 is 0x1F - Bits[28:24] */ if (!(pVia->Chipset == VIA_CLE266 && CLE266_REV_IS_AX(pVia->ChipRev))) ViaCrtcMask(hwp, 0x48, Base >> 24, 0x0F); + /* CR34 are fire bits. Must be written after CR0C CR0D CR48. */ + hwp->writeCrtc(hwp, 0x34, (Base & 0xFF0000) >> 16); + + } void @@ -434,6 +442,7 @@ ViaSecondCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default: ViaSeqMask(hwp, 0x16, 0x08, 0xBF); @@ -518,6 +527,7 @@ ViaSecondCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default: /* some leftovers */ diff --git a/driver/xf86-video-openchrome/src/via_cursor.c b/driver/xf86-video-openchrome/src/via_cursor.c index 9333a185f..18d49d556 100644 --- a/driver/xf86-video-openchrome/src/via_cursor.c +++ b/driver/xf86-video-openchrome/src/via_cursor.c @@ -98,6 +98,7 @@ viaHWCursorInit(ScreenPtr pScreen) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { pVia->CursorRegControl = VIA_REG_HI_CONTROL0; pVia->CursorRegBase = VIA_REG_HI_BASE0; @@ -145,9 +146,12 @@ viaHWCursorInit(ScreenPtr pScreen) infoPtr->ShowCursor = viaShowCursor; infoPtr->UseHWCursor = viaUseHWCursor; + /* ARGB Cursor init */ infoPtr->UseHWCursorARGB = viaUseHWCursorARGB; - if (pVia->CursorARGBSupported) + if (pVia->CursorARGBSupported) { + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HWCursor ARGB enabled\n")); infoPtr->LoadCursorARGB = viaLoadCursorARGB; + } /* Set cursor location in frame buffer. */ VIASETREG(VIA_REG_CURSOR_MODE, pVia->cursorOffset); @@ -166,6 +170,7 @@ viaHWCursorInit(ScreenPtr pScreen) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(VIA_REG_V327_HI_INVTCOLOR, 0x00FFFFFF); @@ -225,6 +230,7 @@ viaCursorStore(ScrnInfoPtr pScrn) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { pVia->CursorPrimHiInvtColor = VIAGETREG(VIA_REG_PRIM_HI_INVTCOLOR); pVia->CursorV327HiInvtColor = VIAGETREG(VIA_REG_V327_HI_INVTCOLOR); @@ -265,6 +271,7 @@ viaCursorRestore(ScrnInfoPtr pScrn) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, pVia->CursorPrimHiInvtColor); VIASETREG(VIA_REG_V327_HI_INVTCOLOR, pVia->CursorV327HiInvtColor); @@ -284,7 +291,7 @@ viaCursorRestore(ScrnInfoPtr pScrn) } /* - * ARGB Cursor + * display the current cursor */ void @@ -298,6 +305,7 @@ viaShowCursor(ScrnInfoPtr pScrn) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { VIASETREG(VIA_REG_HI_CONTROL0, 0x36000005); } @@ -319,13 +327,19 @@ viaShowCursor(ScrnInfoPtr pScrn) */ /* Duoview */ - if (pVia->CursorPipe) + if (pVia->CursorPipe) { + /* Mono Cursor Display Path [bit31]: Secondary */ + /* FIXME For CLE266 and KM400 try to enable 32x32 cursor size [bit1] */ VIASETREG(VIA_REG_ALPHA_CONTROL, 0xF6000005); - else + } else { + /* Mono Cursor Display Path [bit31]: Primary */ VIASETREG(VIA_REG_ALPHA_CONTROL, 0x76000005); + } } } + +/* hide the current cursor */ void viaHideCursor(ScrnInfoPtr pScrn) { @@ -338,6 +352,7 @@ viaHideCursor(ScrnInfoPtr pScrn) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { temp = VIAGETREG(VIA_REG_HI_CONTROL0); VIASETREG(VIA_REG_HI_CONTROL0, temp & 0xFFFFFFFA); @@ -350,10 +365,16 @@ viaHideCursor(ScrnInfoPtr pScrn) default: temp = VIAGETREG(VIA_REG_ALPHA_CONTROL); + /* Hardware cursor disable [bit0] */ VIASETREG(VIA_REG_ALPHA_CONTROL, temp & 0xFFFFFFFA); } } +/* + Set the cursor position to (x,y). X and/or y may be negative + indicating that the cursor image is partially offscreen on + the left and/or top edges of the screen. +*/ static void viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) { @@ -380,6 +401,7 @@ viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { VIASETREG(VIA_REG_HI_POS0, ((x << 16) | (y & 0x07ff))); VIASETREG(VIA_REG_HI_OFFSET0, ((xoff << 16) | (yoff & 0x07ff))); @@ -409,6 +431,15 @@ viaUseHWCursorARGB(ScreenPtr pScreen, CursorPtr pCurs) && pCurs->bits->height <= pVia->CursorMaxHeight); } +/* + If the driver is unable to use a hardware cursor for reasons + other than the cursor being larger than the maximum specified + in the MaxWidth or MaxHeight field below, it can supply the + UseHWCursor function. If UseHWCursor is provided by the driver, + it will be called whenever the cursor shape changes or the video + mode changes. This is useful for when the hardware cursor cannot + be used in interlaced or doublescan modes. +*/ static Bool viaUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) { @@ -423,8 +454,11 @@ viaUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) && pCurs->bits->height <= pVia->CursorMaxHeight); } +/* + Load Mono Cursor Image +*/ static void -viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) +viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) { VIAPtr pVia = VIAPTR(pScrn); CARD32 temp; @@ -439,7 +473,7 @@ viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) if (pVia->CursorARGBSupported) { #define ARGB_PER_CHUNK (8 * sizeof (chunk) / 2) for (i = 0; i < (pVia->CursorMaxWidth * pVia->CursorMaxHeight / ARGB_PER_CHUNK); i++) { - chunk = *s++; + chunk = *src++; for (j = 0; j < ARGB_PER_CHUNK; j++, chunk >>= 2) *dst++ = mono_cursor_color[chunk & 3]; } @@ -447,7 +481,7 @@ viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) pVia->CursorFG = mono_cursor_color[3]; pVia->CursorBG = mono_cursor_color[2]; } else { - memcpy(dst, (CARD8*)s, pVia->CursorSize); + memcpy(dst, (CARD8*)src, pVia->CursorSize); } switch(pVia->Chipset) { case VIA_CX700: @@ -455,6 +489,7 @@ viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { temp = VIAGETREG(VIA_REG_HI_CONTROL0); VIASETREG(VIA_REG_HI_CONTROL0, temp & 0xFFFFFFFE); @@ -471,11 +506,17 @@ viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) } } +/* + Set the cursor foreground and background colors. In 8bpp, fg and + bg are indices into the current colormap unless the + HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set. In that case + and in all other bpps the fg and bg are in 8-8-8 RGB format. +*/ + static void viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) { VIAPtr pVia = VIAPTR(pScrn); - CARD32 control = pVia->CursorRegControl; CARD32 pixel; CARD32 temp; CARD32 *dst; @@ -487,12 +528,10 @@ viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) fg |= 0xff000000; bg |= 0xff000000; + /* Don't recolour the image if we don't have to. */ if (fg == pVia->CursorFG && bg == pVia->CursorBG) return; - temp = VIAGETREG(control); - VIASETREG(control, temp & 0xFFFFFFFE); - dst = (CARD32*)pVia->cursorMap; for (i = 0; i < pVia->CursorMaxWidth * pVia->CursorMaxHeight; i++, dst++) if ((pixel = *dst)) @@ -507,6 +546,7 @@ viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { temp = VIAGETREG(VIA_REG_HI_CONTROL0); VIASETREG(VIA_REG_HI_CONTROL0, temp & 0xFFFFFFFE); @@ -517,7 +557,8 @@ viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) } break; default: - VIASETREG(control, temp); + temp = VIAGETREG(VIA_REG_ALPHA_CONTROL); + VIASETREG(VIA_REG_ALPHA_CONTROL, temp & 0xFFFFFFFE); } } diff --git a/driver/xf86-video-openchrome/src/via_dga.c b/driver/xf86-video-openchrome/src/via_dga.c index d15188af7..ab12fbb14 100644 --- a/driver/xf86-video-openchrome/src/via_dga.c +++ b/driver/xf86-video-openchrome/src/via_dga.c @@ -89,16 +89,16 @@ VIASetupDGAMode( otherPitch = secondPitch ? secondPitch : pMode->HDisplay; if (pMode->HDisplay != otherPitch) { - newmodes = xrealloc(modes, (*num + 2) * sizeof(DGAModeRec)); + newmodes = realloc(modes, (*num + 2) * sizeof(DGAModeRec)); oneMore = TRUE; } else { - newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec)); + newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec)); oneMore = FALSE; } if (!newmodes) { - xfree(modes); + free(modes); return NULL; } diff --git a/driver/xf86-video-openchrome/src/via_dri.c b/driver/xf86-video-openchrome/src/via_dri.c index ee9a38a25..c72867c22 100644 --- a/driver/xf86-video-openchrome/src/via_dri.c +++ b/driver/xf86-video-openchrome/src/via_dri.c @@ -187,7 +187,7 @@ VIADRIRingBufferInit(ScrnInfoPtr pScrn) return FALSE; /* - * Info frome code-snippet on DRI-DEVEL list; Erdi Chen. + * Info from code-snippet on DRI-DEVEL list; Erdi Chen. */ switch (pVia->ChipId) { @@ -267,6 +267,7 @@ VIADRIAgpInit(ScreenPtr pScreen, VIAPtr pVia) pVIADRI = pDRIInfo->devPrivate; pVia->agpSize = 0; + if (drmAgpAcquire(pVia->drmFD) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAcquire failed %d\n", errno); @@ -431,17 +432,17 @@ VIAInitVisualConfigs(ScreenPtr pScreen) if (pScrn->bitsPerPixel == 16 || pScrn->bitsPerPixel == 32) { numConfigs = 12; if (!(pConfigs = (__GLXvisualConfig *) - xcalloc(sizeof(__GLXvisualConfig), numConfigs))) + calloc(sizeof(__GLXvisualConfig), numConfigs))) return FALSE; if (!(pVIAConfigs = (VIAConfigPrivPtr) - xcalloc(sizeof(VIAConfigPrivRec), numConfigs))) { - xfree(pConfigs); + calloc(sizeof(VIAConfigPrivRec), numConfigs))) { + free(pConfigs); return FALSE; } if (!(pVIAConfigPtrs = (VIAConfigPrivPtr *) - xcalloc(sizeof(VIAConfigPrivPtr), numConfigs))) { - xfree(pConfigs); - xfree(pVIAConfigs); + calloc(sizeof(VIAConfigPrivPtr), numConfigs))) { + free(pConfigs); + free(pVIAConfigs); return FALSE; } for (i = 0; i < numConfigs; i++) @@ -593,23 +594,28 @@ VIADRIScreenInit(ScreenPtr pScreen) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: pDRIInfo->clientDriverName = "swrast"; break; default: pDRIInfo->clientDriverName = VIAClientDriverName; break; } - pDRIInfo->busIdString = xalloc(64); - sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", + if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) { + pDRIInfo->busIdString = DRICreatePCIBusID(pVia->PciInfo); + } else { + pDRIInfo->busIdString = malloc(64); + sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", #ifdef XSERVER_LIBPCIACCESS - ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus), - pVia->PciInfo->dev, pVia->PciInfo->func + ((pVia->PciInfo->domain << 8) | pVia->PciInfo->bus), + pVia->PciInfo->dev, pVia->PciInfo->func #else - ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum + ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum, + ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum, + ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum #endif - ); + ); + } pDRIInfo->ddxDriverMajorVersion = VIA_DRIDDX_VERSION_MAJOR; pDRIInfo->ddxDriverMinorVersion = VIA_DRIDDX_VERSION_MINOR; pDRIInfo->ddxDriverPatchVersion = VIA_DRIDDX_VERSION_PATCH; @@ -646,7 +652,7 @@ VIADRIScreenInit(ScreenPtr pScreen) pDRIInfo->SAREASize = SAREA_MAX; #endif - if (!(pVIADRI = (VIADRIPtr) xcalloc(sizeof(VIADRIRec), 1))) { + if (!(pVIADRI = (VIADRIPtr) calloc(sizeof(VIADRIRec), 1))) { DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; return FALSE; @@ -665,7 +671,7 @@ VIADRIScreenInit(ScreenPtr pScreen) if (!DRIScreenInit(pScreen, pDRIInfo, &pVia->drmFD)) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling DRI.\n"); - xfree(pDRIInfo->devPrivate); + free(pDRIInfo->devPrivate); pDRIInfo->devPrivate = NULL; DRIDestroyInfoRec(pVia->pDRIInfo); pVia->pDRIInfo = NULL; @@ -748,7 +754,7 @@ VIADRICloseScreen(ScreenPtr pScreen) if (pVia->pDRIInfo) { if ((pVIADRI = (VIADRIPtr) pVia->pDRIInfo->devPrivate)) { VIADRIIrqExit(pScrn, pVIADRI); - xfree(pVIADRI); + free(pVIADRI); pVia->pDRIInfo->devPrivate = NULL; } DRIDestroyInfoRec(pVia->pDRIInfo); @@ -756,11 +762,11 @@ VIADRICloseScreen(ScreenPtr pScreen) } if (pVia->pVisualConfigs) { - xfree(pVia->pVisualConfigs); + free(pVia->pVisualConfigs); pVia->pVisualConfigs = NULL; } if (pVia->pVisualConfigsPriv) { - xfree(pVia->pVisualConfigsPriv); + free(pVia->pVisualConfigsPriv); pVia->pVisualConfigsPriv = NULL; } } diff --git a/driver/xf86-video-openchrome/src/via_driver.c b/driver/xf86-video-openchrome/src/via_driver.c index fa90f70dd..0b999a119 100644 --- a/driver/xf86-video-openchrome/src/via_driver.c +++ b/driver/xf86-video-openchrome/src/via_driver.c @@ -39,7 +39,7 @@ #include <X11/extensions/dpms.h> #endif -#include "svnversion.h" +#include "version.h" #include "via_driver.h" #include "via_video.h" @@ -143,6 +143,7 @@ static const struct pci_id_match via_device_match[] = { VIA_DEVICE_MATCH (PCI_CHIP_VT3327, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3353, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3409, 0 ), + VIA_DEVICE_MATCH (PCI_CHIP_VT3410, 0 ), { 0, 0, 0 }, }; @@ -174,12 +175,13 @@ static SymTabRec VIAChipsets[] = { {VIA_K8M800, "K8M800/K8N800"}, {VIA_PM800, "PM800/PM880/CN400"}, {VIA_VM800, "VM800/P4M800Pro/VN800/CN700"}, - {VIA_K8M890, "K8M890/K8N890"}, - {VIA_P4M900, "P4M900/VN896/CN896"}, {VIA_CX700, "CX700/VX700"}, + {VIA_K8M890, "K8M890/K8N890"}, {VIA_P4M890, "P4M890"}, - {VIA_VX800, "VX800"}, - {VIA_VX855, "VX855"}, + {VIA_P4M900, "P4M900/VN896/CN896"}, + {VIA_VX800, "VX800/VX820"}, + {VIA_VX855, "VX855/VX875"}, + {VIA_VX900, "VX900"}, {-1, NULL } }; @@ -190,12 +192,13 @@ static PciChipsets VIAPciChipsets[] = { {VIA_K8M800, PCI_CHIP_VT3204, VIA_RES_SHARED}, {VIA_PM800, PCI_CHIP_VT3259, VIA_RES_SHARED}, {VIA_VM800, PCI_CHIP_VT3314, VIA_RES_SHARED}, - {VIA_K8M890, PCI_CHIP_VT3336, VIA_RES_SHARED}, - {VIA_P4M900, PCI_CHIP_VT3364, VIA_RES_SHARED}, {VIA_CX700, PCI_CHIP_VT3324, VIA_RES_SHARED}, + {VIA_K8M890, PCI_CHIP_VT3336, VIA_RES_SHARED}, {VIA_P4M890, PCI_CHIP_VT3327, VIA_RES_SHARED}, + {VIA_P4M900, PCI_CHIP_VT3364, VIA_RES_SHARED}, {VIA_VX800, PCI_CHIP_VT3353, VIA_RES_SHARED}, {VIA_VX855, PCI_CHIP_VT3409, VIA_RES_SHARED}, + {VIA_VX900, PCI_CHIP_VT3410, VIA_RES_SHARED}, {-1, -1, VIA_RES_UNDEF} }; @@ -215,9 +218,11 @@ typedef enum OPTION_EXA_SCRATCH_SIZE, OPTION_SWCURSOR, OPTION_SHADOW_FB, + OPTION_ROTATION_TYPE, OPTION_ROTATE, OPTION_VIDEORAM, OPTION_ACTIVEDEVICE, + OPTION_I2CDEVICES, OPTION_BUSWIDTH, OPTION_CENTER, OPTION_PANELSIZE, @@ -253,6 +258,7 @@ static OptionInfoRec VIAOptions[] = { {OPTION_EXA_SCRATCH_SIZE, "ExaScratchSize", OPTV_INTEGER, {0}, FALSE}, {OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_ROTATION_TYPE, "RotationType", OPTV_ANYSTR, {0}, FALSE}, {OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE}, {OPTION_VIDEORAM, "VideoRAM", OPTV_INTEGER, {0}, FALSE}, {OPTION_ACTIVEDEVICE, "ActiveDevice", OPTV_ANYSTR, {0}, FALSE}, @@ -276,6 +282,7 @@ static OptionInfoRec VIAOptions[] = { {OPTION_MODE_SWITCH_METHOD, "ModeSwitchMethod", OPTV_ANYSTR, {0}, FALSE}, {OPTION_MAX_DRIMEM, "MaxDRIMem", OPTV_INTEGER, {0}, FALSE}, {OPTION_AGPMEM, "AGPMem", OPTV_INTEGER, {0}, FALSE}, + {OPTION_I2CDEVICES, "I2CDevices", OPTV_ANYSTR, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -307,6 +314,7 @@ VIASetup(pointer module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; + /* Only be loaded once */ if (!setupDone) { setupDone = TRUE; xf86AddDriver(&VIA, module, @@ -339,6 +347,7 @@ VIAGetRec(ScrnInfoPtr pScrn) if (pScrn->driverPrivate) return TRUE; + /* allocate VIARec */ pScrn->driverPrivate = xnfcalloc(sizeof(VIARec), 1); VIAPtr pVia = ((VIARec *) (pScrn->driverPrivate)); @@ -400,36 +409,36 @@ VIAFreeRec(ScrnInfoPtr pScrn) if (pBIOSInfo->Panel) { if (pBIOSInfo->Panel->NativeMode) - xfree(pBIOSInfo->Panel->NativeMode); + free(pBIOSInfo->Panel->NativeMode); if (pBIOSInfo->Panel->CenteredMode) - xfree(pBIOSInfo->Panel->CenteredMode); - xfree(pBIOSInfo->Panel); + free(pBIOSInfo->Panel->CenteredMode); + free(pBIOSInfo->Panel); } if (pBIOSInfo->FirstCRTC) - xfree(pBIOSInfo->FirstCRTC); + free(pBIOSInfo->FirstCRTC); if (pBIOSInfo->SecondCRTC) - xfree(pBIOSInfo->SecondCRTC); + free(pBIOSInfo->SecondCRTC); if (pBIOSInfo->Simultaneous) - xfree(pBIOSInfo->Simultaneous); + free(pBIOSInfo->Simultaneous); if (pBIOSInfo->Lvds) - xfree(pBIOSInfo->Lvds); + free(pBIOSInfo->Lvds); } if (VIAPTR(pScrn)->pVbe) vbeFree(VIAPTR(pScrn)->pVbe); if (pVia->VideoRegs) - xfree(pVia->VideoRegs); + free(pVia->VideoRegs); if (((VIARec *) (pScrn->driverPrivate))->pBIOSInfo->TVI2CDev) xf86DestroyI2CDevRec((((VIARec *) (pScrn->driverPrivate))->pBIOSInfo-> TVI2CDev), TRUE); - xfree(((VIARec *) (pScrn->driverPrivate))->pBIOSInfo); + free(((VIARec *) (pScrn->driverPrivate))->pBIOSInfo); VIAUnmapMem(pScrn); - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } /* VIAFreeRec */ @@ -455,7 +464,6 @@ via_pci_probe(DriverPtr driver, int entity_num, { ScrnInfoPtr scrn = NULL; EntityInfoPtr entity; - DevUnion *private; scrn = xf86ConfigPciEntity(scrn, 0, entity_num, VIAPciChipsets, NULL, NULL, NULL, NULL, NULL); @@ -513,7 +521,7 @@ VIAProbe(DriverPtr drv, int flags) numDevSections, drv, &usedChips); - xfree(devSections); + free(devSections); if (numUsed <= 0) return FALSE; @@ -588,11 +596,11 @@ VIAProbe(DriverPtr drv, int flags) } instance++; } - xfree(pEnt); + free(pEnt); } } - xfree(usedChips); + free(usedChips); return foundScreen; @@ -652,6 +660,12 @@ VIAProbeDDC(ScrnInfoPtr pScrn, int index) vbeInfoPtr pVbe; if (xf86LoadSubModule(pScrn, "vbe")) { + /* FIXME This line should be replaced with: + + pVbe = VBEExtendedInit(NULL, index, 0); + + for XF86 version > 4.2.99 + */ pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); @@ -664,7 +678,7 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIASetupDefaultOptions\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIASetupDefaultOptions - Setting up default chipset options.\n")); pVia->shadowFB = FALSE; pVia->NoAccel = FALSE; @@ -684,10 +698,14 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) pVia->maxDriSize = 0; pVia->agpMem = AGP_SIZE / 1024; pVia->ActiveDevice = 0x00; + pVia->I2CDevices = 0x00; pVia->VideoEngine = VIDEO_ENGINE_CLE; #ifdef HAVE_DEBUG pVia->PrintVGARegs = FALSE; #endif + + /* Disable vertical interpolation because the size of */ + /* line buffer (limited to 800) is too small to do interpolation. */ pVia->swov.maxWInterp = 800; pVia->swov.maxHInterp = 600; pVia->useLegacyVBE = TRUE; @@ -710,20 +728,30 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) break; case VIA_K8M800: pVia->DRIIrqEnable = FALSE; - pVia->UseLegacyModeSwitch = TRUE; break; case VIA_PM800: + /* Use new mode switch to resolve many resolution and display bugs (switch to console) */ + /* FIXME The video playing (XV) is not working correctly after turn on new mode switch */ pVia->VideoEngine = VIDEO_ENGINE_CME; - pVia->UseLegacyModeSwitch = TRUE; break; case VIA_VM800: - pVia->UseLegacyModeSwitch = TRUE; + /* New mode switch resolve bug with gamma set #282 */ + /* and with Xv after hibernate #240 */ + break; + case VIA_CX700: + pVia->VideoEngine = VIDEO_ENGINE_CME; + pVia->swov.maxWInterp = 1920; + pVia->swov.maxHInterp = 1080; break; case VIA_K8M890: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->agpEnable = FALSE; pVia->dmaXV = FALSE; break; + case VIA_P4M890: + pVia->VideoEngine = VIDEO_ENGINE_CME; + pVia->dmaXV = FALSE; + break; case VIA_P4M900: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->agpEnable = FALSE; @@ -732,20 +760,13 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) pVia->dmaXV = FALSE; pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP0; break; - case VIA_CX700: - pVia->VideoEngine = VIDEO_ENGINE_CME; - pVia->swov.maxWInterp = 1920; - pVia->swov.maxHInterp = 1080; - break; - case VIA_P4M890: - pVia->VideoEngine = VIDEO_ENGINE_CME; - pVia->dmaXV = FALSE; - break; + case VIA_VX800: case VIA_VX855: + case VIA_VX900: pVia->VideoEngine = VIDEO_ENGINE_CME; - /* pVia->agpEnable = FALSE; - pVia->dmaXV = FALSE;*/ + pVia->agpEnable = FALSE; + pVia->dmaXV = FALSE; break; } @@ -807,7 +828,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pEnt = xf86GetEntityInfo(pScrn->entityList[0]); #ifndef XSERVER_LIBPCIACCESS if (pEnt->resources) { - xfree(pEnt); + free(pEnt); VIAFreeRec(pScrn); return FALSE; } @@ -825,7 +846,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gVIAEntityIndex); pVIAEnt = pPriv->ptr; if (pVIAEnt->BypassSecondary) { - xfree(pEnt); + free(pEnt); VIAFreeRec(pScrn); return FALSE; } @@ -848,6 +869,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pVIAEnt->HasSecondary = FALSE; pVIAEnt->RestorePrimary = FALSE; pVIAEnt->IsSecondaryRestored = FALSE; + } } else { pVia->sharedData = xnfcalloc(sizeof(ViaSharedRec), 1); @@ -866,7 +888,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) */ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) { - xfree(pEnt); + free(pEnt); VIAFreeRec(pScrn); return FALSE; } else { @@ -881,7 +903,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by this driver\n", pScrn->depth); - xfree(pEnt); + free(pEnt); VIAFreeRec(pScrn); return FALSE; } @@ -897,7 +919,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) rgb zeros = { 0, 0, 0 }; if (!xf86SetWeight(pScrn, zeros, zeros)) { - xfree(pEnt); + free(pEnt); VIAFreeRec(pScrn); return FALSE; } else { @@ -914,7 +936,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" " (%s) is not supported at depth %d.\n", xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - xfree(pEnt); + free(pEnt); VIAFreeRec(pScrn); return FALSE; } @@ -979,7 +1001,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Chipset revision: %d\n", pVia->ChipRev); - xfree(pEnt); + free(pEnt); /* Detect the amount of installed RAM */ from = X_PROBED; @@ -993,6 +1015,12 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) switch (pVia->Chipset) { case VIA_CLE266: +#ifdef XSERVER_LIBPCIACCESS + pci_device_cfg_read_u8(bridge, &videoRam, 0xE1); +#else + videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70; +#endif + pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; case VIA_KM400: #ifdef XSERVER_LIBPCIACCESS pci_device_cfg_read_u8(bridge, &videoRam, 0xE1); @@ -1000,6 +1028,12 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) videoRam = pciReadByte(pciTag(0, 0, 0), 0xE1) & 0x70; #endif pScrn->videoRam = (1 << ((videoRam & 0x70) >> 4)) << 10; + /* Workaround for #177 (VRAM probing fail on P4M800) */ + if (pScrn->videoRam < 16384) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Memory size detection failed: using 16 MB.\n"); + pScrn->videoRam = 16 << 10; + } break; case VIA_PM800: case VIA_VM800: @@ -1017,6 +1051,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) case VIA_CX700: case VIA_VX800: case VIA_VX855: + case VIA_VX900: #ifdef XSERVER_LIBPCIACCESS pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); #else @@ -1046,23 +1081,28 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } } - if (from == X_PROBED) + /* + * PCI BAR are limited to 256 MB. + * This limitation will go away with TTM. + */ + if (pScrn->videoRam > (256 << 10)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Cannot use more than 256 MB of VRAM.\n"); + pScrn->videoRam = (256 << 10); + } + + if (from == X_PROBED) { xf86DrvMsg(pScrn->scrnIndex, from, "Probed amount of VideoRAM = %d kB\n", pScrn->videoRam); + } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Setting up default chipset options.\n"); if (!VIASetupDefaultOptions(pScrn)) { VIAFreeRec(pScrn); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reading config file...\n"); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VIAOptions); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Starting to parse config file options...\n"); - if (xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM, &pScrn->videoRam)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Setting amount of VideoRAM to %d kB\n", pScrn->videoRam); @@ -1100,6 +1140,31 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } /* When rotating, switch shadow framebuffer on and acceleration off. */ + if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATION_TYPE))) { + if (!xf86NameCmp(s, "SWRandR")) { + pVia->shadowFB = TRUE; + pVia->NoAccel = TRUE; + pVia->RandRRotation = TRUE; + pVia->rotate = RR_Rotate_0; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " + "RandR enabled, acceleration disabled\n"); + } else if (!xf86NameCmp(s, "HWRandR")) { + pVia->shadowFB = TRUE; + pVia->NoAccel = TRUE; + pVia->RandRRotation = TRUE; + pVia->rotate = RR_Rotate_0; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Hardware accelerated " + "rotating screen is not implemented. Using SW RandR.\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" + "value for Option \"RotationType\".\n", s); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Valid options are \"SWRandR\" and \"HWRandR\".\n"); + } + } + + + /* When rotating, switch shadow framebuffer on and acceleration off. */ if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATE))) { if (!xf86NameCmp(s, "CW")) { pVia->shadowFB = TRUE; @@ -1498,6 +1563,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } } + /* Initialize the colormap */ Gamma zeros = { 0.0, 0.0, 0.0 }; if (!xf86SetGamma(pScrn, zeros)) { VIAFreeRec(pScrn); @@ -1523,6 +1589,17 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pVia->videoRambytes = pScrn->videoRam << 10; + /* I2CDevices Option for I2C Initialization */ + //pVia->I2CDevices = 0x00; + if ((s = xf86GetOptValString(VIAOptions, OPTION_I2CDEVICES))) { + if (strstr(s, "Bus1")) + pVia->I2CDevices |= VIA_I2C_BUS1; + if (strstr(s, "Bus2")) + pVia->I2CDevices |= VIA_I2C_BUS2; + if (strstr(s, "Bus3")) + pVia->I2CDevices |= VIA_I2C_BUS3; + } + if (!xf86LoadSubModule(pScrn, "i2c")) { VIAFreeRec(pScrn); return FALSE; @@ -1536,10 +1613,13 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } else { if (pVia->pI2CBus1) { - pVia->DDC1 = xf86DoEDID_DDC2(pScrn->scrnIndex, pVia->pI2CBus1); + pVia->DDC1 = xf86DoEEDID(pScrn->scrnIndex, pVia->pI2CBus1, TRUE); if (pVia->DDC1) { xf86PrintEDID(pVia->DDC1); xf86SetDDCproperties(pScrn, pVia->DDC1); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DDC pI2CBus1 detected a %s\n", DIGITAL(pVia->DDC1->features.input_type) ? + "DFP" : "CRT")); } } } @@ -1559,17 +1639,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) ViaPanelPreInit(pScrn); } - if (pBIOSInfo->Panel->IsActive && - ((pVia->Chipset == VIA_K8M800) || - (pVia->Chipset == VIA_PM800) || - (pVia->Chipset == VIA_VM800))) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Panel on K8M800, PM800 and " - "VM800 is currently not supported.\n"); - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Using VBE to set modes to work around this.\n"); - pVia->useVBEModes = TRUE; - } - pVia->pVbe = NULL; if (pVia->useVBEModes) { /* VBE doesn't properly initialise int10 itself. */ @@ -1593,6 +1662,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } } else { + int max_pitch, max_height; /* Add own modes. */ ViaModesAttach(pScrn, pScrn->monitor); @@ -1609,6 +1679,26 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) clockRanges->interlaceAllowed = TRUE; clockRanges->doubleScanAllowed = FALSE; + switch (pVia->Chipset) { + case VIA_CLE266: + case VIA_KM400: + case VIA_K8M800: + case VIA_PM800: + case VIA_VM800: + max_pitch = 3344; + max_height = 2508; + case VIA_CX700: + case VIA_K8M890: + case VIA_P4M890: + case VIA_P4M900: + max_pitch = 8192/(pScrn->bitsPerPixel >> 3)-1; + max_height = max_pitch; + break; + default: + max_pitch = 16384/(pScrn->bitsPerPixel >> 3)-1; + max_height = max_pitch; + } + /* * xf86ValidateModes will check that the mode HTotal and VTotal values * don't exceed the chipset's limit if pScrn->maxHValue and @@ -1621,7 +1711,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) * * CLE266A: primary AdjustFrame can use only 24 bits, so we are limited * to 12x11 bits; 4080x2048 (~2:1), 3344x2508 (4:3), or 2896x2896 (1:1). - * Test CLE266Cx, KM400, KM400A, K8M800, PM800, CN400 please. + * TODO Test CLE266Cx, KM400, KM400A, K8M800, CN400 please. * * We should be able to limit the memory available for a mode to 32 MB, * but xf86ValidateModes (or miScanLineWidth) fails to catch this @@ -1629,15 +1719,16 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) */ /* Select valid modes from those available. */ - i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, /* availModes */ - pScrn->display->modes, /* modeNames */ - clockRanges, /* list of clock ranges */ + i = xf86ValidateModes(pScrn, + pScrn->monitor->Modes, /* List of modes available for the monitor */ + pScrn->display->modes, /* List of mode names that the screen is requesting */ + clockRanges, /* list of clock ranges */ NULL, /* list of line pitches */ 256, /* minimum line pitch */ - 3344, /* maximum line pitch */ - 32 * 8, /* pitch inc (bits) */ - 128, /* min height */ - 2508, /* max height */ + max_pitch, /* maximum line pitch */ + 16 * 8, /* pitch increment (in bits), we just want 16 bytes alignment */ + 128, /* min virtual height */ + max_height, /* maximum virtual height */ pScrn->display->virtualX, /* virtual width */ pScrn->display->virtualY, /* virtual height */ pVia->videoRambytes, /* apertureSize */ @@ -1650,6 +1741,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } + /* This function deletes modes in the modes field of the ScrnInfoRec that have been marked as invalid. */ xf86PruneDriverModes(pScrn); if (i == 0 || pScrn->modes == NULL) { @@ -1662,9 +1754,17 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) /* Set up screen parameters. */ pVia->Bpp = pScrn->bitsPerPixel >> 3; pVia->Bpl = pScrn->displayWidth * pVia->Bpp; + + /* This function fills in the Crtc fields for all the modes in the modes field of the ScrnInfoRec. */ xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); + + /* Set the current mode to the first in the list */ pScrn->currentMode = pScrn->modes; + + /* Print the list of modes being used */ xf86PrintModes(pScrn); + + /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); #ifdef USE_FB @@ -1822,6 +1922,7 @@ VIALeaveVT(int scrnIndex, int flags) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default: hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); @@ -1935,7 +2036,9 @@ VIASave(ScrnInfoPtr pScrn) Regs->SR17 = hwp->readSeq(hwp, 0x17); Regs->SR18 = hwp->readSeq(hwp, 0x18); Regs->SR19 = hwp->readSeq(hwp, 0x19); + /* PCI Bus Control */ Regs->SR1A = hwp->readSeq(hwp, 0x1A); + Regs->SR1B = hwp->readSeq(hwp, 0x1B); Regs->SR1C = hwp->readSeq(hwp, 0x1C); Regs->SR1D = hwp->readSeq(hwp, 0x1D); @@ -1977,40 +2080,59 @@ VIASave(ScrnInfoPtr pScrn) Regs->SR4C = hwp->readSeq(hwp, 0x4C); break; } - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Non-Primary Adapter! saving VGA_SR_MODE only !!\n")); + + /* Save Preemptive Arbiter Control Register */ + Regs->SR4D = hwp->readSeq(hwp, 0x4D); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Crtc...\n")); Regs->CR13 = hwp->readCrtc(hwp, 0x13); Regs->CR32 = hwp->readCrtc(hwp, 0x32); Regs->CR33 = hwp->readCrtc(hwp, 0x33); - Regs->CR34 = hwp->readCrtc(hwp, 0x34); + Regs->CR35 = hwp->readCrtc(hwp, 0x35); Regs->CR36 = hwp->readCrtc(hwp, 0x36); + + + /* Starting Address */ + /* Start Address High */ + Regs->CR0C = hwp->readCrtc(hwp, 0x0C); + /* Start Address Low */ + Regs->CR0D = hwp->readCrtc(hwp, 0x0D); + /* Starting Address Overflow Bits[28:24] */ Regs->CR48 = hwp->readCrtc(hwp, 0x48); + /* CR34 are fire bits. Must be written after CR0C CR0D CR48. */ + /* Starting Address Overflow Bits[23:16] */ + Regs->CR34 = hwp->readCrtc(hwp, 0x34); + + Regs->CR49 = hwp->readCrtc(hwp, 0x49); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TVSave...\n")); if (pBIOSInfo->TVI2CDev) ViaTVSave(pScrn); - /* Save LCD control registers. */ + /* Save LCD control registers (from CR 0x50 to 0x93). */ for (i = 0; i < 68; i++) Regs->CRTCRegs[i] = hwp->readCrtc(hwp, i + 0x50); if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { - - Regs->CRA0 = hwp->readCrtc(hwp, 0xA0); - Regs->CRA1 = hwp->readCrtc(hwp, 0xA1); - Regs->CRA2 = hwp->readCrtc(hwp, 0xA2); - + /* LVDS Channel 2 Function Select 0 / DVI Function Select */ Regs->CR97 = hwp->readCrtc(hwp, 0x97); + /* LVDS Channel 1 Function Select 0 */ Regs->CR99 = hwp->readCrtc(hwp, 0x99); + /* Digital Video Port 1 Function Select 0 */ Regs->CR9B = hwp->readCrtc(hwp, 0x9B); + /* Power Now Control 4 */ Regs->CR9F = hwp->readCrtc(hwp, 0x9F); + /* Horizontal Scaling Initial Value */ + Regs->CRA0 = hwp->readCrtc(hwp, 0xA0); + /* Vertical Scaling Initial Value */ + Regs->CRA1 = hwp->readCrtc(hwp, 0xA1); + /* Scaling Enable Bit */ + Regs->CRA2 = hwp->readCrtc(hwp, 0xA2); } /* Save TMDS status */ @@ -2018,6 +2140,7 @@ VIASave(ScrnInfoPtr pScrn) case VIA_CX700: case VIA_VX800: case VIA_VX855: + case VIA_VX900: Regs->CRD2 = hwp->readCrtc(hwp, 0xD2); break; } @@ -2045,15 +2168,15 @@ VIARestore(ScrnInfoPtr pScrn) /* Unlock extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); - /*=* CR6A, CR6B, CR6C must be reset before restore - standard vga regs, or system will be hang. *=*/ + /*=* CR6A, CR6B, CR6C must be reset before restoring + standard vga regs, or system will hang. *=*/ /*=* TODO Check is reset IGA2 channel before disable IGA2 channel - is neccesery or it may cause some line garbage. *=*/ + is necessary or it may cause some line garbage. *=*/ hwp->writeCrtc(hwp, 0x6A, 0x00); hwp->writeCrtc(hwp, 0x6B, 0x00); hwp->writeCrtc(hwp, 0x6C, 0x00); - /* Gamma must disable before restore pallette */ + /* Gamma must be disabled before restoring palette */ ViaGammaDisable(pScrn); if (pBIOSInfo->TVI2CDev) @@ -2098,11 +2221,19 @@ VIARestore(ScrnInfoPtr pScrn) hwp->writeSeq(hwp, 0x45, Regs->SR45); hwp->writeSeq(hwp, 0x46, Regs->SR46); + /* Reset VCK PLL */ + hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x02); /* Set SR40[1] to 1 */ + hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & 0xFD); /* Set SR40[1] to 0 */ + /* ECK Clock Synthesizer: */ hwp->writeSeq(hwp, 0x47, Regs->SR47); hwp->writeSeq(hwp, 0x48, Regs->SR48); hwp->writeSeq(hwp, 0x49, Regs->SR49); + /* Reset ECK PLL */ + hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x01); /* Set SR40[0] to 1 */ + hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & 0xFE); /* Set SR40[0] to 0 */ + switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: @@ -2112,9 +2243,22 @@ VIARestore(ScrnInfoPtr pScrn) hwp->writeSeq(hwp, 0x4A, Regs->SR4A); hwp->writeSeq(hwp, 0x4B, Regs->SR4B); hwp->writeSeq(hwp, 0x4C, Regs->SR4C); + + /* Reset LCK PLL */ + hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) | 0x04); /* Set SR40[2] to 1 */ + hwp->writeSeq(hwp, 0x40, hwp->readSeq(hwp, 0x40) & 0xFB); /* Set SR40[2] to 0 */ break; } + /* Restore Preemptive Arbiter Control Register + * VX800 and VX855 should restore this register too, + * but I don't do that for I don't want to affect any + * chips now. + */ + if (pVia->Chipset == VIA_VX900) { + hwp->writeSeq(hwp, 0x4D, Regs->SR4D); + } + /* Reset dotclocks. */ ViaSeqMask(hwp, 0x40, 0x06, 0x06); ViaSeqMask(hwp, 0x40, 0x00, 0x06); @@ -2127,14 +2271,23 @@ VIARestore(ScrnInfoPtr pScrn) hwp->writeCrtc(hwp, 0x32, Regs->CR32); /* HSYNCH Adjuster */ hwp->writeCrtc(hwp, 0x33, Regs->CR33); - /* Starting Address Overflow */ - hwp->writeCrtc(hwp, 0x34, Regs->CR34); /* Extended Overflow */ hwp->writeCrtc(hwp, 0x35, Regs->CR35); /*Power Management 3 (Monitor Control) */ hwp->writeCrtc(hwp, 0x36, Regs->CR36); + /* Starting Address */ + /* Start Address High */ + hwp->writeCrtc(hwp, 0x0C, Regs->CR0C); + /* Start Address Low */ + hwp->writeCrtc(hwp, 0x0D, Regs->CR0D); + /* Starting Address Overflow Bits[28:24] */ hwp->writeCrtc(hwp, 0x48, Regs->CR48); + /* CR34 are fire bits. Must be written after CR0C CR0D CR48. */ + /* Starting Address Overflow Bits[23:16] */ + hwp->writeCrtc(hwp, 0x34, Regs->CR34); + + hwp->writeCrtc(hwp, 0x49, Regs->CR49); /* Restore LCD control registers. */ @@ -2160,6 +2313,7 @@ VIARestore(ScrnInfoPtr pScrn) case VIA_CX700: case VIA_VX800: case VIA_VX855: + case VIA_VX900: /* LVDS Control Register */ hwp->writeCrtc(hwp, 0xD2, Regs->CRD2); break; @@ -2189,6 +2343,7 @@ ViaMMIOEnable(ScrnInfoPtr pScrn) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: ViaSeqMask(hwp, 0x1A, 0x08, 0x08); break; default: @@ -2212,6 +2367,7 @@ ViaMMIODisable(ScrnInfoPtr pScrn) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: ViaSeqMask(hwp, 0x1A, 0x00, 0x08); break; default: @@ -2328,10 +2484,18 @@ VIAMapFB(ScrnInfoPtr pScrn) VIAPtr pVia = VIAPTR(pScrn); #ifdef XSERVER_LIBPCIACCESS - pVia->FrameBufferBase = pVia->PciInfo->regions[0].base_addr; + if (pVia->Chipset == VIA_VX900) { + pVia->FrameBufferBase = pVia->PciInfo->regions[2].base_addr; + } else { + pVia->FrameBufferBase = pVia->PciInfo->regions[0].base_addr; + } int err; #else - pVia->FrameBufferBase = pVia->PciInfo->memBase[0]; + if (pVia->Chipset == VIA_VX900) { + pVia->FrameBufferBase = pVia->PciInfo->memBase[2]; + } else { + pVia->FrameBufferBase = pVia->PciInfo->memBase[0]; + } #endif DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAMapFB\n")); @@ -2453,7 +2617,6 @@ static void VIALoadRgbLut(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual) { - VIAPtr pVia = VIAPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); int i, j, index; @@ -2844,7 +3007,7 @@ VIAInternalScreenInit(int scrnIndex, ScreenPtr pScreen) if (pVia->shadowFB) { pVia->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - pVia->ShadowPtr = xalloc(pVia->ShadowPitch * shadowHeight); + pVia->ShadowPtr = malloc(pVia->ShadowPitch * shadowHeight); displayWidth = pVia->ShadowPitch / (pScrn->bitsPerPixel >> 3); FBStart = pVia->ShadowPtr; } else { @@ -2880,7 +3043,6 @@ static Bool VIAWriteMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAWriteMode\n")); @@ -2917,6 +3079,7 @@ VIAWriteMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: /* * Since we are using virtual, we need to adjust * the offset to match the framebuffer alignment. @@ -2963,6 +3126,7 @@ VIACloseScreen(int scrnIndex, ScreenPtr pScreen) case VIA_P4M900: case VIA_VX800: case VIA_VX855: + case VIA_VX900: break; default : hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); @@ -2986,11 +3150,11 @@ VIACloseScreen(int scrnIndex, ScreenPtr pScreen) viaExitAccel(pScreen); if (pVia->ShadowPtr) { - xfree(pVia->ShadowPtr); + free(pVia->ShadowPtr); pVia->ShadowPtr = NULL; } if (pVia->DGAModes) { - xfree(pVia->DGAModes); + free(pVia->DGAModes); pVia->DGAModes = NULL; } @@ -3033,9 +3197,7 @@ static void VIAAdjustFrame(int scrnIndex, int x, int y, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - CARD32 Base; DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAAdjustFrame %dx%d\n", x, y)); @@ -3173,7 +3335,6 @@ VIASwitchMode(int scrnIndex, DisplayModePtr mode, int flags) static void VIADPMS(ScrnInfoPtr pScrn, int mode, int flags) { - vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; diff --git a/driver/xf86-video-openchrome/src/via_driver.h b/driver/xf86-video-openchrome/src/via_driver.h index be9f0ebc3..e8c6e75fb 100644 --- a/driver/xf86-video-openchrome/src/via_driver.h +++ b/driver/xf86-video-openchrome/src/via_driver.h @@ -104,7 +104,7 @@ #define DRIVER_NAME "openchrome" #define VERSION_MAJOR 0 #define VERSION_MINOR 2 -#define PATCHLEVEL 904 +#define PATCHLEVEL 905 #define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL) #define VIA_VQ_SIZE (256 * 1024) @@ -127,9 +127,10 @@ typedef struct { CARD8 SR27, SR28, SR29, SR2A,SR2B,SR2C,SR2D,SR2E; CARD8 SR2F, SR30, SR31, SR32,SR33,SR34,SR40,SR41; CARD8 SR42, SR43, SR44, SR45,SR46,SR47,SR48,SR49; - CARD8 SR4A, SR4B, SR4C; + CARD8 SR4A, SR4B, SR4C, SR4D; /* extended CRTC registers */ + CARD8 CR0C, CR0D; CARD8 CR13, CR30, CR31, CR32, CR33, CR34, CR35, CR36; CARD8 CR37, CR38, CR39, CR3A, CR40, CR41, CR42, CR43; CARD8 CR44, CR45, CR46, CR47, CR48, CR49, CR4A; @@ -142,7 +143,7 @@ typedef struct { } VIARegRec, *VIARegPtr; /* - * varables that need to be shared among different screens. + * variables that need to be shared among different screens. */ typedef struct { Bool b3DRegsInitialized; @@ -285,6 +286,7 @@ typedef struct _VIA { Bool agpDMA; Bool nPOT[VIA_NUM_TEXUNITS]; const unsigned *TwodRegs; + const unsigned *HqvCmeRegs; ExaDriverPtr exaDriverPtr; ExaOffscreenArea *exa_scratch; unsigned int exa_scratch_next; @@ -412,13 +414,15 @@ typedef struct _VIA { void *cursorMap; CARD32 cursorOffset; + CARD8 I2CDevices; /* Option */ + #ifdef HAVE_DEBUG Bool disableXvBWCheck; Bool DumpVGAROM; Bool PrintVGARegs; Bool PrintTVRegs; Bool I2CScan; -#endif /* HAVE_DEBUG */
+#endif /* HAVE_DEBUG */ Bool UseLegacyModeSwitch ; video_via_regs* VideoRegs ; @@ -433,7 +437,7 @@ typedef struct Bool HasSecondary; Bool BypassSecondary; /*These two registers are used to make sure the CRTC2 is - retored before CRTC_EXT, otherwise it could lead to blank screen.*/ + restored before CRTC_EXT, otherwise it could lead to blank screen.*/ Bool IsSecondaryRestored; Bool RestorePrimary; diff --git a/driver/xf86-video-openchrome/src/via_i2c.c b/driver/xf86-video-openchrome/src/via_i2c.c index 80bc5de63..2f3cd2102 100644 --- a/driver/xf86-video-openchrome/src/via_i2c.c +++ b/driver/xf86-video-openchrome/src/via_i2c.c @@ -365,9 +365,18 @@ ViaI2CInit(ScrnInfoPtr pScrn) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaI2CInit\n")); - pVia->pI2CBus1 = ViaI2CBus1Init(pScrn->scrnIndex); - pVia->pI2CBus2 = ViaI2CBus2Init(pScrn->scrnIndex); - pVia->pI2CBus3 = ViaI2CBus3Init(pScrn->scrnIndex); + if (!pVia->I2CDevices) { + pVia->pI2CBus1 = ViaI2CBus1Init(pScrn->scrnIndex); + pVia->pI2CBus2 = ViaI2CBus2Init(pScrn->scrnIndex); + pVia->pI2CBus3 = ViaI2CBus3Init(pScrn->scrnIndex); + } else { + if (pVia->I2CDevices & VIA_I2C_BUS1) + pVia->pI2CBus1 = ViaI2CBus1Init(pScrn->scrnIndex); + if (pVia->I2CDevices & VIA_I2C_BUS2) + pVia->pI2CBus2 = ViaI2CBus2Init(pScrn->scrnIndex); + if (pVia->I2CDevices & VIA_I2C_BUS3) + pVia->pI2CBus3 = ViaI2CBus3Init(pScrn->scrnIndex); + } #ifdef HAVE_DEBUG if (pVia->I2CScan) { diff --git a/driver/xf86-video-openchrome/src/via_id.c b/driver/xf86-video-openchrome/src/via_id.c index c961ee162..c3525350c 100644 --- a/driver/xf86-video-openchrome/src/via_id.c +++ b/driver/xf86-video-openchrome/src/via_id.c @@ -63,6 +63,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Giga-byte 7VM400(A)M", VIA_KM400, 0x1458, 0xD000, VIA_DEVICE_CRT}, {"MSI KM4(A)M-V", VIA_KM400, 0x1462, 0x7061, VIA_DEVICE_CRT}, /* aka "DFI KM400-MLV" */ {"MSI PM8M2-V", VIA_KM400, 0x1462, 0x7071, VIA_DEVICE_CRT}, + {"MSI PM8M-V", VIA_KM400, 0x1462, 0x7104, VIA_DEVICE_CRT}, {"MSI KM4(A)M-L", VIA_KM400, 0x1462, 0x7348, VIA_DEVICE_CRT}, {"Abit VA-10 (1)", VIA_KM400, 0x147B, 0x140B, VIA_DEVICE_CRT}, {"Abit VA-10 (2)", VIA_KM400, 0x147B, 0x140C, VIA_DEVICE_CRT}, @@ -92,6 +93,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Shuttle FX21", VIA_K8M800, 0x1297, 0x3052, VIA_DEVICE_CRT}, {"Shuttle FX83", VIA_K8M800, 0x1297, 0xF683, VIA_DEVICE_CRT | VIA_DEVICE_TV}, {"Sharp Actius AL27", VIA_K8M800, 0x13BD, 0x1044, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Sharp Mebius PC-CS30H", VIA_K8M800, 0x13BD, 0x1047, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Sharp PC-AE30J", VIA_K8M800, 0x13BD, 0x104B, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Giga-byte GA-K8VM800M", VIA_K8M800, 0x1458, 0xD000, VIA_DEVICE_CRT}, {"MSI K8M Neo-V", VIA_K8M800, 0x1462, 0x0320, VIA_DEVICE_CRT}, @@ -114,6 +116,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Packard Bell Easynote B3 800/B3340", VIA_K8M800, 0x1631, 0xC009, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Packard Bell Imedia 2097", VIA_K8M800, 0x1631, 0xD007, VIA_DEVICE_CRT}, {"Fujitsu-Siemens Amilo K7610", VIA_K8M800, 0x1734, 0x10B3, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Lenovo ThinkCenter E51 8714", VIA_K8M800, 0x17AA, 0x1008, VIA_DEVICE_CRT}, {"ASRock K8Upgrade-VM800", VIA_K8M800, 0x1849, 0x3108, VIA_DEVICE_CRT}, {"Axper XP-M8VM800", VIA_K8M800, 0x1940, 0xD000, VIA_DEVICE_CRT}, @@ -138,8 +141,10 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Haier A60-440256080BD", VIA_VM800, 0x1019, 0x0F79, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"PCChips P23G", VIA_VM800, 0x1019, 0x1623, VIA_DEVICE_CRT}, {"ECS P4M800PRO-M", VIA_VM800, 0x1019, 0x2122, VIA_DEVICE_CRT}, + {"ECS P4M800PRO-M2 (V2.0)", VIA_VM800, 0x1019, 0x2123, VIA_DEVICE_CRT}, {"ECS C7VCM", VIA_VM800, 0x1019, 0xAA2D, VIA_DEVICE_CRT}, {"PCChips V21G", VIA_VM800, 0x1019, 0xAA51, VIA_DEVICE_CRT}, + {"Hewlett Packard DX2020", VIA_VM800, 0x103C, 0x3027, VIA_DEVICE_CRT}, {"Asustek P5VDC-MX", VIA_VM800, 0x1043, 0x3344, VIA_DEVICE_CRT}, {"Asustek P5VDC-TVM", VIA_VM800, 0x1043, 0x81CE, VIA_DEVICE_CRT}, {"Foxconn P4M800P7MB-RS2H", VIA_VM800, 0x105B, 0x0CF0, VIA_DEVICE_CRT}, @@ -152,6 +157,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"MSI PM8PM", VIA_VM800, 0x1462, 0x7222, VIA_DEVICE_CRT}, {"Twinhead M6", VIA_VM800, 0x14FF, 0xA007, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"RoverBook Partner W500", VIA_VM800, 0x1509, 0x4330, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"FIC PTM800Pro LF", VIA_VM800, 0x1509, 0x601A, VIA_DEVICE_CRT}, {"Clevo/RoverBook Voyager V511L", VIA_VM800, 0x1558, 0x0662, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo M5xxS", VIA_VM800, 0x1558, 0x5406, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Biostar P4M80-M4 / P4VMA-M", VIA_VM800, 0x1565, 0x1202, VIA_DEVICE_CRT}, @@ -170,6 +176,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Asustek M2V-MX SE", VIA_K8M890, 0x1043, 0x8297, VIA_DEVICE_CRT}, {"Foxconn K8M890M2MA-RS2H", VIA_K8M890, 0x105B, 0x0C84, VIA_DEVICE_CRT}, {"Shuttle FX22V1", VIA_K8M890, 0x1297, 0x3080, VIA_DEVICE_CRT}, + {"MSI K8M890M2-V", VIA_K8M890, 0x1462, 0x7139, VIA_DEVICE_CRT}, {"MSI K9VGM-V", VIA_K8M890, 0x1462, 0x7253, VIA_DEVICE_CRT}, {"Averatec 226x", VIA_K8M890, 0x14FF, 0xA002, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Fujitsu/Siemens Amilo La 1703", VIA_K8M890, 0x1734, 0x10D9, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, @@ -183,12 +190,15 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Mitac 8515", VIA_P4M900, 0x1071, 0x8515, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Medion Notebook MD96483", VIA_P4M900, 0x1071, 0x8615, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Mitac 8624", VIA_P4M900, 0x1071, 0x8624, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, - {"VIA VT3364 (P4M900)", VIA_P4M900, 0x1106, 0x3371, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"VIA VB8001 Mini-ITX Board (P4M900)", VIA_P4M900, 0x1106, 0x3371, VIA_DEVICE_CRT}, {"Gigabyte GA-VM900M", VIA_P4M900, 0x1458, 0xD000, VIA_DEVICE_CRT}, {"MSI VR321", VIA_P4M900, 0x1462, 0x3355, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"MSI P4M900M / P4M900M2-F/L", VIA_P4M900, 0x1462, 0x7255, VIA_DEVICE_CRT}, + {"MSI PM9M-V", VIA_P4M900, 0x1462, 0x7364, VIA_DEVICE_CRT}, {"MSI P4M900M3-L", VIA_P4M900, 0x1462, 0x7387, VIA_DEVICE_CRT}, {"Twinhead H12V", VIA_P4M900, 0x14FF, 0xA00F, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Twinhead K15V", VIA_P4M900, 0x14FF, 0xA012, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Semp Informática Notebook IS 1462", VIA_P4M900, 0x1509, 0x1D41, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Everex NC1501/NC1503", VIA_P4M900, 0x1509, 0x1E30, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo M660SE", VIA_P4M900, 0x1558, 0x0664, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo M660SR", VIA_P4M900, 0x1558, 0x0669, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, @@ -224,13 +234,23 @@ static struct ViaCardIdStruct ViaCardId[] = { /*** VX800 ***/ {"VIA Epia M700", VIA_VX800, 0x1106, 0x1122, VIA_DEVICE_CRT}, + {"Siragon ML-6200", VIA_VX800, 0x1106, 0x2211, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"Guillemot-Hercules ECafe EC900B", VIA_VX800, 0x1106, 0x3349, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"VIA OpenBook", VIA_VX800, 0x1170, 0x0311, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, /* VIA OpenBook eNote VBE8910 */ {"Samsung NC20", VIA_VX800, 0x144d, 0xc04e, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, + {"FIC CE2A1", VIA_VX800, 0x1509, 0x3002, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Quanta DreamBook Light IL1", VIA_VX800, 0x152d, 0x0771, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Lenovo S12", VIA_VX800, 0x17aa, 0x388c, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, /*** VX855 ***/ {"VIA VT8562C", VIA_VX855, 0x1106, 0x5122, VIA_DEVICE_CRT}, + {"OLPC XO 1.5", VIA_VX855, 0x152D, 0x0833, VIA_DEVICE_LCD}, + + /*** VX900 ***/ + {"Foxconn L740", VIA_VX900, 0x105B, 0x0CFD, VIA_DEVICE_LCD | VIA_DEVICE_CRT}, + {"HP T5550 Thin Client", VIA_VX900, 0x1106, 0x7122, VIA_DEVICE_CRT}, + {"ASRock PV530", VIA_VX900, 0x1849, 0x7122, VIA_DEVICE_CRT}, + /* keep this */ {NULL, VIA_UNKNOWN, 0x0000, 0x0000, VIA_DEVICE_NONE} diff --git a/driver/xf86-video-openchrome/src/via_id.h b/driver/xf86-video-openchrome/src/via_id.h index d941cf2e5..4db321d6c 100644 --- a/driver/xf86-video-openchrome/src/via_id.h +++ b/driver/xf86-video-openchrome/src/via_id.h @@ -39,6 +39,7 @@ enum VIACHIPTAGS { VIA_P4M890, VIA_VX800, VIA_VX855, + VIA_VX900, VIA_LAST }; @@ -56,6 +57,7 @@ enum VIACHIPTAGS { #define PCI_CHIP_VT3327 0x3343 /* P4M890 */ #define PCI_CHIP_VT3353 0x1122 /* VX800 */ #define PCI_CHIP_VT3409 0x5122 /* VX855/VX875 */ +#define PCI_CHIP_VT3410 0x7122 /* VX900 */ /* There is some conflicting information about the two major revisions of * the CLE266, often labelled Ax and Cx. The dividing line seems to be diff --git a/driver/xf86-video-openchrome/src/via_lvds.c b/driver/xf86-video-openchrome/src/via_lvds.c index 90c089ac7..03a79b3b3 100644 --- a/driver/xf86-video-openchrome/src/via_lvds.c +++ b/driver/xf86-video-openchrome/src/via_lvds.c @@ -42,7 +42,7 @@ 2^13 X 0.0698uSec [1/14.318MHz] = 8192 X 0.0698uSec =572.1uSec Timer = Counter x 572 uSec 2. Note: - 0.0698 uSec is too small to compute for hardware. So we multify a + 0.0698 uSec is too small to compute for hardware. So we multiply a reference value(2^13) to make it big enough to compute for hardware. 3. Note: The meaning of the TD0~TD3 are count of the clock. diff --git a/driver/xf86-video-openchrome/src/via_memcpy.c b/driver/xf86-video-openchrome/src/via_memcpy.c index d933ba042..b00584bf3 100644 --- a/driver/xf86-video-openchrome/src/via_memcpy.c +++ b/driver/xf86-video-openchrome/src/via_memcpy.c @@ -581,12 +581,12 @@ viaVidCopyInit(char *copyType, ScreenPtr pScreen) if (VIAAllocLinear(&tmpFbBuffer, pScrn, alignSize + 31)) return libc_YUV42X; - if (NULL == (buf2 = (unsigned char *)xalloc(testSize))) { + if (NULL == (buf2 = (unsigned char *)malloc(testSize))) { VIAFreeLinear(&tmpFbBuffer); return libc_YUV42X; } - if (NULL == (buf3 = (unsigned char *)xalloc(testSize))) { - xfree(buf2); + if (NULL == (buf3 = (unsigned char *)malloc(testSize))) { + free(buf2); VIAFreeLinear(&tmpFbBuffer); return libc_YUV42X; } @@ -642,8 +642,8 @@ viaVidCopyInit(char *copyType, ScreenPtr pScreen) curData->mName); } } - xfree(buf3); - xfree(buf2); + free(buf3); + free(buf2); VIAFreeLinear(&tmpFbBuffer); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Using %s YUV42X copy for %s.\n", diff --git a/driver/xf86-video-openchrome/src/via_mode.c b/driver/xf86-video-openchrome/src/via_mode.c index 7b845623c..476f1f121 100644 --- a/driver/xf86-video-openchrome/src/via_mode.c +++ b/driver/xf86-video-openchrome/src/via_mode.c @@ -308,11 +308,14 @@ ViaDFPDetect(ScrnInfoPtr pScrn) xf86MonPtr monPtr = NULL; if (pVia->pI2CBus2) - monPtr = xf86DoEDID_DDC2(pScrn->scrnIndex, pVia->pI2CBus2); + monPtr = xf86DoEEDID(pScrn->scrnIndex, pVia->pI2CBus2, TRUE); if (monPtr) { xf86PrintEDID(monPtr); xf86SetDDCproperties(pScrn, monPtr); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DDC pI2CBus2 detected a %s\n", DIGITAL(monPtr->features.input_type) ? + "DFP" : "CRT")); return TRUE; } else { return FALSE; @@ -380,6 +383,7 @@ ViaOutputsDetect(ScrnInfoPtr pScrn) case VIA_CX700: case VIA_VX800: case VIA_VX855: + case VIA_VX900: if (ViaDFPDetect(pScrn)) { pBIOSInfo->DfpPresent = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -514,6 +518,7 @@ ViaOutputsSelect(ScrnInfoPtr pScrn) case VIA_CX700: case VIA_VX800: case VIA_VX855: + case VIA_VX900: pVia->pBIOSInfo->Lvds->IsActive = TRUE ; break; } @@ -859,6 +864,9 @@ ViaGetMemoryBandwidth(ScrnInfoPtr pScrn) case VIA_MEM_DDR533: case VIA_MEM_DDR667: return VIA_BW_DDR667; + case VIA_MEM_DDR800: + case VIA_MEM_DDR1066: + return VIA_BW_DDR1066; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaBandwidthAllowed: Unknown memory type: %d\n", pVia->MemClk); @@ -999,8 +1007,8 @@ ViaSetDotclock(ScrnInfoPtr pScrn, CARD32 clock, int base, int probase) dn = pll.params.dn; dm = pll.params.dm; - /* The VX855 does not modify dm/dn, but earlier chipsets do. */ - if (pVia->Chipset != VIA_VX855) { + /* The VX855 and VX900 do not modify dm/dn, but earlier chipsets do. */ + if ((pVia->Chipset != VIA_VX855) && (pVia->Chipset != VIA_VX900)) { dm -= 2; dn -= 2; } @@ -1078,7 +1086,7 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode) pBIOSInfo->Clock = Table.InitTb.LCDClk_12Bit; else { pBIOSInfo->Clock = Table.InitTb.VClk_12Bit; - /* for some reason still to be defined this is neccessary */ + /* for some reason still to be defined this is necessary */ ViaSetSecondaryDotclock(pScrn, Table.InitTb.LCDClk_12Bit); } } else { @@ -1708,7 +1716,7 @@ ViaModeSet(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaModeSecondCRTC(pScrn, mode); ViaSecondDisplayChannelEnable(pScrn); } - + if (pBIOSInfo->FirstCRTC->IsActive) { if (pBIOSInfo->CrtActive) { /* CRT on FirstCRTC */ @@ -1734,6 +1742,15 @@ ViaModeSet(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaDisplayDisableCRT(pScrn); } + // Enable panel support on VM800, K8M800 and VX900 chipset + // See: https://bugs.launchpad.net/openchrome/+bug/186103 + if (pBIOSInfo->Panel->IsActive && + ((pVia->Chipset == VIA_VM800) || + (pVia->Chipset == VIA_K8M800) || + (pVia->Chipset == VIA_VX900) )) { + pBIOSInfo->FirstCRTC->IsActive=TRUE; + ViaModeFirstCRTC(pScrn, mode); + } if (pBIOSInfo->Simultaneous->IsActive) { ViaDisplayEnableSimultaneous(pScrn); } else { diff --git a/driver/xf86-video-openchrome/src/via_mode.h b/driver/xf86-video-openchrome/src/via_mode.h index 826df7fce..4df3e23a4 100644 --- a/driver/xf86-video-openchrome/src/via_mode.h +++ b/driver/xf86-video-openchrome/src/via_mode.h @@ -32,8 +32,9 @@ */ #define VIA_BW_MIN 74000000 /* > 640x480@60Hz@32bpp */ #define VIA_BW_DDR200 394000000 -#define VIA_BW_DDR400 498000000 /* > 1920x1080@60Hz@32bpp */ +#define VIA_BW_DDR400 553000000 /* > 1920x1200@60Hz@32bpp */ #define VIA_BW_DDR667 922000000 +#define VIA_BW_DDR1066 922000000 union pllparams { struct { @@ -54,50 +55,50 @@ static struct ViaDotClock { CARD16 UniChrome; union pllparams UniChromePro; } ViaDotClocks[] = { - { 25200, 0x513C, /* 0xa79004 */ { 1, 4, 6, 169 } }, - { 25312, 0xC763, /* 0xc49005 */ { 1, 4, 7, 198 } }, - { 26591, 0x471A, /* 0xce9005 */ { 1, 4, 7, 208 } }, - { 31500, 0xC558, /* 0xae9003 */ { 1, 4, 5, 176 } }, - { 31704, 0x471F, /* 0xaf9002 */ { 1, 4, 4, 177 } }, - { 32663, 0xC449, /* 0x479000 */ { 1, 4, 2, 73 } }, - { 33750, 0x4721, /* 0x959002 */ { 1, 4, 4, 151 } }, - { 35500, 0x5877, /* 0x759001 */ { 1, 4, 3, 119 } }, - { 36000, 0x5879, /* 0x9f9002 */ { 1, 4, 4, 161 } }, - { 39822, 0xC459, /* 0x578c02 */ { 1, 3, 4, 89 } }, - { 40000, 0x515F, /* 0x848c04 */ { 1, 3, 6, 134 } }, - { 41164, 0x4417, /* 0x2c8c00 */ { 1, 3, 2, 46 } }, - { 46981, 0x5069, /* 0x678c02 */ { 1, 3, 4, 105 } }, - { 49500, 0xC353, /* 0xa48c04 */ { 3, 3, 5, 138 } }, - { 50000, 0xC354, /* 0x368c00 */ { 1, 3, 2, 56 } }, - { 56300, 0x4F76, /* 0x3d8c00 */ { 1, 3, 2, 63 } }, - { 57275, 0, /* 0x3e8c00 */ { 1, 3, 5, 157 } }, /* For XO 1.5 no need for a unichrome clock */ - { 57284, 0x4E70, /* 0x3e8c00 */ { 1, 3, 2, 64 } }, - { 64995, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, - { 65000, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, /* Slightly unstable on PM800 */ - { 65028, 0x866D, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, - { 74480, 0x156E, /* 0x288800 */ { 1, 2, 2, 42 } }, - { 75000, 0x156E, /* 0x288800 */ { 1, 2, 2, 42 } }, - { 78800, 0x442C, /* 0x2a8800 */ { 1, 2, 2, 44 } }, - { 81135, 0x0622, /* 0x428801 */ { 1, 2, 3, 68 } }, - { 81613, 0x4539, /* 0x708803 */ { 1, 2, 5, 114 } }, - { 94500, 0x4542, /* 0x4d8801 */ { 1, 2, 3, 79 } }, - { 108000, 0x0B53, /* 0x778802 */ { 1, 2, 4, 121 } }, - { 108280, 0x4879, /* 0x778802 */ { 1, 2, 4, 121 } }, - { 122000, 0x0D6F, /* 0x428800 */ { 1, 2, 2, 68 } }, - { 122726, 0x073C, /* 0x878802 */ { 1, 2, 4, 137 } }, - { 135000, 0x0742, /* 0x6f8801 */ { 1, 2, 3, 113 } }, - { 148500, 0x0853, /* 0x518800 */ { 1, 2, 2, 83 } }, - { 155800, 0x0857, /* 0x558402 */ { 1, 1, 4, 87 } }, - { 157500, 0x422C, /* 0x2a8400 */ { 1, 1, 2, 44 } }, - { 161793, 0x4571, /* 0x6f8403 */ { 1, 1, 5, 113 } }, - { 162000, 0x0A71, /* 0x6f8403 */ { 1, 1, 5, 113 } }, - { 175500, 0x4231, /* 0x2f8400 */ { 1, 1, 2, 49 } }, - { 189000, 0x0542, /* 0x4d8401 */ { 1, 1, 3, 79 } }, - { 202500, 0x0763, /* 0x6F8402 */ { 1, 1, 4, 113 } }, - { 204800, 0x0764, /* 0x548401 */ { 1, 1, 3, 86 } }, - { 218300, 0x043D, /* 0x3b8400 */ { 1, 1, 2, 61 } }, - { 229500, 0x0660, /* 0x3e8400 */ { 1, 1, 2, 64 } }, /* Not tested on Pro } */ - { 0, 0, { 0, 0, 0, 0 } } + { 25200, 0x513C, /* 0xa79004 */ { { 1, 4, 6, 169 } } }, + { 25312, 0xC763, /* 0xc49005 */ { { 1, 4, 7, 198 } } }, + { 26591, 0x471A, /* 0xce9005 */ { { 1, 4, 7, 208 } } }, + { 31500, 0xC558, /* 0xae9003 */ { { 1, 4, 5, 176 } } }, + { 31704, 0x471F, /* 0xaf9002 */ { { 1, 4, 4, 177 } } }, + { 32663, 0xC449, /* 0x479000 */ { { 1, 4, 2, 73 } } }, + { 33750, 0x4721, /* 0x959002 */ { { 1, 4, 4, 151 } } }, + { 35500, 0x5877, /* 0x759001 */ { { 1, 4, 3, 119 } } }, + { 36000, 0x5879, /* 0x9f9002 */ { { 1, 4, 4, 161 } } }, + { 39822, 0xC459, /* 0x578c02 */ { { 1, 3, 4, 89 } } }, + { 40000, 0x515F, /* 0x848c04 */ { { 1, 3, 6, 134 } } }, + { 41164, 0x4417, /* 0x2c8c00 */ { { 1, 3, 2, 46 } } }, + { 46981, 0x5069, /* 0x678c02 */ { { 1, 3, 4, 105 } } }, + { 49500, 0xC353, /* 0xa48c04 */ { { 3, 3, 5, 138 } } }, + { 50000, 0xC354, /* 0x368c00 */ { { 1, 3, 2, 56 } } }, + { 56300, 0x4F76, /* 0x3d8c00 */ { { 1, 3, 2, 63 } } }, + { 57275, 0, /* 0x3e8c00 */ { { 1, 3, 5, 157 } } }, /* For XO 1.5 no need for a unichrome clock */ + { 57284, 0x4E70, /* 0x3e8c00 */ { { 1, 3, 2, 64 } } }, + { 64995, 0x0D3B, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, + { 65000, 0x0D3B, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, /* Slightly unstable on PM800 */ + { 65028, 0x866D, /* 0x6b8c01 */ { { 1, 3, 3, 109 } } }, + { 74480, 0x156E, /* 0x288800 */ { { 1, 2, 2, 42 } } }, + { 75000, 0x156E, /* 0x288800 */ { { 1, 2, 2, 42 } } }, + { 78800, 0x442C, /* 0x2a8800 */ { { 1, 2, 2, 44 } } }, + { 81135, 0x0622, /* 0x428801 */ { { 1, 2, 3, 68 } } }, + { 81613, 0x4539, /* 0x708803 */ { { 1, 2, 5, 114 } } }, + { 94500, 0x4542, /* 0x4d8801 */ { { 1, 2, 3, 79 } } }, + { 108000, 0x0B53, /* 0x778802 */ { { 1, 2, 4, 121 } } }, + { 108280, 0x4879, /* 0x778802 */ { { 1, 2, 4, 121 } } }, + { 122000, 0x0D6F, /* 0x428800 */ { { 1, 2, 2, 68 } } }, + { 122726, 0x073C, /* 0x878802 */ { { 1, 2, 4, 137 } } }, + { 135000, 0x0742, /* 0x6f8801 */ { { 1, 2, 3, 113 } } }, + { 148500, 0x0853, /* 0x518800 */ { { 1, 2, 2, 83 } } }, + { 155800, 0x0857, /* 0x558402 */ { { 1, 1, 4, 87 } } }, + { 157500, 0x422C, /* 0x2a8400 */ { { 1, 1, 2, 44 } } }, + { 161793, 0x4571, /* 0x6f8403 */ { { 1, 1, 5, 113 } } }, + { 162000, 0x0A71, /* 0x6f8403 */ { { 1, 1, 5, 113 } } }, + { 175500, 0x4231, /* 0x2f8400 */ { { 1, 1, 2, 49 } } }, + { 189000, 0x0542, /* 0x4d8401 */ { { 1, 1, 3, 79 } } }, + { 202500, 0x0763, /* 0x6F8402 */ { { 1, 1, 4, 113 } } }, + { 204800, 0x0764, /* 0x548401 */ { { 1, 1, 3, 86 } } }, + { 218300, 0x043D, /* 0x3b8400 */ { { 1, 1, 2, 61 } } }, + { 229500, 0x0660, /* 0x3e8400 */ { { 1, 1, 2, 64 } } }, /* Not tested on Pro } */ + { 0, 0, { { 0, 0, 0, 0 } } } }; /* @@ -131,7 +132,7 @@ static DisplayModeRec ViaPanelModes[] = { { MODEPREFIX("856x480"), 31704, 856, 872, 960, 1064, 0, 480, 480, 483, 497, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1024x512"), 41164, 1024, 1056, 1160, 1296, 0, 512, 512, 515, 531, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1024x576"), 46981, 1024, 1064, 1168, 1312, 0, 576, 576, 579, 597, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, - { MODEPREFIX("1024x600"), 48960, 1024, 1064, 1168, 1312, 0, 600, 601, 604, 622, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, + { MODEPREFIX("1024x600"), 48960, 1024, 1048, 1152, 1312, 0, 600, 601, 604, 630, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1024x768"), 65028, 1024, 1048, 1184, 1344, 0, 768, 770, 776, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, { MODEPREFIX("1152x864"), 81613, 1152, 1216, 1336, 1520, 0, 864, 864, 867, 895, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1280x768"), 81135, 1280, 1328, 1440, 1688, 0, 768, 770, 776, 802, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX }, diff --git a/driver/xf86-video-openchrome/src/via_panel.c b/driver/xf86-video-openchrome/src/via_panel.c index 322cda170..f6326ed4b 100644 --- a/driver/xf86-video-openchrome/src/via_panel.c +++ b/driver/xf86-video-openchrome/src/via_panel.c @@ -45,17 +45,17 @@ static ViaPanelModeRec ViaPanelNativeModes[] = { {1280, 768}, {1280, 1024}, {1400, 1050}, - {1600, 1200}, /* 0x6 Resolution 1440x900 */ + {1600, 1200}, /* 0x6 */ {1280, 800}, /* 0x7 Resolution 1280x800 (Samsung NC20) */ {800, 480}, /* 0x8 For Quanta 800x480 */ {1024, 600}, /* 0x9 Resolution 1024x600 (for HP 2133) */ {1366, 768}, /* 0xA Resolution 1366x768 */ {1920, 1080}, {1920, 1200}, - {1280, 1024}, /* 0xD Need to be fixed to 1920x1200 */ - {1440, 900}, /* 0xE Need to be fixed to 640x240 */ + {1280, 1024}, /* 0xD */ + {1440, 900}, /* 0xE */ {1280, 720}, /* 0xF 480x640 */ - {1200, 900}, /* 0x10 For Panasonic 1280x768 18bit Dual-Channel Panel */ + {1200, 900}, /* 0x10 For OLPC 1.5 */ {1360, 768}, /* 0x11 Resolution 1360X768 */ {1024, 768}, /* 0x12 Resolution 1024x768 */ {800, 480} /* 0x13 General 8x4 panel use this setting */ @@ -147,6 +147,9 @@ ViaPanelScaleDisable(ScrnInfoPtr pScrn) vgaHWPtr hwp = VGAHWPTR(pScrn); ViaCrtcMask(hwp, 0x79, 0x00, 0x01); + /* Disable VX900 down scaling */ + if (pVia->Chipset == VIA_VX900) + ViaCrtcMask(hwp, 0x89, 0x00, 0x01); if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) ViaCrtcMask(hwp, 0xA2, 0x00, 0xC8); } @@ -171,12 +174,18 @@ ViaPanelScale(ScrnInfoPtr pScrn, int resWidth, int resHeight, resWidth, resHeight, panelWidth, panelHeight)); if (resWidth < panelWidth) { - /* FIXME: It is different for chipset < K8M800 */ - horScalingFactor = ((resWidth - 1) * 4096) / (panelWidth - 1); + /* Load Horizontal Scaling Factor */ + if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { + horScalingFactor = ((resWidth - 1) * 4096) / (panelWidth - 1); + + /* Horizontal scaling enabled */ + cra2 = 0xC0; + cr9f = horScalingFactor & 0x0003; /* HSCaleFactor[1:0] at CR9F[1:0] */ + } else { + /* TODO: Need testing */ + horScalingFactor = ((resWidth - 1) * 1024) / (panelWidth - 1); + } - /* Horizontal scaling enabled */ - cra2 = 0xC0; - cr9f = horScalingFactor & 0x0003; /* HSCaleFactor[1:0] at CR9F[1:0] */ cr77 = (horScalingFactor & 0x03FC) >> 2; /* HSCaleFactor[9:2] at CR77[7:0] */ cr79 = (horScalingFactor & 0x0C00) >> 10; /* HSCaleFactor[11:10] at CR79[5:4] */ cr79 <<= 4; @@ -184,11 +193,18 @@ ViaPanelScale(ScrnInfoPtr pScrn, int resWidth, int resHeight, } if (resHeight < panelHeight) { - verScalingFactor = ((resHeight - 1) * 2048) / (panelHeight - 1); + /* Load Vertical Scaling Factor */ + if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { + verScalingFactor = ((resHeight - 1) * 2048) / (panelHeight - 1); + + /* Vertical scaling enabled */ + cra2 |= 0x08; + cr79 |= ((verScalingFactor & 0x0001) << 3); /* VSCaleFactor[0] at CR79[3] */ + } else { + /* TODO: Need testing */ + verScalingFactor = ((resHeight - 1) * 1024) / (panelHeight - 1); + } - /* Vertical scaling enabled */ - cra2 |= 0x08; - cr79 |= ((verScalingFactor & 0x0001) << 3); /* VSCaleFactor[0] at CR79[3] */ cr78 |= (verScalingFactor & 0x01FE) >> 1; /* VSCaleFactor[8:1] at CR78[7:0] */ cr79 |= ((verScalingFactor & 0x0600) >> 9) << 6; /* VSCaleFactor[10:9] at CR79[7:6] */ scaling = TRUE; @@ -203,12 +219,18 @@ ViaPanelScale(ScrnInfoPtr pScrn, int resWidth, int resHeight, ViaCrtcMask(hwp, 0x77, cr77, 0xFF); ViaCrtcMask(hwp, 0x78, cr78, 0xFF); ViaCrtcMask(hwp, 0x79, cr79, 0xF8); - ViaCrtcMask(hwp, 0x9F, cr9f, 0x03); + if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { + ViaCrtcMask(hwp, 0x9F, cr9f, 0x03); + } ViaCrtcMask(hwp, 0x79, 0x03, 0x03); - } else + } else { + /* Disable panel scale */ ViaCrtcMask(hwp, 0x79, 0x00, 0x01); - - ViaCrtcMask(hwp, 0xA2, cra2, 0xC8); + } + + if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { + ViaCrtcMask(hwp, 0xA2, cra2, 0xC8); + } /* Horizontal scaling selection: interpolation */ // ViaCrtcMask(hwp, 0x79, 0x02, 0x02); @@ -233,14 +255,14 @@ ViaPanelGetNativeDisplayMode(ScrnInfoPtr pScrn) if (panelMode->Width && panelMode->Height) { - /* TODO: fix refresh rate and check malloc */ + /* TODO: fix refresh rate */ DisplayModePtr p = malloc( sizeof(DisplayModeRec) ) ; - memset(p, 0, sizeof(DisplayModeRec)); + if (p) { + memset(p, 0, sizeof(DisplayModeRec)); - float refresh = 60.0f ; + float refresh = 60.0f ; - /* The following code is borrowed from xf86SetModeCrtc. */ - if (p) { + /* The following code is borrowed from xf86SetModeCrtc. */ viaTimingCvt(p, panelMode->Width, panelMode->Height, refresh, FALSE, TRUE); p->CrtcHDisplay = p->HDisplay; p->CrtcHSyncStart = p->HSyncStart; @@ -256,9 +278,13 @@ ViaPanelGetNativeDisplayMode(ScrnInfoPtr pScrn) p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal); p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay); p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal); - + + pVia->pBIOSInfo->Panel->NativeDisplayMode = p; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Out of memory. Size: %d bytes\n", sizeof(DisplayModeRec)); } - pVia->pBIOSInfo->Panel->NativeDisplayMode = p; + } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Invalid panel dimension (%dx%d)\n", panelMode->Width, @@ -282,10 +308,7 @@ ViaPanelPreInit(ScrnInfoPtr pScrn) Bool ret; ret = ViaPanelGetSizeFromDDCv1(pScrn, &width, &height); -/* - if (!ret) - ret = ViaPanelGetSizeFromDDCv2(pScrn, &width); -*/ + if (ret) { panel->NativeModeIndex = ViaPanelLookUpModeIndex(width, height); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelLookUpModeIndex, Width %d, Height %d, NativeModeIndex%d\n", width, height, panel->NativeModeIndex)); @@ -333,28 +356,28 @@ ViaPanelCenterMode(DisplayModePtr centerMode, DisplayModePtr panelMode, /* - * Try to interprete EDID ourselves. + * Try to interpret EDID ourselves. */ Bool ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon, int *width, int *height) { - int i, max = 0, vsize; + int i, max_hsize = 0, vsize = 0; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSizeFromEDID\n")); /* !!! Why are we not checking VESA modes? */ /* checking standard timings */ - for (i = 0; i < 8; i++) + for (i = 0; i < STD_TIMINGS; i++) if ((pMon->timings2[i].hsize > 256) - && (pMon->timings2[i].hsize > max)) { - max = pMon->timings2[i].hsize; + && (pMon->timings2[i].hsize > max_hsize)) { + max_hsize = pMon->timings2[i].hsize; vsize = pMon->timings2[i].vsize; } - if (max != 0) { - *width = max; + if (max_hsize != 0) { + *width = max_hsize; *height = vsize; return TRUE; } @@ -369,14 +392,14 @@ ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon, struct detailed_timings timing = pMon->det_mon[i].section.d_timings; /* ignore v_active for now */ - if ((timing.clock > 15000000) && (timing.h_active > max)) { - max = timing.h_active; + if ((timing.clock > 15000000) && (timing.h_active > max_hsize)) { + max_hsize = timing.h_active; vsize = timing.v_active; } } - if (max != 0) { - *width = max; + if (max_hsize != 0) { + *width = max_hsize; *height = vsize; return TRUE; } @@ -386,7 +409,6 @@ ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon, Bool ViaPanelGetSizeFromDDCv1(ScrnInfoPtr pScrn, int *width, int *height) - { VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr pMon; @@ -396,7 +418,7 @@ ViaPanelGetSizeFromDDCv1(ScrnInfoPtr pScrn, int *width, int *height) if (!xf86I2CProbeAddress(pVia->pI2CBus2, 0xA0)) return FALSE; - pMon = xf86DoEDID_DDC2(pScrn->scrnIndex, pVia->pI2CBus2); + pMon = xf86DoEEDID(pScrn->scrnIndex, pVia->pI2CBus2, TRUE); if (!pMon) return FALSE; diff --git a/driver/xf86-video-openchrome/src/via_swov.c b/driver/xf86-video-openchrome/src/via_swov.c index 119bbba1c..8fa8a6d54 100644 --- a/driver/xf86-video-openchrome/src/via_swov.c +++ b/driver/xf86-video-openchrome/src/via_swov.c @@ -65,6 +65,31 @@ #define IN_VIDEO_DISPLAY (*((unsigned long volatile *)(pVia->VidMapBase+V_FLAGS))&VBI_STATUS) #define VIA_FIRETIMEOUT 40000 +enum HQV_CME_Regs { + HQV_SDO_CTRL1, + HQV_SDO_CTRL2, + HQV_SDO_CTRL3, + HQV_SDO_CTRL4 +}; + +/* register offsets for VT3553/VX800 */ +static const unsigned hqv_cme_regs[] = { + [HQV_SDO_CTRL1] = HQV_SRC_DATA_OFFSET_CONTROL1, + [HQV_SDO_CTRL2] = HQV_SRC_DATA_OFFSET_CONTROL2, + [HQV_SDO_CTRL3] = HQV_SRC_DATA_OFFSET_CONTROL3, + [HQV_SDO_CTRL4] = HQV_SRC_DATA_OFFSET_CONTROL4 +}; + +/* register hqv offsets for new VT3409/VX855 */ +static const unsigned hqv_cme_regs_409[] = { + [HQV_SDO_CTRL1] = HQV_SRC_DATA_OFFSET_CTRL1_409, + [HQV_SDO_CTRL2] = HQV_SRC_DATA_OFFSET_CTRL2_409, + [HQV_SDO_CTRL3] = HQV_SRC_DATA_OFFSET_CTRL3_409, + [HQV_SDO_CTRL4] = HQV_SRC_DATA_OFFSET_CTRL4_409 +}; + +#define HQV_CME_REG(HWDiff, name) (HWDiff)->HQVCmeRegs[name] + static void viaWaitVideoCommandFire(VIAPtr pVia) { @@ -88,6 +113,7 @@ viaWaitHQVFlip(VIAPtr pVia) { unsigned long proReg = 0; CARD32 volatile *pdwState; + unsigned count = 50000; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) @@ -96,10 +122,9 @@ viaWaitHQVFlip(VIAPtr pVia) pdwState = (CARD32 volatile *)(pVia->VidMapBase + (HQV_CONTROL + proReg)); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { - // while (*pdwState & (HQV_SUBPIC_FLIP | HQV_SW_FLIP)) ; - while (*pdwState & HQV_SUBPIC_FLIP); + while (--count && (*pdwState & HQV_SUBPIC_FLIP)); } else { - while (!(*pdwState & HQV_FLIP_STATUS)) ; + while (--count && !(*pdwState & HQV_FLIP_STATUS)) ; } } @@ -109,8 +134,9 @@ viaWaitHQVFlipClear(VIAPtr pVia, unsigned long dwData) CARD32 volatile *pdwState = (CARD32 volatile *)(pVia->VidMapBase + HQV_CONTROL); *pdwState = dwData; + unsigned count = 50000; - while ((*pdwState & HQV_FLIP_STATUS)) { + while (--count && (*pdwState & HQV_FLIP_STATUS)) { VIDOutD(HQV_CONTROL, *pdwState | HQV_FLIP_STATUS); } } @@ -126,6 +152,7 @@ viaWaitHQVDone(VIAPtr pVia) { CARD32 volatile *pdwState; unsigned long proReg = 0; + unsigned count = 50000; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) @@ -133,7 +160,7 @@ viaWaitHQVDone(VIAPtr pVia) pdwState = (CARD32 volatile *)(pVia->VidMapBase + (HQV_CONTROL + proReg)); if (pVia->swov.MPEG_ON) { - while ((*pdwState & HQV_SW_FLIP)) ; + while (--count && (*pdwState & HQV_SW_FLIP)) ; } } @@ -179,12 +206,14 @@ ResetVidRegBuffer(VIAPtr pVia) static void SaveVideoRegister(VIAPtr pVia, CARD32 index, CARD32 data) { + if (pVia->VidRegCursor >= VIDREG_BUFFER_SIZE) { + DBG_DD(ErrorF("SaveVideoRegister: Out of video register space flushing")); + FlushVidRegBuffer(pVia); + ResetVidRegBuffer(pVia); + } + pVia->VidRegBuffer[pVia->VidRegCursor++] = index; pVia->VidRegBuffer[pVia->VidRegCursor++] = data; - - if (pVia->VidRegCursor > VIDREG_BUFFER_SIZE) { - DBG_DD(ErrorF("SaveVideoRegister: Out of video register space")); - } } /* @@ -224,6 +253,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; } + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; break; case VIA_KM400: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; @@ -232,6 +262,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; break; case VIA_K8M800: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; @@ -240,6 +271,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; break; case VIA_PM800: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; @@ -248,6 +280,8 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; + HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_VM800: case VIA_P4M900: @@ -257,6 +291,8 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; + HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_K8M890: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; @@ -265,6 +301,8 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_TRUE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; + HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_P4M890: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; @@ -273,6 +311,8 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_TRUE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; + HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_CX700: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; @@ -281,8 +321,19 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_FALSE; + HWDiff->HQVCmeRegs = hqv_cme_regs; break; case VIA_VX800: + HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; + HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; + HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; + HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; + HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; + HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_TRUE; + HWDiff->HQVCmeRegs = hqv_cme_regs; + break; case VIA_VX855: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; @@ -290,6 +341,8 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwHQVInitPatch = VID_HWDIFF_FALSE; HWDiff->dwHQVDisablePatch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; + HWDiff->dwNewScaleCtl = VID_HWDIFF_TRUE; + HWDiff->HQVCmeRegs = hqv_cme_regs_409; break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -339,6 +392,7 @@ viaOverlayGetV1V3Format(VIAPtr pVia, int vport, /* 1 or 3, as in V1 or V3 */ if (videoFlag & VIDEO_HQV_INUSE) { switch (pVia->swov.SrcFourCC) { case FOURCC_YV12: + case FOURCC_I420: case FOURCC_XVMC: *pHQVCtl |= HQV_YUV420; break; @@ -368,6 +422,7 @@ viaOverlayGetV1V3Format(VIAPtr pVia, int vport, /* 1 or 3, as in V1 or V3 */ } else { switch (pVia->swov.SrcFourCC) { case FOURCC_YV12: + case FOURCC_I420: case FOURCC_XVMC: if (vport == 1) { *pVidCtl |= V1_YCbCr420; @@ -450,6 +505,7 @@ viaOverlayGetSrcStartAddress(VIAPtr pVia, break; case FOURCC_YV12: + case FOURCC_I420: case FOURCC_XVMC: if (videoFlag & VIDEO_HQV_INUSE) @@ -509,10 +565,12 @@ viaOverlayHQVCalcZoomWidth(VIAPtr pVia, unsigned long *pMiniCtl, unsigned long *pHQVfilterCtl, unsigned long *pHQVminiCtl, + unsigned long *pHQVscaleCtlH, unsigned long *pHQVzoomflag) { unsigned long tmp, sw1, d, falign, mdiv; Bool zoom_ok = TRUE; + VIAHWDiff *hwDiff = &pVia->HWDiff; CARD32 HQVfilter[5] = { HQV_H_FILTER_DEFAULT, HQV_H_TAP4_121, HQV_H_TAP4_121, HQV_H_TAP8_12221, HQV_H_TAP8_12221 @@ -525,24 +583,57 @@ viaOverlayHQVCalcZoomWidth(VIAPtr pVia, if (srcWidth == dstWidth) { /* No zoom */ *pHQVfilterCtl |= HQV_H_FILTER_DEFAULT; } else if (srcWidth < dstWidth) { /* Zoom in */ - - tmp = srcWidth * 0x800 / dstWidth; - *pZoomCtl = ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; - *pMiniCtl |= V1_X_INTERPOLY; - zoom_ok = !(tmp > 0x7ff); - - *pHQVzoomflag = 1; - *pHQVfilterCtl |= HQV_H_FILTER_DEFAULT; - + *pZoomCtl &= 0x0000FFFF; + tmp = srcWidth * 0x800 / dstWidth; + *pZoomCtl |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; + *pMiniCtl |= V1_X_INTERPOLY; + zoom_ok = !(tmp > 0x7ff); + + *pHQVzoomflag = 1; + *pHQVfilterCtl |= HQV_H_FILTER_DEFAULT; } else { /* srcWidth > dstWidth - Zoom out */ + if (hwDiff->dwNewScaleCtl) { + if (srcWidth > (dstWidth << 3)) { + /*<1/8*/ + /*FIXME!*/ + if (dstWidth <= 32) { + dstWidth = 33; + } + if (srcWidth > (dstWidth << 5)) { + tmp = 1 * 0x1000 / 31; + } else { + tmp = (dstWidth * 0x1000) / srcWidth; + } - /* HQV rounding patch, instead of: - * //tmp = dstWidth*0x0800 / srcWidth; */ - tmp = dstWidth * 0x800 * 0x400 / srcWidth; - tmp = tmp / 0x400 + ((tmp & 0x3ff) ? 1 : 0); + *pHQVscaleCtlH = HQV_H_SCALE_DOWN_UNDER_EIGHTH; + } else if (srcWidth == (dstWidth << 3)) { + /*1/8*/ + tmp = ((dstWidth - 1) * 0x1000) / srcWidth; + *pHQVscaleCtlH = HQV_H_SCALE_DOWN_UNDER_EIGHTH; + } else if (srcWidth > (dstWidth << 2)) { + /*1/4 -1/8 zoom-out*/ + tmp = (srcWidth * 0x1000) / dstWidth; + *pHQVscaleCtlH = HQV_H_SCALE_DOWN_FOURTH_TO_EIGHTH; + } else { + /*1-1/4 zoom-out*/ + /*setting :src/(destination+0.5)*/ + tmp = (srcWidth * 0x2000) / ((dstWidth << 1) + 1); + *pHQVscaleCtlH = HQV_H_SCALE_DOWN_FOURTH_TO_1; + } - *pHQVminiCtl = (tmp & 0x7ff) | HQV_H_MINIFY_ENABLE | HQV_H_MINIFY_DOWN; + /*rounding to nearest interger*/ + tmp += (((tmp * 0x1000) & 0xfff) > 1) ? 1 : 0; + *pHQVscaleCtlH |= (tmp & 0x7fff) | HQV_H_SCALE_ENABLE; + } else { + /* HQV rounding patch, instead of: + * //tmp = dstWidth*0x0800 / srcWidth; */ + tmp = dstWidth * 0x800 * 0x400 / srcWidth; + tmp = tmp / 0x400 + ((tmp & 0x3ff) ? 1 : 0); + *pHQVminiCtl = (tmp & 0x7ff) | HQV_H_MINIFY_ENABLE | HQV_H_MINIFY_DOWN; + + *pHQVminiCtl |= HQV_HDEBLOCK_FILTER; + } /* Scale down the picture by a factor mdiv = (1 << d) = {2, 4, 8 or 16} */ sw1 = srcWidth; @@ -561,27 +652,25 @@ viaOverlayHQVCalcZoomWidth(VIAPtr pVia, *pMiniCtl |= ((d << 1) - 1) << 24; /* <= {1,3,5,7} << 24 */ *pHQVfilterCtl |= HQVfilter[d]; - /* *pHQVminiCtl = HQVmini[d]; */ - *pHQVminiCtl |= HQV_HDEBLOCK_FILTER; - /* Scale to arbitrary size, on top of previous scaling by (1 << d). */ + /* Scale to arbitrary size, on top of previous scaling by (1 << d). */ - if (sw1 < dstWidth) { - /* CLE bug - *pZoomCtl = sw1 * 0x0800 / dstWidth;*/ - *pZoomCtl = (sw1 - 2) * 0x0800 / dstWidth; - *pZoomCtl = ((*pZoomCtl & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; - } - } + if (sw1 < dstWidth) { + /* CLE bug + *pZoomCtl = sw1 * 0x0800 / dstWidth;*/ + *pZoomCtl = (sw1 - 2) * 0x0800 / dstWidth; + *pZoomCtl = ((*pZoomCtl & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; + } - if (videoFlag & VIDEO_1_INUSE) { - pVia->swov.overlayRecordV1.dwFetchAlignment = falign; - pVia->swov.overlayRecordV1.dwminifyH = mdiv; - } else { - pVia->swov.overlayRecordV3.dwFetchAlignment = falign; - pVia->swov.overlayRecordV3.dwminifyH = mdiv; - } + if (videoFlag & VIDEO_1_INUSE) { + pVia->swov.overlayRecordV1.dwFetchAlignment = falign; + pVia->swov.overlayRecordV1.dwminifyH = mdiv; + } else { + pVia->swov.overlayRecordV3.dwFetchAlignment = falign; + pVia->swov.overlayRecordV3.dwminifyH = mdiv; + } + } return zoom_ok; } @@ -591,10 +680,12 @@ viaOverlayHQVCalcZoomHeight(VIAPtr pVia, unsigned long *pZoomCtl, unsigned long *pMiniCtl, unsigned long *pHQVfilterCtl, unsigned long *pHQVminiCtl, + unsigned long *pHQVscaleCtlV, unsigned long *pHQVzoomflag) { unsigned long tmp, sh1, d; Bool zoom_ok = TRUE; + VIAHWDiff *hwDiff = &pVia->HWDiff; CARD32 HQVfilter[5] = { HQV_V_TAP4_121, HQV_V_TAP4_121, HQV_V_TAP4_121, HQV_V_TAP8_12221, HQV_V_TAP8_12221 }; @@ -608,48 +699,58 @@ viaOverlayHQVCalcZoomHeight(VIAPtr pVia, if (srcHeight == dstHeight) { /* No zoom */ *pHQVfilterCtl |= HQV_V_TAP4_121; } else if (srcHeight < dstHeight) { /* Zoom in */ + *pZoomCtl &= 0xFFFF0000; + tmp = srcHeight * 0x400 / dstHeight - 1; + *pZoomCtl |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); + *pMiniCtl |= (V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY); - tmp = srcHeight * 0x0400 / dstHeight; - *pZoomCtl |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); - *pMiniCtl |= (V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY); - - *pHQVzoomflag = 1; - *pHQVfilterCtl |= HQV_V_TAP4_121; + *pHQVzoomflag = 1; + *pHQVfilterCtl |= HQV_V_TAP4_121; } else { /* srcHeight > dstHeight - Zoom out */ + if (hwDiff->dwNewScaleCtl) { + /*setting :src/(destination+0.5)*/ + tmp = srcHeight * 0x2000 / ((dstHeight << 1) + 1); + tmp += (((tmp * 0x1000) & 0xfff) > 1) ? 1 : 0; + if ((tmp & 0x1ffff) == 0) { + tmp = 0x1ffff; + } - /* HQV rounding patch, instead of: - * //tmp = dstHeight*0x0800 / srcHeight; */ - tmp = dstHeight * 0x0800 * 0x400 / srcHeight; - tmp = tmp / 0x400 + ((tmp & 0x3ff) ? 1 : 0); - *pHQVminiCtl |= (((tmp & 0x7ff) << 16) | HQV_V_MINIFY_ENABLE - | HQV_V_MINIFY_DOWN); - - /* Scale down the picture by a factor (1 << d) = {2, 4, 8 or 16} */ - - sh1 = srcHeight; - for (d = 1; d < 5; d++) { - sh1 >>= 1; - if (sh1 <= dstHeight) - break; - } - if (d == 5) { /* Too small. */ - d = 4; - zoom_ok = FALSE; - } - - *pMiniCtl |= ((d << 1) - 1) << 16; /* <= {1,3,5,7} << 16 */ - - *pHQVfilterCtl |= HQVfilter[d]; - /* *pHQVminiCtl |= HQVmini[d]; */ - *pHQVminiCtl |= HQV_VDEBLOCK_FILTER; - - /* Scale to arbitrary size, on top of previous scaling by (1 << d). */ - - if (sh1 < dstHeight) { - tmp = sh1 * 0x0400 / dstHeight; - *pZoomCtl |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); - *pMiniCtl |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; - } + *pHQVscaleCtlV = (tmp & 0x1ffff) | HQV_V_SCALE_ENABLE| HQV_V_SCALE_DOWN; + } else { + /* HQV rounding patch, instead of: + * //tmp = dstHeight*0x0800 / srcHeight; */ + tmp = dstHeight * 0x0800 * 0x400 / srcHeight; + tmp = tmp / 0x400 + ((tmp & 0x3ff) ? 1 : 0); + *pHQVminiCtl |= (((tmp & 0x7ff) << 16) | HQV_V_MINIFY_ENABLE + | HQV_V_MINIFY_DOWN); + + /* Scale down the picture by a factor (1 << d) = {2, 4, 8 or 16} */ + + sh1 = srcHeight; + for (d = 1; d < 5; d++) { + sh1 >>= 1; + if (sh1 <= dstHeight) + break; + } + if (d == 5) { /* Too small. */ + d = 4; + zoom_ok = FALSE; + } + + *pMiniCtl |= ((d << 1) - 1) << 16; /* <= {1,3,5,7} << 16 */ + + *pHQVfilterCtl |= HQVfilter[d]; + /* *pHQVminiCtl |= HQVmini[d]; */ + *pHQVminiCtl |= HQV_VDEBLOCK_FILTER; + + /* Scale to arbitrary size, on top of previous scaling by (1 << d). */ + + if (sh1 < dstHeight) { + tmp = sh1 * 0x0400 / dstHeight; + *pZoomCtl |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); + *pMiniCtl |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; + } + } } return zoom_ok; @@ -665,6 +766,7 @@ viaOverlayGetFetch(VIAPtr pVia, unsigned long videoFlag, switch (pVia->swov.SrcFourCC) { case FOURCC_YV12: + case FOURCC_I420: case FOURCC_XVMC: n = 0; /* 2^n = 1 byte per pixel (Y channel in planar YUV) */ break; @@ -1048,7 +1150,8 @@ AddHQVSurface(ScrnInfoPtr pScrn, unsigned int numbuf, CARD32 fourcc) !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; - isplanar = ((fourcc == FOURCC_YV12) || (fourcc == FOURCC_XVMC)); + isplanar = ((fourcc == FOURCC_YV12) || (fourcc == FOURCC_I420) || + (fourcc == FOURCC_XVMC)); width = pVia->swov.SWDevice.gdwSWSrcWidth; height = pVia->swov.SWDevice.gdwSWSrcHeight; @@ -1091,6 +1194,7 @@ CreateSurface(ScrnInfoPtr pScrn, CARD32 FourCC, CARD16 Width, isplanar = FALSE; switch (FourCC) { case FOURCC_YV12: + case FOURCC_I420: case FOURCC_XVMC: isplanar = TRUE; pitch = ALIGN_TO(Width, 32); @@ -1183,9 +1287,10 @@ ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv, break; case FOURCC_YV12: + case FOURCC_I420: retCode = CreateSurface(pScrn, FourCC, Width, Height, TRUE); if (retCode == Success) - retCode = AddHQVSurface(pScrn, numbuf, FOURCC_YV12); + retCode = AddHQVSurface(pScrn, numbuf, FourCC); break; case FOURCC_XVMC: @@ -1247,6 +1352,7 @@ ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv) break; case FOURCC_YV12: + case FOURCC_I420: VIAFreeLinear(&pVia->swov.SWfbMem); case FOURCC_XVMC: pVia->swov.SrcFourCC = 0; @@ -1411,6 +1517,7 @@ SetupFIFOs(VIAPtr pVia, unsigned long videoFlag, { if (miniCtl & V1_Y_INTERPOLY) { if (pVia->swov.SrcFourCC == FOURCC_YV12 + || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { if (videoFlag & VIDEO_HQV_INUSE) { if (videoFlag & VIDEO_1_INUSE) @@ -1444,6 +1551,7 @@ SetupFIFOs(VIAPtr pVia, unsigned long videoFlag, } } else { if (pVia->swov.SrcFourCC == FOURCC_YV12 + || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { if (videoFlag & VIDEO_HQV_INUSE) { if (videoFlag & VIDEO_1_INUSE) @@ -1488,6 +1596,7 @@ SetColorKey(VIAPtr pVia, unsigned long videoFlag, if (videoFlag & VIDEO_1_INUSE) { SaveVideoRegister(pVia, V_COLOR_KEY, keyLow); + SaveVideoRegister(pVia, SND_COLOR_KEY, keyLow); } else { if (pVia->HWDiff.dwSupportTwoColorKey) /*CLE_C0 */ SaveVideoRegister(pVia, V3_COLOR_KEY, keyLow); @@ -1561,8 +1670,9 @@ SetHQVFetch(VIAPtr pVia, CARD32 srcFetch, unsigned long srcHeight) srcFetch >>= 3; /* fetch unit is 8 bytes */ } - SaveVideoRegister(pVia, HQV_SRC_FETCH_LINE + proReg, - ((srcFetch - 1) << 16) | (srcHeight - 1)); + if (pVia->ChipId != PCI_CHIP_VT3409) + SaveVideoRegister(pVia, HQV_SRC_FETCH_LINE + proReg, + ((srcFetch - 1) << 16) | (srcHeight - 1)); } static void @@ -1713,13 +1823,14 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, unsigned long zoomCtl = 0, miniCtl = 0; unsigned long hqvCtl = 0; unsigned long hqvFilterCtl = 0, hqvMiniCtl = 0; + unsigned long hqvScaleCtlH = 0, hqvScaleCtlV = 0; unsigned long haveHQVzoomH = 0, haveHQVzoomV = 0; unsigned long hqvSrcWidth = 0, hqvDstWidth = 0; unsigned long hqvSrcFetch = 0, hqvOffset = 0; unsigned long dwOffset = 0, fetch = 0, tmp = 0; unsigned long proReg = 0; - DBG_DD(ErrorF("videoflag=%p\n", videoFlag)); + DBG_DD(ErrorF("videoflag=%ld\n", videoFlag)); if (pVia->ChipId == PCI_CHIP_VT3259 && !(videoFlag & VIDEO_1_INUSE)) proReg = PRO_HQV1_OFFSET; @@ -1762,16 +1873,16 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, /* * FIXME: - * Enable video on secondary + * Enable video on secondary (change Panel to SecondCRTC?) */ if ((pVia->VideoEngine == VIDEO_ENGINE_CME || pVia->Chipset == VIA_VM800) && pVia->pBIOSInfo->Panel->IsActive) { /* V1_ON_SND_DISPLAY */ - vidCtl |= 0x80000000; + vidCtl |= V1_ON_SND_DISPLAY; /* SECOND_DISPLAY_COLOR_KEY_ENABLE */ - compose |= 0x00010000 | 0x1; + compose |= SECOND_DISPLAY_COLOR_KEY_ENABLE | 0x1; } viaOverlayGetV1V3Format(pVia, (videoFlag & VIDEO_1_INUSE) ? 1 : 3, @@ -1790,6 +1901,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, pVia->swov.overlayRecordV1.dwOffset = dwOffset; if (pVia->swov.SrcFourCC == FOURCC_YV12 + || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { YCBCRREC YCbCr; @@ -1882,6 +1994,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, SetHQVFetch(pVia, hqvSrcFetch, oriSrcHeight); if (pVia->swov.SrcFourCC == FOURCC_YV12 + || pVia->swov.SrcFourCC == FOURCC_I420 || pVia->swov.SrcFourCC == FOURCC_XVMC) { if (videoFlag & VIDEO_1_INUSE) SaveVideoRegister(pVia, V1_STRIDE, srcPitch << 1); @@ -1925,7 +2038,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, if (!viaOverlayHQVCalcZoomWidth(pVia, videoFlag, srcWidth, dstWidth, &zoomCtl, &miniCtl, &hqvFilterCtl, - &hqvMiniCtl, &haveHQVzoomH)) { + &hqvMiniCtl, &hqvScaleCtlH, &haveHQVzoomH)) { /* Need to scale (minify) too much - can't handle it. */ SetFetch(pVia, videoFlag, fetch); FireVideoCommand(pVia, videoFlag, compose); @@ -1964,7 +2077,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, if (!viaOverlayHQVCalcZoomHeight(pVia, srcHeight, dstHeight, &zoomCtl, &miniCtl, &hqvFilterCtl, &hqvMiniCtl, - &haveHQVzoomV)) { + &hqvScaleCtlV, &haveHQVzoomV)) { /* Need to scale (minify) too much - can't handle it. */ FireVideoCommand(pVia, videoFlag, compose); FlushVidRegBuffer(pVia); @@ -2008,8 +2121,13 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, hqvFilterCtl &= 0xfffdffff; SetMiniAndZoom(pVia, videoFlag, 0, 0); } - SaveVideoRegister(pVia, HQV_MINIFY_CONTROL + proReg, hqvMiniCtl); - SaveVideoRegister(pVia, HQV_FILTER_CONTROL + proReg, hqvFilterCtl); + if (hwDiff->dwNewScaleCtl) { + SaveVideoRegister(pVia, HQV_H_SCALE_CONTROL + proReg, hqvScaleCtlH); + SaveVideoRegister(pVia, HQV_V_SCALE_CONTROL + proReg, hqvScaleCtlV); + } else { + SaveVideoRegister(pVia, HQV_MINIFY_CONTROL + proReg, hqvMiniCtl); + } + SaveVideoRegister(pVia, HQV_FILTER_CONTROL + proReg, hqvFilterCtl); } else SetMiniAndZoom(pVia, videoFlag, miniCtl, zoomCtl); @@ -2022,11 +2140,24 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, miniCtl, compose); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { - VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL1,0); - VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL3,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL1),0); + SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL3),((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) { - VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL2,0); - VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL2),0); + SaveVideoRegister(pVia, HQV_CME_REG(hwDiff, HQV_SDO_CTRL4),((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + if (pVia->Chipset == VIA_VX855) { + SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL1,0); + SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL3,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL2,0); + SaveVideoRegister(pVia, HQV_DST_DATA_OFFSET_CTRL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + SaveVideoRegister(pVia, HQV_BACKGROUND_DATA_OFFSET,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); + SaveVideoRegister(pVia, HQV_EXTENDED_CONTROL,0); + /*0x3e0*/ + SaveVideoRegister(pVia, HQV_SUBP_HSCALE_CTRL,0); + /*0x3e8*/ + SaveVideoRegister(pVia, HQV_SUBP_VSCALE_CTRL,0); + SaveVideoRegister(pVia, HQV_DEFAULT_VIDEO_COLOR, HQV_FIX_COLOR); + } } } @@ -2062,9 +2193,6 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, usleep(1); } - if (pVia->VideoEngine == VIDEO_ENGINE_CME) - hqvCtl |= HQV_GEN_IRQ; - VIDOutD(HQV_CONTROL + proReg, hqvCtl & ~HQV_SW_FLIP); VIDOutD(HQV_CONTROL + proReg, hqvCtl | HQV_SW_FLIP); @@ -2176,6 +2304,7 @@ VIAVidUpdateOverlay(ScrnInfoPtr pScrn, LPDDUPDATEOVERLAY pUpdate) (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_RV32) || (pVia->swov.SrcFourCC == FOURCC_YV12) || + (pVia->swov.SrcFourCC == FOURCC_I420) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) { videoFlag = pVia->swov.gdwVideoFlagSW; } @@ -2250,6 +2379,7 @@ VIAVidUpdateOverlay(ScrnInfoPtr pScrn, LPDDUPDATEOVERLAY pUpdate) (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_RV32) || (pVia->swov.SrcFourCC == FOURCC_YV12) || + (pVia->swov.SrcFourCC == FOURCC_I420) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) { pVia->swov.SWDevice.gdwSWDstLeft = pUpdate->DstLeft + panDX; pVia->swov.SWDevice.gdwSWDstTop = pUpdate->DstTop + panDY; @@ -2309,6 +2439,7 @@ ViaOverlayHide(ScrnInfoPtr pScrn) (pVia->swov.SrcFourCC == FOURCC_RV16) || (pVia->swov.SrcFourCC == FOURCC_RV32) || (pVia->swov.SrcFourCC == FOURCC_YV12) || + (pVia->swov.SrcFourCC == FOURCC_I420) || (pVia->swov.SrcFourCC == FOURCC_XVMC)) videoFlag = pVia->swov.gdwVideoFlagSW; diff --git a/driver/xf86-video-openchrome/src/via_swov.h b/driver/xf86-video-openchrome/src/via_swov.h index d93aa83d3..5d735a742 100644 --- a/driver/xf86-video-openchrome/src/via_swov.h +++ b/driver/xf86-video-openchrome/src/via_swov.h @@ -53,7 +53,7 @@ typedef struct __VIAHWDiff { unsigned long dwThreeHQVBuffer; /* Use Three HQV Buffers */ /* unsigned long dwV3SrcHeightSetting; *//* Set Video Source Width and Height */ - /* unsigned long dwSupportExtendFIFO; *//* Support Extand FIFO */ + /* unsigned long dwSupportExtendFIFO; *//* Support Extend FIFO */ unsigned long dwHQVFetchByteUnit; /* HQV Fetch Count unit is byte */ unsigned long dwHQVInitPatch; /* Initialize HQV Engine 2 times */ /*unsigned long dwSupportV3Gamma; *//* Support V3 Gamma */ @@ -73,6 +73,8 @@ typedef struct __VIAHWDiff /*unsigned long dwV3FIFOPatch; *//* For CLE V3 FIFO Bug (srcWidth <= 8) */ unsigned long dwSupportTwoColorKey; /* Support two color key */ /* unsigned long dwCxColorSpace; *//* CLE_Cx ColorSpace */ + unsigned dwNewScaleCtl; /* Use new HQV scale engine code */ + const unsigned *HQVCmeRegs; /* Which set of CME regs to use for newer chipsets */ } VIAHWDiff; void VIAVidHWDiffInit(ScrnInfoPtr pScrn); diff --git a/driver/xf86-video-openchrome/src/via_timing.h b/driver/xf86-video-openchrome/src/via_timing.h index 85c1da43d..33f90a42c 100644 --- a/driver/xf86-video-openchrome/src/via_timing.h +++ b/driver/xf86-video-openchrome/src/via_timing.h @@ -40,7 +40,7 @@ #define TIMING_CVT_WARN_REFRESH_RATE_NOT_RB 1 << 3 /** - * Geneartes a CVT modeline + * Generates a CVT modeline * mode must not be null, if mode->name is null a new char* will be allocated. * */ diff --git a/driver/xf86-video-openchrome/src/via_vbe.c b/driver/xf86-video-openchrome/src/via_vbe.c index 2e3998f6b..b945f416c 100644 --- a/driver/xf86-video-openchrome/src/via_vbe.c +++ b/driver/xf86-video-openchrome/src/via_vbe.c @@ -230,7 +230,7 @@ ViaVbeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) /* Some cards do not like setting the clock. */ xf86ErrorF("...but worked OK without customized " "refresh and dotclock.\n"); - xfree(data->block); + free(data->block); data->block = NULL; data->mode &= ~(1 << 11); } else { @@ -322,7 +322,7 @@ ViaVbeSaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function) && (function == MODE_SAVE)) { /* Do not rely on the memory not being touched. */ if (pVia->vbeMode.pstate == NULL) - pVia->vbeMode.pstate = xalloc(pVia->vbeMode.stateSize); + pVia->vbeMode.pstate = malloc(pVia->vbeMode.stateSize); memcpy(pVia->vbeMode.pstate, pVia->vbeMode.state, pVia->vbeMode.stateSize); } diff --git a/driver/xf86-video-openchrome/src/via_vgahw.c b/driver/xf86-video-openchrome/src/via_vgahw.c index 0123f1071..34ab91f46 100644 --- a/driver/xf86-video-openchrome/src/via_vgahw.c +++ b/driver/xf86-video-openchrome/src/via_vgahw.c @@ -36,6 +36,11 @@ #include "via_driver.h" /* for HAVE_DEBUG */ #include "via_vgahw.h" +#if ABI_VIDEODRV_VERSION < 12 +#define PIOOFFSET hwp->PIOOffset +#else +#define PIOOFFSET 0 +#endif static CARD8 ViaVgahwIn(vgaHWPtr hwp, int address) @@ -43,7 +48,7 @@ ViaVgahwIn(vgaHWPtr hwp, int address) if (hwp->MMIOBase) return MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + address); else - return inb(hwp->PIOOffset + address); + return inb(PIOOFFSET + address); } static void @@ -52,7 +57,7 @@ ViaVgahwOut(vgaHWPtr hwp, int address, CARD8 value) if (hwp->MMIOBase) MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + address, value); else - outb(hwp->PIOOffset + address, value); + outb(PIOOFFSET + address, value); } /* diff --git a/driver/xf86-video-openchrome/src/via_video.c b/driver/xf86-video-openchrome/src/via_video.c index b9883dbbe..156f29384 100644 --- a/driver/xf86-video-openchrome/src/via_video.c +++ b/driver/xf86-video-openchrome/src/via_video.c @@ -117,6 +117,10 @@ static int viaSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); static int viaPutImage(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char *, short, short, Bool, RegionPtr, pointer, DrawablePtr); +static void UVBlit(unsigned char *dest, + const unsigned char *uBuffer, + const unsigned char *vBuffer, + unsigned width, unsigned srcPitch, unsigned dstPitch, unsigned lines); static void nv12Blit(unsigned char *nv12Chroma, const unsigned char *uBuffer, const unsigned char *vBuffer, @@ -158,11 +162,12 @@ static XF86AttributeRec AttributesG[NUM_ATTRIBUTES_G] = { {XvSettable | XvGettable, 0, 1, "XV_AUTOPAINT_COLORKEY"} }; -#define NUM_IMAGES_G 6 +#define NUM_IMAGES_G 7 static XF86ImageRec ImagesG[NUM_IMAGES_G] = { XVIMAGE_YUY2, XVIMAGE_YV12, + XVIMAGE_I420, { /* * Below, a dummy picture type that is used in XvPutImage only to do @@ -354,6 +359,14 @@ DecideOverlaySupport(ScrnInfoPtr pScrn) mClock = 333; memEfficiency = (float)SINGLE_3205_133; break; + case VIA_MEM_DDR800: + mClock = 400; + memEfficiency = (float)SINGLE_3205_133; + break; + case VIA_MEM_DDR1066: + mClock = 533; + memEfficiency = (float)SINGLE_3205_133; + break; default: /*Unknow DRAM Type */ DBG_DD(ErrorF("Unknow DRAM Type!\n")); @@ -426,7 +439,7 @@ DecideOverlaySupport(ScrnInfoPtr pScrn) DBG_DD(ErrorF(" via_video.c : totalBandwidth= %f : \n", totalBandWidth)); if (needBandWidth < totalBandWidth) - return TRUE; + return TRUE; } return FALSE; } @@ -466,8 +479,8 @@ viaResetVideo(ScrnInfoPtr pScrn) viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; - viaVidEng->compose = V1_COMMAND_FIRE;
- viaVidEng->compose = V3_COMMAND_FIRE;
+ viaVidEng->compose = V1_COMMAND_FIRE; + viaVidEng->compose = V3_COMMAND_FIRE; viaVidEng->color_key = 0x821; viaVidEng->snd_color_key = 0x821; @@ -479,7 +492,7 @@ viaSaveVideo(ScrnInfoPtr pScrn) VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; - DBG_DD(ErrorF(" via_video.c : viaSaveVideo : \n"));
+ DBG_DD(ErrorF(" via_video.c : viaSaveVideo : \n")); /* Save video registers */ memcpy(pVia->VideoRegs, (void*)viaVidEng, sizeof(video_via_regs)); @@ -487,8 +500,8 @@ viaSaveVideo(ScrnInfoPtr pScrn) pVia->dwV3 = ((vmmtr) viaVidEng)->video3_ctl; viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; - viaVidEng->compose = V1_COMMAND_FIRE;
- viaVidEng->compose = V3_COMMAND_FIRE;
+ viaVidEng->compose = V1_COMMAND_FIRE; + viaVidEng->compose = V3_COMMAND_FIRE; } void @@ -496,65 +509,83 @@ viaRestoreVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; - video_via_regs *localVidEng = pVia->VideoRegs;
-
+ video_via_regs *localVidEng = pVia->VideoRegs; + - DBG_DD(ErrorF(" via_video.c : viaRestoreVideo : \n"));
+ DBG_DD(ErrorF(" via_video.c : viaRestoreVideo : \n")); /* Restore video registers */ - /* flush restored video engines' setting to VidMapBase */
-
- viaVidEng->alphawin_hvstart = localVidEng->alphawin_hvstart;
- viaVidEng->alphawin_size = localVidEng->alphawin_size;
- viaVidEng->alphawin_ctl = localVidEng->alphawin_ctl;
- viaVidEng->alphafb_stride = localVidEng->alphafb_stride;
- viaVidEng->color_key = localVidEng->color_key;
- viaVidEng->alphafb_addr = localVidEng->alphafb_addr;
- viaVidEng->chroma_low = localVidEng->chroma_low;
- viaVidEng->chroma_up = localVidEng->chroma_up;
-
- if (pVia->ChipId != PCI_CHIP_VT3314)
- {
- /*VT3314 only has V3*/
- viaVidEng->video1_ctl = localVidEng->video1_ctl;
- viaVidEng->video1_fetch = localVidEng->video1_fetch;
- viaVidEng->video1y_addr1 = localVidEng->video1y_addr1;
- viaVidEng->video1_stride = localVidEng->video1_stride;
- viaVidEng->video1_hvstart = localVidEng->video1_hvstart;
- viaVidEng->video1_size = localVidEng->video1_size;
- viaVidEng->video1y_addr2 = localVidEng->video1y_addr2;
- viaVidEng->video1_zoom = localVidEng->video1_zoom;
- viaVidEng->video1_mictl = localVidEng->video1_mictl;
- viaVidEng->video1y_addr0 = localVidEng->video1y_addr0;
- viaVidEng->video1_fifo = localVidEng->video1_fifo;
- viaVidEng->video1y_addr3 = localVidEng->video1y_addr3;
- viaVidEng->v1_source_w_h = localVidEng->v1_source_w_h ;
- viaVidEng->video1_CSC1 = localVidEng->video1_CSC1;
- viaVidEng->video1_CSC2 = localVidEng->video1_CSC2;
- }
- viaVidEng->snd_color_key = localVidEng->snd_color_key;
- viaVidEng->v3alpha_prefifo = localVidEng->v3alpha_prefifo;
- viaVidEng->v3alpha_fifo = localVidEng->v3alpha_fifo;
- viaVidEng->video3_CSC2 = localVidEng->video3_CSC2;
- viaVidEng->video3_CSC2 = localVidEng->video3_CSC2;
- viaVidEng->v3_source_width = localVidEng->v3_source_width;
- viaVidEng->video3_ctl = localVidEng->video3_ctl;
- viaVidEng->video3_addr0 = localVidEng->video3_addr0;
- viaVidEng->video3_addr1 = localVidEng->video3_addr1;
- viaVidEng->video3_stride = localVidEng->video3_stride;
- viaVidEng->video3_hvstart = localVidEng->video3_hvstart;
- viaVidEng->video3_size = localVidEng->video3_size;
- viaVidEng->v3alpha_fetch = localVidEng->v3alpha_fetch;
- viaVidEng->video3_zoom = localVidEng->video3_zoom;
- viaVidEng->video3_mictl = localVidEng->video3_mictl;
- viaVidEng->video3_CSC1 = localVidEng->video3_CSC1;
- viaVidEng->video3_CSC2 = localVidEng->video3_CSC2;
- viaVidEng->compose = localVidEng->compose;
-
- viaVidEng->video1_ctl = pVia->dwV1; + /* flush restored video engines' setting to VidMapBase */ + + viaVidEng->alphawin_hvstart = localVidEng->alphawin_hvstart; + viaVidEng->alphawin_size = localVidEng->alphawin_size; + viaVidEng->alphawin_ctl = localVidEng->alphawin_ctl; + viaVidEng->alphafb_stride = localVidEng->alphafb_stride; + viaVidEng->color_key = localVidEng->color_key; + viaVidEng->alphafb_addr = localVidEng->alphafb_addr; + viaVidEng->chroma_low = localVidEng->chroma_low; + viaVidEng->chroma_up = localVidEng->chroma_up; + viaVidEng->interruptflag = localVidEng->interruptflag; + + if (pVia->ChipId != PCI_CHIP_VT3314) + { + /*VT3314 only has V3*/ + viaVidEng->video1_ctl = localVidEng->video1_ctl; + viaVidEng->video1_fetch = localVidEng->video1_fetch; + viaVidEng->video1y_addr1 = localVidEng->video1y_addr1; + viaVidEng->video1_stride = localVidEng->video1_stride; + viaVidEng->video1_hvstart = localVidEng->video1_hvstart; + viaVidEng->video1_size = localVidEng->video1_size; + viaVidEng->video1y_addr2 = localVidEng->video1y_addr2; + viaVidEng->video1_zoom = localVidEng->video1_zoom; + viaVidEng->video1_mictl = localVidEng->video1_mictl; + viaVidEng->video1y_addr0 = localVidEng->video1y_addr0; + viaVidEng->video1_fifo = localVidEng->video1_fifo; + viaVidEng->video1y_addr3 = localVidEng->video1y_addr3; + viaVidEng->v1_source_w_h = localVidEng->v1_source_w_h; + viaVidEng->video1_CSC1 = localVidEng->video1_CSC1; + viaVidEng->video1_CSC2 = localVidEng->video1_CSC2; + + /* Fix cursor garbage after suspend for VX855 and VX900 (#405) */ + /* 0x2E4 T Signature Data Result 1 */ + viaVidEng->video1u_addr1 = localVidEng->video1u_addr1; + /* 0x2E8 HI for Primary Display FIFO Control Signal */ + viaVidEng->video1u_addr2 = localVidEng->video1u_addr2; + /* 0x2EC HI for Primary Display FIFO Transparent color */ + viaVidEng->video1u_addr3 = localVidEng->video1u_addr3; + /* 0x2F0 HI for Primary Display Control Signal */ + viaVidEng->video1v_addr0 = localVidEng->video1v_addr0; + /* 0x2F4 HI for Primary Display Frame Buffer Starting Address */ + viaVidEng->video1v_addr1 = localVidEng->video1v_addr1; + /* 0x2F8 HI for Primary Display Horizontal and Vertical Start */ + viaVidEng->video1v_addr2 = localVidEng->video1v_addr2; + /* 0x2FC HI for Primary Display Center Offset */ + viaVidEng->video1v_addr3 = localVidEng->video1v_addr3; + } + viaVidEng->snd_color_key = localVidEng->snd_color_key; + viaVidEng->v3alpha_prefifo = localVidEng->v3alpha_prefifo; + viaVidEng->v3alpha_fifo = localVidEng->v3alpha_fifo; + viaVidEng->video3_CSC2 = localVidEng->video3_CSC2; + viaVidEng->video3_CSC2 = localVidEng->video3_CSC2; + viaVidEng->v3_source_width = localVidEng->v3_source_width; + viaVidEng->video3_ctl = localVidEng->video3_ctl; + viaVidEng->video3_addr0 = localVidEng->video3_addr0; + viaVidEng->video3_addr1 = localVidEng->video3_addr1; + viaVidEng->video3_stride = localVidEng->video3_stride; + viaVidEng->video3_hvstart = localVidEng->video3_hvstart; + viaVidEng->video3_size = localVidEng->video3_size; + viaVidEng->v3alpha_fetch = localVidEng->v3alpha_fetch; + viaVidEng->video3_zoom = localVidEng->video3_zoom; + viaVidEng->video3_mictl = localVidEng->video3_mictl; + viaVidEng->video3_CSC1 = localVidEng->video3_CSC1; + viaVidEng->video3_CSC2 = localVidEng->video3_CSC2; + viaVidEng->compose = localVidEng->compose; + viaVidEng->video3_ctl = pVia->dwV3; - if (pVia->ChipId != PCI_CHIP_VT3314)
- viaVidEng->compose = V1_COMMAND_FIRE;
- viaVidEng->compose = V3_COMMAND_FIRE;
+ if (pVia->ChipId != PCI_CHIP_VT3314) { + viaVidEng->video1_ctl = pVia->dwV1; + viaVidEng->compose = V1_COMMAND_FIRE; + } + viaVidEng->compose = V3_COMMAND_FIRE; } void @@ -573,8 +604,8 @@ viaExitVideo(ScrnInfoPtr pScrn) viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; - viaVidEng->compose = V1_COMMAND_FIRE;
- viaVidEng->compose = V3_COMMAND_FIRE;
+ viaVidEng->compose = V1_COMMAND_FIRE; + viaVidEng->compose = V3_COMMAND_FIRE; /* * Free all adaptor info allocated in viaInitVideo. @@ -591,15 +622,15 @@ viaExitVideo(ScrnInfoPtr pScrn) (viaPortPrivPtr) curAdapt->pPortPrivates->ptr + j, TRUE); } - xfree(curAdapt->pPortPrivates->ptr); + free(curAdapt->pPortPrivates->ptr); } - xfree(curAdapt->pPortPrivates); + free(curAdapt->pPortPrivates); } - xfree(curAdapt); + free(curAdapt); } } if (allAdaptors) - xfree(allAdaptors); + free(allAdaptors); } void @@ -610,7 +641,7 @@ viaInitVideo(ScreenPtr pScreen) XF86VideoAdaptorPtr *adaptors, *newAdaptors; int num_adaptors, num_new; - DBG_DD(ErrorF(" via_video.c : viaInitVideo : \n")); + DBG_DD(ErrorF(" via_video.c : viaInitVideo, Screen[%d]\n", pScrn->scrnIndex)); allAdaptors = NULL; newAdaptors = NULL; @@ -660,7 +691,7 @@ viaInitVideo(ScreenPtr pScreen) DBG_DD(ErrorF(" via_video.c : num_adaptors : %d\n", num_adaptors)); if (newAdaptors) { - allAdaptors = xalloc((num_adaptors + num_new) * + allAdaptors = malloc((num_adaptors + num_new) * sizeof(XF86VideoAdaptorPtr *)); if (allAdaptors) { if (num_adaptors) @@ -685,100 +716,6 @@ viaInitVideo(ScreenPtr pScreen) } } -static Bool -RegionsEqual(RegionPtr A, RegionPtr B) -{ - int *dataA, *dataB; - int num; - - num = REGION_NUM_RECTS(A); - if (num != REGION_NUM_RECTS(B)) - return FALSE; - - if ((A->extents.x1 != B->extents.x1) || - (A->extents.x2 != B->extents.x2) || - (A->extents.y1 != B->extents.y1) || (A->extents.y2 != B->extents.y2)) - return FALSE; - - dataA = (int *)REGION_RECTS(A); - dataB = (int *)REGION_RECTS(B); - - while (num--) { - if ((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) - return FALSE; - dataA += 2; - dataB += 2; - } - - return TRUE; -} - - -/* - * This one gets called, for example, on panning. - */ - -static int -viaReputImage(ScrnInfoPtr pScrn, - short drw_x, short drw_y, RegionPtr clipBoxes, pointer data, - DrawablePtr pDraw) -{ - - DDUPDATEOVERLAY UpdateOverlay_Video; - LPDDUPDATEOVERLAY lpUpdateOverlay = &UpdateOverlay_Video; - viaPortPrivPtr pPriv = (viaPortPrivPtr) data; - VIAPtr pVia = VIAPTR(pScrn); - - if (!RegionsEqual(&pPriv->clip, clipBoxes)) { - REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); - if (pPriv->autoPaint) { - if (pDraw->type == DRAWABLE_WINDOW) { - /* TODO Replace xf86XVFillKeyHelper with xf86XVFillKeyHelperDrawable
- Currently resizing problem exist in VLC Media Player
- Example of implementation:
- xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes);
- DamageDamageRegion(pDraw, clipBoxes); */
-
- xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
- } else { - xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
- } - } - } - - if (drw_x == pPriv->old_drw_x && - drw_y == pPriv->old_drw_y && - pVia->swov.oldPanningX == pVia->swov.panning_x && - pVia->swov.oldPanningY == pVia->swov.panning_y) { - viaXvError(pScrn, pPriv, xve_none); - return Success; - } - - lpUpdateOverlay->SrcLeft = pPriv->old_src_x; - lpUpdateOverlay->SrcTop = pPriv->old_src_y; - lpUpdateOverlay->SrcRight = pPriv->old_src_x + pPriv->old_src_w; - lpUpdateOverlay->SrcBottom = pPriv->old_src_y + pPriv->old_src_h; - - lpUpdateOverlay->DstLeft = drw_x; - lpUpdateOverlay->DstTop = drw_y; - lpUpdateOverlay->DstRight = drw_x + pPriv->old_drw_w; - lpUpdateOverlay->DstBottom = drw_y + pPriv->old_drw_h; - pPriv->old_drw_x = drw_x; - pPriv->old_drw_y = drw_y; - - lpUpdateOverlay->dwFlags = DDOVER_KEYDEST; - - if (pScrn->bitsPerPixel == 8) - lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff; - else - lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey; - - VIAVidUpdateOverlay(pScrn, lpUpdateOverlay); - - viaXvError(pScrn, pPriv, xve_none); - return Success; -} - static unsigned viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors) { @@ -787,7 +724,7 @@ viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors) DevUnion *pdevUnion; int i, j, usedPorts, numPorts; - DBG_DD(ErrorF(" via_video.c : viaSetupImageVideo: \n")); + DBG_DD(ErrorF(" via_video.c : viaSetupAdaptors (viaSetupImageVideo): \n")); xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); @@ -839,7 +776,7 @@ viaSetupAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr ** adaptors) viaAdaptPtr[i]->GetPortAttribute = viaGetPortAttribute; viaAdaptPtr[i]->SetPortAttribute = viaSetPortAttribute; viaAdaptPtr[i]->PutImage = viaPutImage; - viaAdaptPtr[i]->ReputImage = viaReputImage; + viaAdaptPtr[i]->ReputImage = NULL; viaAdaptPtr[i]->QueryImageAttributes = viaQueryImageAttributes; for (j = 0; j < numPorts; ++j) { viaPortPriv[j].dmaBounceBuffer = NULL; @@ -886,7 +823,7 @@ viaStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) if (exit) { ViaSwovSurfaceDestroy(pScrn, pPriv); if (pPriv->dmaBounceBuffer) - xfree(pPriv->dmaBounceBuffer); + free(pPriv->dmaBounceBuffer); pPriv->dmaBounceBuffer = 0; pPriv->dmaBounceStride = 0; pPriv->dmaBounceLines = 0; @@ -997,6 +934,8 @@ viaGetPortAttribute(ScrnInfoPtr pScrn, } } else { + DBG_DD(ErrorF(" via_video.c : viaGetPortAttribute : is not supported the attribute\n")); + /*return BadMatch */; } return Success; @@ -1025,6 +964,7 @@ Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, unsigned long DisplayBufferIndex) { unsigned long proReg = 0; + unsigned count = 50000; if (pVia->ChipId == PCI_CHIP_VT3259 && !(pVia->swov.gdwVideoFlagSW & VIDEO_1_INUSE)) @@ -1036,7 +976,8 @@ Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, case FOURCC_RV15: case FOURCC_RV16: case FOURCC_RV32: - while ((VIDInD(HQV_CONTROL + proReg) & HQV_SW_FLIP)); + while ((VIDInD(HQV_CONTROL + proReg) & HQV_SW_FLIP) + && --count); VIDOutD(HQV_SRC_STARTADDR_Y + proReg, pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); VIDOutD(HQV_CONTROL + proReg, @@ -1044,8 +985,10 @@ Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, proReg) & ~HQV_FLIP_ODD) | HQV_SW_FLIP | HQV_FLIP_STATUS); break; case FOURCC_YV12: + case FOURCC_I420: default: - while ((VIDInD(HQV_CONTROL + proReg) & HQV_SW_FLIP)); + while ((VIDInD(HQV_CONTROL + proReg) & HQV_SW_FLIP) + && --count); VIDOutD(HQV_SRC_STARTADDR_Y + proReg, pVia->swov.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); if (pVia->VideoEngine == VIDEO_ENGINE_CME) { @@ -1069,16 +1012,49 @@ Flip(VIAPtr pVia, viaPortPrivPtr pPriv, int fourcc, */ static void +planar420cp(unsigned char *dst, + const unsigned char *src, int dstPitch, int w, int h, int i420) +{ + /* + * Blit luma component as a fake YUY2 assembler blit. + */ + unsigned long srcUOffset, srcVOffset; + if (i420) { + srcVOffset = w * h + (w >> 1) * (h >> 1); + srcUOffset = w * h; + } else { + srcUOffset = w * h + (w >> 1) * (h >> 1); + srcVOffset = w * h; + } + + (*viaFastVidCpy) (dst, src, dstPitch, w >> 1, h, 1); + UVBlit(dst + dstPitch * h, src + srcUOffset, + src + srcVOffset, w >> 1, w >> 1, dstPitch, h >> 1); +} + +/* + * Slow and dirty. NV12 blit. + */ + +static void nv12cp(unsigned char *dst, - const unsigned char *src, int dstPitch, int w, int h, int yuv422) + const unsigned char *src, int dstPitch, int w, int h, int i420) { /* * Blit luma component as a fake YUY2 assembler blit. */ + unsigned long srcUOffset, srcVOffset; + if (i420) { + srcVOffset = w * h + (w >> 1) * (h >> 1); + srcUOffset = w * h; + } else { + srcUOffset = w * h + (w >> 1) * (h >> 1); + srcVOffset = w * h; + } (*viaFastVidCpy) (dst, src, dstPitch, w >> 1, h, TRUE); - nv12Blit(dst + dstPitch * h, src + w * h + (w >> 1) * (h >> 1), - src + w * h, w >> 1, w >> 1, dstPitch, h >> 1); + nv12Blit(dst + dstPitch * h, src + srcUOffset, + src + srcVOffset, w >> 1, w >>1, dstPitch, h >> 1); } #ifdef OPENCHROMEDRI @@ -1103,7 +1079,7 @@ viaDmaBlitImage(VIAPtr pVia, bounceBuffer = ((unsigned long)src & 15); nv12Conversion = (pVia->VideoEngine == VIDEO_ENGINE_CME && - id == FOURCC_YV12); + (id == FOURCC_YV12 || id == FOURCC_I420)); switch (id) { case FOURCC_YUY2: @@ -1118,6 +1094,7 @@ viaDmaBlitImage(VIAPtr pVia, break; case FOURCC_YV12: + case FOURCC_I420: default: bounceStride = ALIGN_TO(width, 16); bounceLines = height; @@ -1129,11 +1106,11 @@ viaDmaBlitImage(VIAPtr pVia, pPort->dmaBounceStride != bounceStride || pPort->dmaBounceLines != bounceLines) { if (pPort->dmaBounceBuffer) { - xfree(pPort->dmaBounceBuffer); + free(pPort->dmaBounceBuffer); pPort->dmaBounceBuffer = 0; } size = bounceStride * bounceLines + 16; - if (FOURCC_YV12 == id) + if (id == FOURCC_YV12 || id == FOURCC_I420) size += ALIGN_TO(bounceStride >> 1, 16) * bounceLines; pPort->dmaBounceBuffer = (unsigned char *)malloc(size); pPort->dmaBounceLines = bounceLines; @@ -1173,7 +1150,7 @@ viaDmaBlitImage(VIAPtr pVia, lumaSync = blit.sync; - if (id == FOURCC_YV12) { + if (id == FOURCC_YV12 || id == FOURCC_I420) { unsigned tmp = ALIGN_TO(width >> 1, 16); if (nv12Conversion) { @@ -1251,7 +1228,7 @@ viaPutImage(ScrnInfoPtr pScrn, unsigned long retCode; # ifdef XV_DEBUG - ErrorF(" via_video.c : viaPutImage : called, Screen[%d]\n", pScrn->scrnIndex);
+ ErrorF(" via_video.c : viaPutImage : called, Screen[%d]\n", pScrn->scrnIndex); ErrorF(" via_video.c : FourCC=0x%x width=%d height=%d sync=%d\n", id, width, height, sync); ErrorF @@ -1305,6 +1282,17 @@ viaPutImage(ScrnInfoPtr pScrn, #endif } else { switch (id) { + case FOURCC_I420: + if (pVia->VideoEngine == VIDEO_ENGINE_CME) { + planar420cp(pVia->swov.SWDevice. + lpSWOverlaySurface[pVia->dwFrameNum & 1], + buf, dstPitch, width, height, 1); + } else { + (*viaFastVidCpy)(pVia->swov.SWDevice. + lpSWOverlaySurface[pVia->dwFrameNum & 1], + buf, dstPitch, width, height, 0); + } + break; case FOURCC_YV12: if (pVia->VideoEngine == VIDEO_ENGINE_CME) { nv12cp(pVia->swov.SWDevice. @@ -1360,11 +1348,11 @@ viaPutImage(ScrnInfoPtr pScrn, lpUpdateOverlay->dwFlags = DDOVER_KEYDEST; - if (pScrn->bitsPerPixel == 8) {
- lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff;
- } else {
- lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey;
- }
+ if (pScrn->bitsPerPixel == 8) { + lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff; + } else { + lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey; + } /* If use extend FIFO mode */ if (pScrn->currentMode->HDisplay > 1024) { dwUseExtendedFIFO = 1; @@ -1390,7 +1378,8 @@ viaPutImage(ScrnInfoPtr pScrn, && (pPriv->old_src_w == src_w) && (pPriv->old_src_h == src_h) && (pVia->old_dwUseExtendedFIFO == dwUseExtendedFIFO) && (pVia->VideoStatus & VIDEO_SWOV_ON) && - RegionsEqual(&pPriv->clip, clipBoxes)) { + REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { + DBG_DD(ErrorF(" via_video.c : don't do UpdateOverlay! \n")); viaXvError(pScrn, pPriv, xve_none); return Success; } @@ -1408,23 +1397,18 @@ viaPutImage(ScrnInfoPtr pScrn, pVia->VideoStatus |= VIDEO_SWOV_ON; /* BitBlt: Draw the colorkey rectangle */ - if (!RegionsEqual(&pPriv->clip, clipBoxes)) { + if (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); if (pPriv->autoPaint) { if (pDraw->type == DRAWABLE_WINDOW) { - /* TODO Replace xf86XVFillKeyHelper with xf86XVFillKeyHelperDrawable
- Currently resizing problem exists in VLC Media Player
- Example of implementation:
- xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes);
- DamageDamageRegion(pDraw, clipBoxes);
- */
- xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
+ xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes); + DamageDamageRegion(pDraw, clipBoxes); } else { - xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
+ xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); } } - } else {
- DBG_DD(ErrorF(" via_video.c : // No need to draw Colorkey!! \n"));
+ } else { + DBG_DD(ErrorF(" via_video.c : // No need to draw Colorkey!! \n")); } /* * Update video overlay @@ -1459,6 +1443,7 @@ viaQueryImageAttributes(ScrnInfoPtr pScrn, DBG_DD(ErrorF(" via_video.c : viaQueryImageAttributes : FourCC=0x%x, ", id)); + DBG_DD(ErrorF(" via_video.c : Screen[%d], w=%d, h=%d\n", pScrn->scrnIndex, *w, *h)); if ((!w) || (!h)) return 0; @@ -1473,6 +1458,7 @@ viaQueryImageAttributes(ScrnInfoPtr pScrn, offsets[0] = 0; switch (id) { + case FOURCC_I420: case FOURCC_YV12: /*Planar format : YV12 -4:2:0 */ *h = (*h + 1) & ~1; size = *w; @@ -1559,6 +1545,35 @@ VIAVidAdjustFrame(ScrnInfoPtr pScrn, int x, int y) } /* + * Blit the U and V Fields. Used to Flip the U V for I420. + */ + +static void +UVBlit(unsigned char *dst, + const unsigned char *uBuffer, + const unsigned char *vBuffer, + unsigned width, unsigned srcPitch, unsigned dstPitch, unsigned lines) +{ + int i, j; + + dstPitch >>= 1; + + for(j = 0; j < lines; j++) + { + for(i = 0; i < width; i++) + { + dst[i] = (uBuffer[i] << 8) | (vBuffer[i] << 16); + } + + dst += dstPitch; + uBuffer += srcPitch; + vBuffer += srcPitch; + } + +} + + +/* * Blit the chroma field from one buffer to another while at the same time converting from * YV12 to NV12. */ diff --git a/driver/xf86-video-openchrome/src/via_video.h b/driver/xf86-video-openchrome/src/via_video.h index 03b33c945..feb600d92 100644 --- a/driver/xf86-video-openchrome/src/via_video.h +++ b/driver/xf86-video-openchrome/src/via_video.h @@ -44,10 +44,10 @@ #define VIDEO_BPP 2 -
-#define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */
-#define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */
-
+ +#define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */ +#define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */ + typedef struct { CARD32 interruptflag; /* 200 */ @@ -93,7 +93,7 @@ typedef struct CARD32 video3_ctl; /* 2a0 */ CARD32 video3_addr0; /* 2a4 */ CARD32 video3_addr1; /* 2a8 */ - CARD32 video3_stride; /* 2ac */
+ CARD32 video3_stride; /* 2ac */ CARD32 video3_hvstart; /* 2b0 */ CARD32 video3_size; /* 2b4 */ CARD32 v3alpha_fetch; /* 2b8 */ diff --git a/driver/xf86-video-openchrome/src/via_vt162x.c b/driver/xf86-video-openchrome/src/via_vt162x.c index aa64b336d..963e33d04 100644 --- a/driver/xf86-video-openchrome/src/via_vt162x.c +++ b/driver/xf86-video-openchrome/src/via_vt162x.c @@ -41,30 +41,42 @@ ViaSetTVClockSource(ScrnInfoPtr pScrn) VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; vgaHWPtr hwp = VGAHWPTR(pScrn); - /* External TV: */ - switch(pVia->Chipset) { - case VIA_CX700: - case VIA_VX800: - if (pBIOSInfo->FirstCRTC->IsActive) { - if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP1) - ViaCrtcMask(hwp, 0x6C, 0xB0, 0xF0); - else if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP0) - ViaCrtcMask(hwp, 0x6C, 0x90, 0xF0); - } else { - /* IGA2 */ - if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP1) - ViaCrtcMask(hwp, 0x6C, 0x0B, 0x0F); - else if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP0) - ViaCrtcMask(hwp, 0x6C, 0x09, 0x0F); + switch(pBIOSInfo->TVEncoder) { + case VIA_VT1625: + /* External TV: */ + switch(pVia->Chipset) { + case VIA_CX700: + case VIA_VX800: + case VIA_VX855: + if (pBIOSInfo->FirstCRTC->IsActive) { + if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP1) + ViaCrtcMask(hwp, 0x6C, 0xB0, 0xF0); + else if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP0) + ViaCrtcMask(hwp, 0x6C, 0x90, 0xF0); + } else { + /* IGA2 */ + if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP1) + ViaCrtcMask(hwp, 0x6C, 0x0B, 0x0F); + else if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP0) + ViaCrtcMask(hwp, 0x6C, 0x09, 0x0F); + } + break; + default: + if (pBIOSInfo->FirstCRTC->IsActive) + ViaCrtcMask(hwp, 0x6C, 0x21, 0x21); + else + ViaCrtcMask(hwp, 0x6C, 0xA1, 0xA1); + break; } break; default: if (pBIOSInfo->FirstCRTC->IsActive) - ViaCrtcMask(hwp, 0x6C, 0x21, 0x21); + ViaCrtcMask(hwp, 0x6C, 0x50, 0xF0); else - ViaCrtcMask(hwp, 0x6C, 0xA1, 0xA1); + ViaCrtcMask(hwp, 0x6C, 0x05, 0x0F); break; } + } static void diff --git a/driver/xf86-video-openchrome/src/via_xvmc.c b/driver/xf86-video-openchrome/src/via_xvmc.c index 120e251e4..7e52e33fa 100644 --- a/driver/xf86-video-openchrome/src/via_xvmc.c +++ b/driver/xf86-video-openchrome/src/via_xvmc.c @@ -151,7 +151,7 @@ cleanupViaXvMC(ViaXvMCPtr vXvMC, XF86VideoAdaptorPtr * XvAdaptors, for (i = 0; i < VIA_XVMC_MAX_CONTEXTS; ++i) { vXvMC->contexts[i] = 0; if (vXvMC->cPrivs[i]) { - xfree(vXvMC->cPrivs[i]); + free(vXvMC->cPrivs[i]); vXvMC->cPrivs[i] = 0; } } @@ -159,7 +159,7 @@ cleanupViaXvMC(ViaXvMCPtr vXvMC, XF86VideoAdaptorPtr * XvAdaptors, for (i = 0; i < VIA_XVMC_MAX_SURFACES; ++i) { vXvMC->surfaces[i] = 0; if (vXvMC->sPrivs[i]) { - xfree(vXvMC->sPrivs[i]); + free(vXvMC->sPrivs[i]); vXvMC->sPrivs[i] = 0; } } @@ -270,7 +270,7 @@ static XF86ImagePtr Via_subpicture_list[2] = { /* * Filling in the device dependent adaptor record. * This is named "VIA Video Overlay" because this code falls under the - * XV extenstion, the name must match or it won't be used. + * XV extension, the name must match or it won't be used. * * For surface and subpicture, see above. * The function pointers point to functions below. @@ -325,10 +325,11 @@ ViaInitXVMC(ScreenPtr pScreen) if ((pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_CX700) || + (pVia->Chipset == VIA_K8M890) || + (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX855) || - (pVia->Chipset == VIA_K8M890) || - (pVia->Chipset == VIA_P4M900)) { + (pVia->Chipset == VIA_VX900)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[XvMC] XvMC is not supported on this chipset.\n"); return; @@ -424,7 +425,7 @@ ViaCleanupXVMC(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr * XvAdaptors, viaPortPrivPtr pPriv = XvAdaptors[i]->pPortPrivates[j].ptr; if (pPriv->xvmc_priv) - xfree(pPriv->xvmc_priv); + free(pPriv->xvmc_priv); } } pVia->XvMCEnabled = 0; @@ -460,7 +461,7 @@ ViaXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext, return BadAlloc; } - *priv = xcalloc(1, sizeof(ViaXvMCCreateContextRec)); + *priv = calloc(1, sizeof(ViaXvMCCreateContextRec)); contextRec = (ViaXvMCCreateContextRec *) * priv; if (!*priv) { @@ -475,12 +476,12 @@ ViaXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext, break; } - cPriv = (ViaXvMCContextPriv *) xcalloc(1, sizeof(ViaXvMCContextPriv)); + cPriv = (ViaXvMCContextPriv *) calloc(1, sizeof(ViaXvMCContextPriv)); if (!cPriv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateContext: Unable to allocate memory!\n"); - xfree(*priv); + free(*priv); *num_priv = 0; return BadAlloc; } @@ -532,7 +533,7 @@ ViaXvMCCreateSurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, return BadAlloc; } - sPriv = (ViaXvMCSurfacePriv *) xcalloc(1, sizeof(ViaXvMCSurfacePriv)); + sPriv = (ViaXvMCSurfacePriv *) calloc(1, sizeof(ViaXvMCSurfacePriv)); if (!sPriv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -566,13 +567,13 @@ ViaXvMCCreateSurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, #endif *num_priv = numBuffers + 2; - *priv = (INT32 *) xcalloc(*num_priv, sizeof(INT32)); + *priv = (INT32 *) calloc(*num_priv, sizeof(INT32)); if (!*priv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSurface: Unable to allocate memory!\n"); *num_priv = 0; - xfree(sPriv); + free(sPriv); return BadAlloc; } @@ -588,8 +589,8 @@ ViaXvMCCreateSurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf, sPriv->memory_ref.pool = 0; if (VIAAllocLinear(&(sPriv->memory_ref), pScrn, numBuffers * bufSize + 32)) { - xfree(*priv); - xfree(sPriv); + free(*priv); + free(sPriv); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSurface: " "Unable to allocate frambuffer memory!\n"); return BadAlloc; @@ -631,7 +632,7 @@ ViaXvMCCreateSubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, return BadAlloc; } - sPriv = (ViaXvMCSurfacePriv *) xcalloc(1, sizeof(ViaXvMCSurfacePriv)); + sPriv = (ViaXvMCSurfacePriv *) calloc(1, sizeof(ViaXvMCSurfacePriv)); if (!sPriv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture:" @@ -640,13 +641,13 @@ ViaXvMCCreateSubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, return BadAlloc; } - *priv = (INT32 *) xcalloc(3, sizeof(INT32)); + *priv = (INT32 *) calloc(3, sizeof(INT32)); if (!*priv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture:" " Unable to allocate memory!\n"); *num_priv = 0; - xfree(sPriv); + free(sPriv); return BadAlloc; } @@ -663,8 +664,8 @@ ViaXvMCCreateSubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, bufSize = size_xx44(ctx->width, ctx->height); sPriv->memory_ref.pool = 0; if (VIAAllocLinear(&(sPriv->memory_ref), pScrn, 1 * bufSize + 32)) { - xfree(*priv); - xfree(sPriv); + free(*priv); + free(sPriv); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[XvMC] ViaXvMCCreateSubpicture:" " Unable to allocate framebuffer memory!\n"); return BadAlloc; @@ -701,7 +702,7 @@ ViaXvMCDestroyContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext) vx->ctxDisplaying = 0; } - xfree(vXvMC->cPrivs[i]); + free(vXvMC->cPrivs[i]); vXvMC->cPrivs[i] = 0; vXvMC->nContexts--; vXvMC->contexts[i] = 0; @@ -736,7 +737,7 @@ ViaXvMCDestroySurface(ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf) } VIAFreeLinear(&(vXvMC->sPrivs[i]->memory_ref)); - xfree(vXvMC->sPrivs[i]); + free(vXvMC->sPrivs[i]); vXvMC->nSurfaces--; vXvMC->sPrivs[i] = 0; vXvMC->surfaces[i] = 0; @@ -778,7 +779,7 @@ ViaXvMCDestroySubpicture(ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp) } VIAFreeLinear(&(vXvMC->sPrivs[i]->memory_ref)); - xfree(vXvMC->sPrivs[i]); + free(vXvMC->sPrivs[i]); vXvMC->nSurfaces--; vXvMC->sPrivs[i] = 0; vXvMC->surfaces[i] = 0; @@ -828,7 +829,7 @@ viaXvMCInitXv(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt) for (j = 0; j < XvAdapt->nPorts; ++j) { pPriv = (viaPortPrivPtr) XvAdapt->pPortPrivates[j].ptr; - if (NULL == (pPriv->xvmc_priv = xcalloc(1, sizeof(ViaXvMCXVPriv)))) + if (NULL == (pPriv->xvmc_priv = calloc(1, sizeof(ViaXvMCXVPriv)))) return BadAlloc; for (i = 0; i < VIA_NUM_XVMC_ATTRIBUTES; ++i) { diff --git a/driver/xf86-video-openchrome/tools/Makefile.am b/driver/xf86-video-openchrome/tools/Makefile.am new file mode 100644 index 000000000..6292e3243 --- /dev/null +++ b/driver/xf86-video-openchrome/tools/Makefile.am @@ -0,0 +1,6 @@ +if TOOLS +bin_PROGRAMS = via_regs_dump +via_regs_dump_SOURCES = registers.c +else +EXTRA_DIST = registers.c +endif diff --git a/driver/xf86-video-openchrome/tools/Makefile.in b/driver/xf86-video-openchrome/tools/Makefile.in new file mode 100644 index 000000000..d58bb27ea --- /dev/null +++ b/driver/xf86-video-openchrome/tools/Makefile.in @@ -0,0 +1,504 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@TOOLS_TRUE@bin_PROGRAMS = via_regs_dump$(EXEEXT) +subdir = tools +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am__via_regs_dump_SOURCES_DIST = registers.c +@TOOLS_TRUE@am_via_regs_dump_OBJECTS = registers.$(OBJEXT) +via_regs_dump_OBJECTS = $(am_via_regs_dump_OBJECTS) +via_regs_dump_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(via_regs_dump_SOURCES) +DIST_SOURCES = $(am__via_regs_dump_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_FALSE = @DEBUG_FALSE@ +DEBUG_TRUE = @DEBUG_TRUE@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRIVER_NAME = @DRIVER_NAME@ +DRI_CFLAGS = @DRI_CFLAGS@ +DRI_FALSE = @DRI_FALSE@ +DRI_LIBS = @DRI_LIBS@ +DRI_TRUE = @DRI_TRUE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GREP = @GREP@ +HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ +HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +TOOLS_FALSE = @TOOLS_FALSE@ +TOOLS_TRUE = @TOOLS_TRUE@ +VERSION = @VERSION@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ +XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@ +XVMC_CFLAGS = @XVMC_CFLAGS@ +XVMC_FALSE = @XVMC_FALSE@ +XVMC_LIBS = @XVMC_LIBS@ +XVMC_TRUE = @XVMC_TRUE@ +XV_DEBUG_FALSE = @XV_DEBUG_FALSE@ +XV_DEBUG_TRUE = @XV_DEBUG_TRUE@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +@TOOLS_TRUE@via_regs_dump_SOURCES = registers.c +@TOOLS_FALSE@EXTRA_DIST = registers.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +via_regs_dump$(EXEEXT): $(via_regs_dump_OBJECTS) $(via_regs_dump_DEPENDENCIES) + @rm -f via_regs_dump$(EXEEXT) + $(LINK) $(via_regs_dump_LDFLAGS) $(via_regs_dump_OBJECTS) $(via_regs_dump_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/registers.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/driver/xf86-video-openchrome/tools/registers.c b/driver/xf86-video-openchrome/tools/registers.c new file mode 100644 index 000000000..33c644554 --- /dev/null +++ b/driver/xf86-video-openchrome/tools/registers.c @@ -0,0 +1,1221 @@ +/* + * Copyright 2009 VIA Technologies, Inc. All Rights Reserved. + * + * 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 2, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; 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, write to the Free Software + * Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> +#include <getopt.h> + +#include <sys/types.h> +#include <sys/io.h> + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +struct bit_desc { + u_int8_t mask; + char *name; +}; + +struct io_index { + char *name; + struct bit_desc *bit_desc; +}; + +struct io_reg { + u_int16_t io_port_addr; /* port for address */ + u_int16_t io_port_data; /* port for address */ + char * name; + struct io_index index[0xff]; +}; + +struct io_reg attr_regs = { + .io_port_addr = 0x3c0, + .io_port_data = 0x3c1, + .name = "Attribute Controller", + .index = { + [0x00] = { "Palette 0", }, + [0x01] = { "Palette 1", }, + [0x02] = { "Palette 2", }, + [0x03] = { "Palette 3", }, + [0x04] = { "Palette 4", }, + [0x05] = { "Palette 5", }, + [0x06] = { "Palette 6", }, + [0x07] = { "Palette 7", }, + [0x08] = { "Palette 8", }, + [0x09] = { "Palette 9", }, + [0x0a] = { "Palette a", }, + [0x0b] = { "Palette b", }, + [0x0c] = { "Palette c", }, + [0x0d] = { "Palette d", }, + [0x0e] = { "Palette e", }, + [0x0f] = { "Palette f", }, + [0x10] = { "Mode Control", }, + [0x11] = { "Overscan Color", }, + [0x12] = { "Color Plane Enable", }, + [0x13] = { "Horizontal Pixel Panning", }, + [0x14] = { "Color Select", }, + }, +}; + +struct io_reg graphic_regs = { + .io_port_addr = 0x3ce, + .io_port_data = 0x3cf, + .name = "Graphic Controller", + .index = { + [0x00] = { "Set / Reset", }, + [0x01] = { "Enable Set / Reset", }, + [0x02] = { "Color Compare", }, + [0x03] = { "Data Rotate", }, + [0x04] = { "Read Map Select", }, + [0x05] = { "Mode", }, + [0x06] = { "Miscellaneous", }, + [0x07] = { "Color Don't Care", }, + [0x08] = { "Bit Mask", }, + /* Extended */ + [0x20] = { "Offset Register Control", }, + [0x21] = { "Offset Register A", }, + [0x22] = { "Offset Register B", }, + }, +}; + +struct io_reg crtc_regs = { + .io_port_addr = 0x3d4, + .io_port_data = 0x3d5, + .name = "CRT controller", + .index = { + /* CRT Controller registers */ + [0x00] = { "Horizontal Total", }, + [0x01] = { "Horizontal Display End", }, + [0x02] = { "Start Horizontal Blank", }, + [0x03] = { "End Horizontal Blank", }, + [0x04] = { "Start Horizontal Retrace", }, + [0x05] = { "End Horizontal Retrace", }, + [0x06] = { "Vertical Total", }, + [0x07] = { "Overflow", }, + [0x08] = { "Preset Row Scan", }, + [0x09] = { "Max Scan Line", }, + [0x0a] = { "Cursor Start", }, + [0x0b] = { "Cursor End", }, + [0x0c] = { "Start Address High", }, + [0x0d] = { "Start Address Low", }, + [0x0e] = { "Cursor Location High", }, + [0x0f] = { "Cursor Location Low", }, + [0x10] = { "Vertical Retrace Start", }, + [0x11] = { "Vertical Retrace End", }, + [0x12] = { "Vertical Display End", }, + [0x13] = { "Offset", }, + [0x14] = { "Underline Location", }, + [0x15] = { "Start Vertical Blank", }, + [0x16] = { "End Vertical Blank", }, + [0x17] = { "CRTC Mode Control", }, + [0x18] = { "Line Compare", }, + /* CRT Controller Extended Register */ + [0x30] = { "Display Fetch Blocking Control", }, + [0x31] = { "Half Line Position", }, + [0x32] = { "Mode Control", }, + [0x33] = { "Hsync Adjuster", }, + [0x34] = { "Starting Address Overflow", }, + [0x35] = { "Extended Overflow", }, + [0x36] = { "Power Management Control 3", }, + [0x37] = { "DAC Control", }, + [0x38] = { "Signature Data B0", }, + [0x39] = { "Signature Data B1", }, + [0x3a] = { "Signature Data B2", }, + [0x3b] = { "Scratch Pad 2", }, + [0x3c] = { "Scratch Pad 3", }, + [0x3d] = { "Scratch Pad 4", }, + [0x3e] = { "Scratch Pad 5", }, + [0x3f] = { "Scratch Pad 6", }, + [0x40] = { "Test Mode Control 0", }, + [0x43] = { "IGA1 Display Control", }, + [0x45] = { "Power Now Indicator Control 3", }, + [0x46] = { "Test Mode Control 1", }, + [0x47] = { "Test Mode Control 2", }, + [0x48] = { "Starting Address Overflow", }, + /* Sequencer Extended Registers */ + [0x50] = { "Second CRTC Horizontal Total Period", }, + [0x51] = { "Second CRTC Horizontal Active Data Period", }, + [0x52] = { "Second CRTC Horizontal Blanking Start", }, + [0x53] = { "Second CRTC Horizontal Blanking End", }, + [0x54] = { "Second CRTC Horizontal Blanking Overflow", }, + [0x55] = { "Second CRTC Horizontal Period Overflow", }, + [0x56] = { "Second CRTC Horizontal Retrace Start", }, + [0x57] = { "Second CRTC Horizontal Retrace End", }, + [0x58] = { "Second CRTC Vertical Total Period", }, + [0x59] = { "Second CRTC Vertical Active Data Period", }, + [0x5a] = { "Second CRTC Vertical Blanking Start", }, + [0x5b] = { "Second CRTC Vertical Blanking End", }, + [0x5c] = { "Second CRTC Vertical Blanking Overflow", }, + [0x5d] = { "Second CRTC Vertical Period Overflow", }, + [0x5e] = { "Second CRTC Vertical Retrace Start", }, + [0x5f] = { "Second CRTC Vertical Retrace End", }, + [0x60] = { "Second CRTC Vertical Status 1", }, + [0x61] = { "Second CRTC Vertical Status 2", }, + [0x62] = { "Second Display Starting Address Low", }, + [0x63] = { "Second Display Starting Address Middle", }, + [0x64] = { "Second Display Starting Address High", }, + [0x65] = { "Second Display Horizontal Quadword Count", }, + [0x66] = { "Second Display Horizontal Offset", }, + [0x67] = { "Second Display Col Depth and Horiz Overfl", }, + [0x68] = { "Second Display Queue Depth and Read Thresh", }, + [0x69] = { "Second Display Interrupt Enable and Status", }, + [0x6a] = { "Second Display Channel and LCD Enable", }, + [0x6b] = { "Channel 1 and 2 Clock Mode Selection", }, + [0x6c] = { "TV Clock Control", }, + [0x6d] = { "Horizontal Total Shadow", }, + [0x6e] = { "End Horizontal Blanking Shadow", }, + [0x6f] = { "Vertical Total Shadow", }, + [0x70] = { "Vertical Display Enable End Shadow", }, + [0x71] = { "Vertical Display Overflow Shadow", }, + [0x72] = { "Start Vertical Blank Shadow", }, + [0x73] = { "End Vertical Blank Shadow", }, + [0x74] = { "Vertical Blank Overflow Shadow", }, + [0x75] = { "Vertical Retrace Start Shadow", }, + [0x76] = { "Vertical Retrace End Shadow", }, + [0x77] = { "LCD Horizontal Scaling Factor", }, + [0x78] = { "LCD Vertical Scaling Facor", }, + [0x79] = { "LCD Scaling Control", }, + [0x7a] = { "LCD Scaling Parameter 1", }, + [0x7b] = { "LCD Scaling Parameter 2", }, + [0x7c] = { "LCD Scaling Parameter 3", }, + [0x7d] = { "LCD Scaling Parameter 4", }, + [0x7e] = { "LCD Scaling Parameter 5", }, + [0x7f] = { "LCD Scaling Parameter 6", }, + [0x80] = { "LCD Scaling Parameter 7", }, + [0x81] = { "LCD Scaling Parameter 8", }, + [0x82] = { "LCD Scaling Parameter 9", }, + [0x83] = { "LCD Scaling Parameter 10", }, + [0x84] = { "LCD Scaling Parameter 11", }, + [0x85] = { "LCD Scaling Parameter 12", }, + [0x86] = { "LCD Scaling Parameter 13", }, + [0x87] = { "LCD Scaling Parameter 14", }, + [0x88] = { "LCD Panel Type", }, + [0x8a] = { "LCD Timing Control 1", }, + [0x8b] = { "LCD Power Sequence Control 0", }, + [0x8c] = { "LCD Power Sequence Control 1", }, + [0x8d] = { "LCD Power Sequence Control 2", }, + [0x8e] = { "LCD Power Sequence Control 3", }, + [0x8f] = { "LCD Power Sequence Control 4", }, + [0x90] = { "LCD Power Sequence Control 5", }, + [0x91] = { "Software Cotnrol Power Sequence", }, + [0x92] = { "Read Threshold 2", }, + [0x94] = { "Expire Number and Display Queue Extend", }, + [0x95] = { "Extend Threshold Bit", }, + [0x97] = { "LVDS Channel 2 Function Select 0", }, + [0x98] = { "LVDS Channel 2 Function Select 1", }, + [0x99] = { "LVDS Channel 1 Function Select 0", }, + [0x9a] = { "LVDS Channel 1 Function Select 1", }, + [0x9b] = { "Digital Video Port 1 Function Select 0", }, + [0x9c] = { "Digital Video Port 1 Function Select 1", }, + [0x9d] = { "Power Now Control 2", }, + [0x9e] = { "Power Now Control 3", }, + [0x9f] = { "Power Now Control 4", }, + [0xa0] = { "Horizontal Scaling Initial Value", }, + [0xa1] = { "Vertical Scaling Initial Value", }, + [0xa2] = { "Horizontal and Vertical Scaling Enable", }, + [0xa3] = { "Second Display Starting Address Extended", }, + [0xa5] = { "Second LCD Vertical Scaling Factor", }, + [0xa6] = { "Second LCD Vertical Scaling Factor", }, + [0xa7] = { "Expected IGA1 Vertical Display End", }, + [0xa8] = { "Expected IGA1 Vertical Display End", }, + [0xa9] = { "Hardware Gamma Control", }, + [0xaa] = { "FIFO Depth + Threshold Overflow", }, + [0xab] = { "IGA2 Inetrlace Half Line", }, + [0xac] = { "IGA2 Inetrlace Half Line", }, + [0xaf] = { "P-Arbiter Write Expired Number", }, + [0xb0] = { "IGA2 Pack Circuit Request Threshold", }, + [0xb1] = { "IGA2 Pack Circuit Request High Threshold", }, + [0xb2] = { "IGA2 Pack Circuit Request Expire Threshold", }, + [0xb3] = { "IGA2 Pack Circuit Control", }, + [0xb4] = { "IGA2 Pack Circuit Target Base Address 0", }, + [0xb5] = { "IGA2 Pack Circuit Target Base Address 0", }, + [0xb6] = { "IGA2 Pack Circuit Target Base Address 0", }, + [0xb7] = { "IGA2 Pack Circuit Target Base Address 0", }, + [0xb8] = { "IGA2 Pack Circuit Target Line Pitch", }, + [0xb9] = { "IGA2 Pack Circuit Target Line Pitch", }, + [0xba] = { "V Counter Set Pointer", }, + [0xbb] = { "V Counter Set Pointer", }, + [0xbc] = { "V Counter Reset Value", }, + [0xbd] = { "V Counter Reset Value", }, + [0xbe] = { "Frame Buffer Limit Value", }, + [0xbf] = { "Frame Buffer Limit Value", }, + [0xc0] = { "Expected IGA1 Vertical Display End 1", }, + [0xc1] = { "Expected IGA1 Vertical Display End 1", }, + [0xc2] = { "Third LCD Vertical Scaling Factor", }, + [0xc3] = { "Third LCD Vertical Scaling Factor", }, + [0xc4] = { "Expected IGA1 Vertical Display End 2", }, + [0xc5] = { "Expected IGA1 Vertical Display End 2", }, + [0xc7] = { "Fourth LCD Vertical Scaling Factor", }, + [0xc8] = { "IGA2 Pack Circuit Target Base Address 1", }, + [0xc9] = { "IGA2 Pack Circuit Target Base Address 1", }, + [0xca] = { "IGA2 Pack Circuit Target Base Address 1", }, + [0xcb] = { "IGA2 Pack Circuit Target Base Address 1", }, + [0xd0] = { "LVDS PLL1 Control", }, + [0xd1] = { "LVDS PLL2 Control", }, + [0xd2] = { "LVDS Control", }, + [0xd3] = { "LVDS Second Power Sequence Control 0", }, + [0xd4] = { "LVDS Second Power Sequence Control 1", }, + [0xd5] = { "LVDS Texting Mode Control", }, + [0xd6] = { "DCVI Control Register 0", }, + [0xd7] = { "DCVI Control Register 1", }, + [0xd9] = { "Scaling Down Source Data Offset Control", }, + [0xda] = { "Scaling Down Source Data Offset Control", }, + [0xdb] = { "Scaling Down Source Data Offset Control", }, + [0xdc] = { "Scaling Down Vertical Scale Control", }, + [0xdd] = { "Scaling Down Vertical Scale Control", }, + [0xde] = { "Scaling Down Vertical Scale Control", }, + [0xdf] = { "Scaling Down Vertical Scale Control", }, + [0xe0] = { "Scaling Down Destination FB Starting Addr 0", }, + [0xe1] = { "Scaling Down Destination FB Starting Addr 0", }, + [0xe2] = { "Scaling Down Destination FB Starting Addr 0", }, + [0xe3] = { "Scaling Down Destination FB Starting Addr 0", }, + [0xe4] = { "Scaling Down SW Source FB Stride", }, + [0xe5] = { "Scaling Down Destination FB Starting Addr 1", }, + [0xe6] = { "Scaling Down Destination FB Starting Addr 1", }, + [0xe7] = { "Scaling Down Destination FB Starting Addr 1", }, + [0xe8] = { "Scaling Down Destination FB Starting Addr 1", }, + [0xe9] = { "Scaling Down Destination FB Starting Addr 2", }, + [0xea] = { "Scaling Down Destination FB Starting Addr 2", }, + [0xeb] = { "Scaling Down Destination FB Starting Addr 2", }, + [0xec] = { "IGA1 Down Scaling Destination Control", }, + [0xf0] = { "Snapshot Mode - Starting Address of Disp Data", }, + [0xf1] = { "Snapshot Mode - Starting Address of Disp Data", }, + [0xf2] = { "Snapshot Mode - Starting Address of Disp Data", }, + [0xf3] = { "Snapshot Mode Control", }, + [0xf4] = { "Snapshot Mode Control", }, + [0xf5] = { "Snapshot Mode Control", }, + [0xf6] = { "Snapshot Mode Control", }, + }, +}; + +static struct bit_desc seq_19_desc[] = { + { 0x01, "CPU Interface Clock Control", }, + { 0x02, "Display Interface Clock Control", }, + { 0x04, "MC Interface Clock Control", }, + { 0x08, "Typical Arbiter Interface Clock Control", }, + { 0x10, "AGP Interface Clock Control", }, + { 0x20, "P-Arbiter Interface Clock Control", }, + { 0x40, "MIU/AGP Interface Clock Control", }, + { 0 }, +}; + +static struct bit_desc seq_1b_desc[] = { + { 0x01, "Primary Display's LUT Off", }, + { 0x18, "Primary Display Engine VCK Gating", }, + { 0x60, "Secondary Display Engine LCK Gating", }, + { 0 }, +}; + +static struct bit_desc seq_1e_desc[] = { + { 0x01, "ROC ECK", }, + { 0x02, "Replace ECK by MCK", }, + { 0x08, "Spread Spectrum", }, + { 0x30, "DVP1 Power Control", }, + { 0xc0, "VCP Power Control", }, + { 0 }, +}; + +static struct bit_desc seq_2a_desc[] = { + { 0x03, "LVDS Channel 1 Pad Control" }, + { 0x0c, "LVDS Channel 2 Pad Control" }, + { 0x40, "Sprad Spectrum Type FIFO" }, + { 0 }, +}; + +static struct bit_desc seq_2b_desc[] = { + { 0x01, "MSI Pending IRQ Re-trigger", }, + { 0x02, "CRT Hot Plug Detect Enable", }, + { 0x04, "CRT Sense IRQ status", }, + { 0x08, "CRT Sense IRQ enable", }, + { 0x10, "LVDS Sense IRQ status", }, + { 0x20, "LVDS Sense IRQ enable", }, + { 0 }, +}; + +static struct bit_desc seq_2d_desc[] = { + { 0x03, "ECK Pll Power Control", }, + { 0x0c, "LCK PLL Power Control", }, + { 0x30, "VCK PLL Powre Control", }, + { 0xc0, "E3_ECK_N Selection", }, + { 0 }, +}; + +static struct bit_desc seq_2e_desc[] = { + { 0x03, "Video Playback Engine V3/V4 Gated Clock VCK", }, + { 0x0c, "PCI Master / DMA Gated Clock ECK/CPUCK", }, + { 0x30, "Video Processor Gated Clock ECK", }, + { 0xc0, "Capturer Gated Clock ECK", }, + { 0 }, +}; + +static struct bit_desc seq_3c_desc[] = { + { 0x01, "AGP Bus Pack Door AGP3 Enable", }, + { 0x02, "Switch 3 PLLs to Prime Output", }, + { 0x04, "LCDCK PLL Locked Detect", }, + { 0x08, "VCK PLL Locked Detect", }, + { 0x10, "ECL PLL Locked Detect", }, + { 0x60, "PLL Frequency Division Select for Testing", }, + { 0 }, +}; + +static struct bit_desc seq_3f_desc[] = { + { 0x03, "Video Clock Control (Gated ECK)", }, + { 0x0c, "2D Clock Control (Gated ECK/CPUCK)", }, + { 0x30, "3D Clock Control (Gated ECK)", }, + { 0xc0, "CR Clock Control (Gated ECK)", }, + { 0 }, +}; + +static struct bit_desc seq_40_desc[] = { + { 0x01, "Reset ECK PLL", }, + { 0x02, "Reset VCK PLL", }, + { 0x04, "Reset LCDCK PLL", }, + { 0x08, "LVDS Interrupt Method", }, + { 0x30, "Free Run ECK Frequency within Idle Mode", }, + { 0x80, "CRT Sense Enable", }, + { 0 }, +}; + +static struct bit_desc seq_43_desc[] = { + { 0x01, "Notebook Used Flag", }, + { 0x04, "Typical Channel 1 Arbiter Read Back Data Overwrite Flag", }, + { 0x08, "Typical Channel 0 Arbiter Read Back Data Overwrite Flag", }, + { 0x10, "IGA1 Display FIFO Underflow Flag", }, + { 0x20, "IGA2 Dispaly FIFO Underflow Flag", }, + { 0x40, "Windows Media Video Enable Flag", }, + { 0x80, "Advance Video Enable Flag", }, + { 0 }, +}; + +static struct bit_desc seq_4e_desc[] = { + { 0x01, "HQV/Video/Capture Engine Reset", }, + { 0x02, "HQV/Video/Capture Register Reset", }, + { 0x04, "2D Engine Reset", }, + { 0x08, "2D Register Reset", }, + { 0x10, "3D Engine Reset", }, + { 0x20, "3D Register Reset", }, + { 0x40, "CR Engine Reset", }, + { 0x80, "CR Register Reset", }, + { 0 }, +}; + +static struct bit_desc seq_59_desc[] = { + { 0x01, "GFX-NM AGP Dynamic Clock Enable", }, + { 0x02, "GFX-NM GMINT Channel 0 Dynamic Clock Enable", }, + { 0x04, "GFX-NM GMINT Channel 1 Dynamic Clock Enable", }, + { 0x08, "GFX-NM PCIC Dynamic Clock Enable", }, + { 0x10, "GFX-NM IGA Dynamic Clock Enable", }, + { 0x20, "IGA Low Thrshold Enable", }, + { 0x80, "IGA1 Enable", }, + { 0 }, +}; + +static struct bit_desc seq_5b_desc[] = { + { 0x01, "LVDS1 Used IGA2 Source", }, + { 0x02, "LBDS1 Used IGA1 Source", }, + { 0x04, "LVDS0 Used IGA2 Source", }, + { 0x08, "LVDS1 Used IGA1 Source", }, + { 0x10, "DAC0 Used IGA2 Source", }, + { 0x20, "DAC0 Used IGA1 Source", }, + { 0x40, "DAC0 User is TV", }, + { 0x80, "DCVI Source Selection is TV", }, + { 0 }, +}; + +static struct bit_desc seq_5c_desc[] = { + { 0x01, "DVP1 Used IGA2 Source", }, + { 0x02, "DVP1 Used IGA1 Source", }, + { 0x10, "DAC1 Used IGA2 Source", }, + { 0x20, "DAC1 Used IGA1 Source", }, + { 0x40, "DAC1 User is TV", }, + { 0 }, +}; + +static struct bit_desc seq_76_desc[] = { + { 0x01, "Backlight Control Enable", }, + { 0 }, +}; + +struct io_reg sequencer_regs = { + .io_port_addr = 0x3c4, + .io_port_data = 0x3c5, + .name = "Sequencer", + .index = { + /* Sequencer Registers */ + [0x00] = { "Reset", }, + [0x01] = { "Clocking Mode", }, + [0x02] = { "Map Mask", }, + [0x03] = { "Character Map Select", }, + [0x04] = { "Memory Mode", }, + /* Extended Sequencer Registers */ + [0x10] = { "Extended Register Unlock", }, + [0x11] = { "Configuration 0", }, + [0x12] = { "Configuration 1", }, + [0x13] = { "Configuration 2 (DVP1 strapping)", }, + [0x14] = { "Frame Buffer Size Control", }, + [0x15] = { "Display Mode Control", }, + [0x16] = { "Display FIFO Threshold Control", }, + [0x17] = { "Display FIFO Control", }, + [0x18] = { "Display Arbiter Control 0", }, + [0x19] = { "Power Management", seq_19_desc, }, + [0x1a] = { "PCI Bus Control", }, + [0x1b] = { "Power Management Control 0", seq_1b_desc, }, + [0x1c] = { "Horizontal Display Fetch Count Data", }, + [0x1d] = { "Horizontal Display Fetch Count Control", }, + [0x1e] = { "Power Management Control", seq_1e_desc, }, + /* 1f: reserved */ + [0x20] = { "Typical Arbiter Control 0", }, + [0x21] = { "Typical Arbiter Control 1", }, + [0x22] = { "Display Arbiter Control 1", }, + [0x26] = { "IIC Serial Port Control 0", }, + [0x2a] = { "Power Management Control 5", seq_2a_desc, }, + [0x2b] = { "LVDS Interrupt Control", seq_2b_desc, }, + [0x2c] = { "General Purpose I/O Port", }, + [0x2d] = { "Power Management Control 1", seq_2d_desc, }, + [0x2e] = { "Power Management Control 2", seq_2e_desc, }, + [0x31] = { "IIC Serial Port Control 1", }, + [0x35] = { "Subsystem Vendor ID Low", }, + [0x36] = { "Subsystem Vendor ID High", }, + [0x37] = { "Subsystem ID Low", }, + [0x38] = { "Subsystem ID High", }, + [0x39] = { "BIOS Reserved Register 0", }, + [0x3a] = { "BIOS Reserved Register 1", }, + [0x3b] = { "PCI Revision ID Back Door", }, + [0x3c] = { "Miscellaneous", seq_3c_desc, }, + [0x3d] = { "General Purpose I/O Port", }, + [0x3e] = { "Miscellaneous Register for AGP Mux", }, + [0x3f] = { "Power Management Control 2", seq_3f_desc, }, + [0x40] = { "PLL Control", seq_40_desc, }, + [0x41] = { "Typical Arbiter Control 1", }, + [0x42] = { "Typical Arbiter Control 1", }, + [0x43] = { "Graphics Bonding Option", seq_43_desc, }, + [0x44] = { "VCK Clock Synthesizer Vallue 0", }, + [0x45] = { "VCK Clock Synthesizer Vallue 1", }, + [0x46] = { "VCK Clock Synthesizer Vallue 2", }, + [0x47] = { "ECK Clock Synthesizer Vallue 0", }, + [0x48] = { "ECK Clock Synthesizer Vallue 1", }, + [0x49] = { "ECK Clock Synthesizer Vallue 2", }, + [0x4a] = { "LDCK Clock Synthesizer Value 0", }, + [0x4b] = { "LDCK Clock Synthesizer Value 1", }, + [0x4c] = { "LDCK Clock Synthesizer Value 2", }, + [0x4d] = { "Preemptive Arbiter Control", }, + [0x4e] = { "Software Reset Control", }, + [0x4f] = { "CR Gating Clock Control", }, + [0x50] = { "AGP Control", }, + [0x51] = { "Display FIFO Control 1", }, + [0x52] = { "Integrated TV Shadow Register Control", }, + [0x53] = { "DAC Sense Control 1", }, + [0x54] = { "DAC Sense Control 2", }, + [0x55] = { "DAC Sense Control 3", }, + [0x56] = { "DAC Sense Control 4", }, + [0x57] = { "Display FIFO Control 2", }, + [0x58] = { "GFX Power Control 1", }, + [0x59] = { "GFX Power Control 2", seq_59_desc, }, + [0x5a] = { "PCI Bus Control 2", }, + [0x5b] = { "Device Used Status 0", seq_5b_desc, }, + [0x5c] = { "Device Used Status 1", seq_5c_desc, }, + [0x5d] = { "Timer Control", }, + [0x5e] = { "DAC Control 2", }, + [0x60] = { "I2C Mode Control", }, + [0x61] = { "I2C Host Address", }, + [0x62] = { "I2C Host Data", }, + [0x63] = { "I2C Host Control", }, + [0x64] = { "I2C Status", }, + [0x65] = { "Power Management Control 6", }, + [0x66] = { "GTI Control 0", }, + [0x67] = { "GTI Control 1", }, + [0x68] = { "GTI Control 1", }, + [0x69] = { "GTI Control 1", }, + [0x6a] = { "GTI Control 1", }, + [0x6b] = { "GTI Control 1", }, + [0x6c] = { "GTI Control 1", }, + [0x6d] = { "GTI Control 1", }, + [0x6e] = { "GTI Control 1", }, + [0x6f] = { "GTI Control 1", }, + [0x70] = { "GARB Control 0", }, + [0x71] = { "Typical Arbiter Control 2", }, + [0x72] = { "Typical Arbiter Control 3", }, + [0x73] = { "Typical Arbiter Control 4", }, + [0x74] = { "Typical Arbiter Control 5", }, + [0x75] = { "Typical Arbiter Control 6", }, + [0x76] = { "Backlight Control 1", seq_76_desc, }, + [0x77] = { "Backlight Control 2", }, + [0x78] = { "Backlight Control 3", }, + }, +}; + +static u_int8_t readb_idx_reg(u_int16_t port, u_int8_t index) +{ + outb(index, port-1); + return inb(port); +} + +static void writeb_idx_reg(u_int16_t port, u_int8_t index, + u_int8_t val) +{ + outb(index, port-1); + outb(val, port); +} + +static void writeb_idx_mask(u_int16_t reg, u_int8_t idx, u_int8_t val, + u_int8_t mask) +{ + u_int8_t tmp; + + tmp = readb_idx_reg(reg, idx); + tmp &= ~ mask; + tmp |= (val & mask); + writeb_idx_reg(reg, idx, tmp); +} + + +struct io_reg *io_regs[] = { + //&attr_regs, + &sequencer_regs, + &graphic_regs, + &crtc_regs, + NULL +}; + +struct half_mode { + u_int16_t total; + u_int16_t active; + u_int16_t blank_start; + u_int16_t blank_end; + u_int16_t retr_start; + u_int16_t retr_end; + int n_sync; +}; + +struct mode { + struct half_mode h; + struct half_mode v; + u_int32_t addr_start; + u_int8_t bpp; + u_int16_t horiz_quad_count; + u_int16_t horiz_offset; +}; + +static int get_mode(struct mode *m, int secondary) +{ + u_int8_t val; + + memset(m, 0, sizeof(*m)); + + if (!secondary) { + m->h.total = readb_idx_reg(0x3d5, 0x00); + m->h.active = readb_idx_reg(0x3d5, 0x01); + m->h.blank_start = readb_idx_reg(0x3d5, 0x02); + m->h.blank_end = readb_idx_reg(0x3d5, 0x03) & 0x1f; + m->h.retr_start = readb_idx_reg(0x3d5, 0x04); + m->h.retr_end = readb_idx_reg(0x3d5, 0x05) & 0x1f; + m->v.total = readb_idx_reg(0x3d5, 0x06) + 2; + + m->addr_start = readb_idx_reg(0x3d5, 0x0d); + m->addr_start |= readb_idx_reg(0x3d5, 0x0c) << 8; + + m->v.retr_start = readb_idx_reg(0x3d5, 0x10); + m->v.retr_end = readb_idx_reg(0x3d5, 0x11) & 0x0f; + m->v.active = readb_idx_reg(0x3d5, 0x12) + 1; + m->horiz_offset = readb_idx_reg(0x3d5, 0x13); + m->v.blank_start = readb_idx_reg(0x3d5, 0x15) + 1; + m->v.blank_end = readb_idx_reg(0x3d5, 0x16) + 1; + + /* overflow register 0x07 */ + val = readb_idx_reg(0x3d5, 0x07); + m->v.total |= ((val >> 0) & 0x1) << 8; + m->v.active |= ((val >> 1) & 0x1) << 8; + m->v.retr_start |= ((val >> 2) & 0x1) << 8; + m->v.blank_start |= ((val >> 3) & 0x1) << 8; + /* line compare */ + m->v.total |= ((val >> 5) & 0x1) << 9; + m->v.active |= ((val >> 6) & 0x1) << 9; + m->v.retr_start |= ((val >> 7) & 0x1) << 9; + + val = readb_idx_reg(0x3d5, 0x09); + m->v.blank_start |= ((val >> 5) & 0x1) << 9; + + val = readb_idx_reg(0x3d5, 0x33); + m->h.retr_start |= ((val >> 4) & 0x1) << 8; + m->h.blank_end |= ((val >> 5) & 0x1) << 6; + + val = readb_idx_reg(0x3d5, 0x34); + m->addr_start |= val << 16; + + val = readb_idx_reg(0x3d5, 0x35); + m->v.total |= ((val >> 0) & 0x1) << 10; + m->v.retr_start |= ((val >> 1) & 0x1) << 10; + m->v.active |= ((val >> 2) & 0x1) << 10; + m->v.blank_start |= ((val >> 3) & 0x1) << 10; + //line_comp |= ((val >> 4) & 0x1) << 10; + m->horiz_offset |= ((val >> 5) & 0x7) << 8; + + val = readb_idx_reg(0x3d5, 0x36); + m->h.total |= ((val >> 3) & 0x1) << 8; + + val = readb_idx_reg(0x3d5, 0x48); + m->addr_start |= ((val >> 0) & 0x1f) << 24; + + val = readb_idx_reg(0x3c5, 0x15); + switch ((val >> 2) & 0x3) { + case 0: + m->bpp = 8; + break; + case 1: + m->bpp = 16; + break; + case 2: + m->bpp = 30; + break; + case 3: + m->bpp = 32; + break; + } + + val = inb(0x3cc); + if (val & 0x40) + m->h.n_sync; + if (val & 0x80) + m->v.n_sync; + + /* add some weird multipliers and offsets */ + m->h.total = (m->h.total + 5) << 3; + m->h.active = (m->h.active + 1) << 3; + m->h.blank_start = (m->h.blank_start + 1) << 3; + m->h.blank_end = (m->h.blank_end + 1) << 3; + m->h.retr_start = (m->h.retr_start << 3); + m->h.retr_end = (m->h.retr_end << 3); + + } else { + /* horizontal */ + m->h.total = readb_idx_reg(0x3d5, 0x50) + 1; + m->h.active = readb_idx_reg(0x3d5, 0x51) + 1; + m->h.blank_start = readb_idx_reg(0x3d5, 0x52) + 1; + m->h.blank_end = readb_idx_reg(0x3d5, 0x53) + 1; + m->h.retr_start = readb_idx_reg(0x3d5, 0x56); + m->h.retr_end = readb_idx_reg(0x3d5, 0x57); + /* add blanking overflow */ + val = readb_idx_reg(0x3d5, 0x54); + m->h.blank_start |= ((val >> 0) & 0x7) << 8; + m->h.blank_end |= ((val >> 3) & 0x7) << 8; + m->h.retr_start |= ((val >> 6) & 0x3) << 8; + /* add period overflow */ + val = readb_idx_reg(0x3d5, 0x55); + m->h.total |= ((val >> 0) & 0xf) << 8; + m->h.active |= ((val >> 4) & 0x7) << 8; + + /* vertical */ + m->v.total = readb_idx_reg(0x3d5, 0x58) + 1; + m->v.active = readb_idx_reg(0x3d5, 0x59) + 1; + m->v.blank_start = readb_idx_reg(0x3d5, 0x5a) + 1; + m->v.blank_end = readb_idx_reg(0x3d5, 0x5b) + 1; + m->v.retr_start = readb_idx_reg(0x3d5, 0x5e); + val = readb_idx_reg(0x3d5, 0x5f); + m->v.retr_end = val & 0x1f; + m->v.retr_start |= (val >> 5) << 8; + /* add blanking overflow */ + val = readb_idx_reg(0x3d5, 0x5c); + m->v.blank_start |= ((val >> 0) & 0x7) << 8; + m->v.blank_end |= ((val >> 3) & 0x7) << 8; + m->h.retr_end |= ((val >> 6) & 0x1) << 8; + m->h.retr_start |= ((val >> 7) & 0x1) << 10; + /* add period overflow */ + val = readb_idx_reg(0x3d5, 0x5d); + m->v.total |= ((val >> 0) & 0x7) << 8; + m->v.active |= ((val >> 3) & 0x7) << 8; + m->h.blank_end |= ((val >> 6) & 0x7) << 11; + m->h.retr_start |= ((val >> 7) & 0x7) << 11; + + /* puzzle together the start address */ + val = readb_idx_reg(0x3d5, 0x62); + m->addr_start = (val >> 1) << 3; + val = readb_idx_reg(0x3d5, 0x63); + m->addr_start |= (val << 10); + val = readb_idx_reg(0x3d5, 0x64); + m->addr_start |= (val << 18); + val = readb_idx_reg(0x3d5, 0xa3); + m->addr_start |= (val & 0x7) << 26; + + m->horiz_quad_count = readb_idx_reg(0x3d5, 0x65); + m->horiz_offset = readb_idx_reg(0x3d5, 0x66) << 3; + + val = readb_idx_reg(0x3d5, 0x67); + m->horiz_offset |= ((val >> 0) & 0x3) << 11; + m->horiz_quad_count |= ((val >> 2) & 0x3) << 8; + switch (val >> 6) { + case 0: + m->bpp = 8; + break; + case 1: + m->bpp = 16; + break; + case 2: + m->bpp = 30; + break; + case 3: + m->bpp = 32; + break; + } + } +} + +static void dump_scaling(void) +{ + u_int32_t h_scaling, v_scaling; + u_int8_t val; + + val = readb_idx_reg(0x3d5, 0x79); + if (val & 0x01) { + printf("Panel Scaling enabled, mode %s\n", + val & 0x02 ? "Interpolation" : "Duplication"); + v_scaling = (val >> 3) & 0x1; + h_scaling = ((val >> 4) & 0x3) << 10; + v_scaling |= ((val >> 6) & 0x3) << 9; + + val = readb_idx_reg(0x3d5, 0x77); + h_scaling |= val << 2; + + val = readb_idx_reg(0x3d5, 0x78); + v_scaling |= val << 1; + + val = readb_idx_reg(0x3d5, 0x9f); + h_scaling |= val & 0x3; + printf("Scaling Factors: horizontal=%u, vertical=%u\n", + h_scaling, v_scaling); + } else + printf("Panel Scaling disabled\n"); +} + +static void dump_registers(struct io_reg *ior) +{ + u_int8_t idx; + + printf("%s register dump:\n", ior->name); + for (idx = 0; idx < 0xff; idx++) { + u_int8_t val; + struct bit_desc *desc = ior->index[idx].bit_desc; + + if (!ior->index[idx].name) + continue; + + outb(idx, ior->io_port_addr); + val = inb(ior->io_port_data); + printf(" 0x%02x = 0x%02x (%s)\n", idx, val, + ior->index[idx].name); + + if (!desc) + continue; + + while (desc->mask) { + printf(" 0x%02x %s: 0x%02x\n", desc->mask, + desc->name, val & desc->mask); + desc++; + } + } + printf("\n"); +} + +enum pll { + PLL_VCK, + PLL_ECK, + PLL_LDCK, +}; + +#define REF_FREQ 14318 + +static void get_vck_clock(enum pll pll, unsigned int f_ref_khz) +{ + u_int8_t reg_ofs = 0; + u_int8_t val; + unsigned int dm, dtz, dr, dn; + unsigned long f_vco, f_out; + char *name; + + switch (pll) { + case PLL_VCK: + reg_ofs = 0; + name = "VCK"; + break; + case PLL_ECK: + reg_ofs = 3; + name = "ECK"; + break; + case PLL_LDCK: + reg_ofs = 6; + name = "LDCK"; + break; + default: + return; + } + + dm = readb_idx_reg(0x3c5, 0x44 + reg_ofs); + + val = readb_idx_reg(0x3c5, 0x45 + reg_ofs); + dtz = val & 0x1; + dr = (val >> 3) & 0x7; + dm |= ((val >> 6) & 0x3) << 8; + + val = readb_idx_reg(0x3c5, 0x46 + reg_ofs); + dtz |= (val & 0x1) << 1; + dn = val >> 1; + + printf("%s PLL: dm=%d, dtx=%d, dr=%d, dn=%d ", name, dm, dtz, dr, dn); + + f_vco = f_ref_khz * (dm + 2) / (dn + 2); + if (dr) + f_out = f_ref_khz * (dm + 2) / ( (dn + 2) * (2 * dr) ); + else + f_out = 0; + + printf("%s Fvco=%lu kHz, Fout=%lu kHz\n", name, f_vco, f_out); +} + +struct gpio_state { + u_int32_t mode_output; + u_int32_t pin_status; + u_int32_t output_bit; + u_int32_t alt_function; +}; + +static int get_gpio_state(struct gpio_state *s) +{ + u_int8_t val; + + memset(s, 0, sizeof(*s)); + + val = readb_idx_reg(0x3c5, 0x2c); + if (val & 0x01) + s->alt_function |= (3 << 2); + if (val & 0x04) + s->pin_status |= (1 << 3); + if (val & 0x08) + s->pin_status |= (1 << 2); + if (val & 0x10) + s->output_bit |= (1 << 3); + if (val & 0x20) + s->output_bit |= (1 << 2); + if (val & 0x40) + s->mode_output |= (1 << 3); + if (val & 0x80) + s->mode_output |= (1 << 2); + + val = readb_idx_reg(0x3c5, 0x3d); + if (val & 0x01) + s->alt_function |= (3 << 4); + if (val & 0x04) + s->pin_status |= (1 << 5); + if (val & 0x08) + s->pin_status |= (1 << 4); + if (val & 0x10) + s->output_bit |= (1 << 5); + if (val & 0x20) + s->output_bit |= (1 << 4); + if (val & 0x40) + s->mode_output |= (1 << 5); + if (val & 0x80) + s->mode_output |= (1 << 4); + +} + +static void dump_gpio_state(const char *pfx, const struct gpio_state *gs) +{ + int i; + + for (i = 2; i < 6; i++) { + printf("%sGPIO %u: function=", pfx, i); + + if (gs->alt_function & (1 << i)) + printf("alternate\n"); + else if (gs->mode_output & (1 << i)) + printf("output(%u)\n", gs->output_bit & (1 <<i) ? 1 : 0); + else + printf("input(%u)\n", gs->pin_status & (1 << i) ? 1 : 0); + } +} + +static void dump_all_registers(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(io_regs); i++) { + struct io_reg *reg = io_regs[i]; + if (!reg) + break; + dump_registers(reg); + } + +} + +static void dump_mode(const char *pfx, struct mode *m) +{ + printf("%sH total=%u, active=%u, blank (%u-%u), sync(%u-%u)\n", + pfx, m->h.total, m->h.active, m->h.blank_start, m->h.blank_end, + m->h.retr_start, m->h.retr_end); + printf("%sV total=%u, active=%u, blank (%u-%u), sync(%u-%u)\n", + pfx, m->v.total, m->v.active, m->v.blank_start, m->v.blank_end, + m->v.retr_start, m->v.retr_end); + printf("base_addr=0x%08x, bpp=%d\n", m->addr_start, m->bpp); +} + +static void dump_sl(const char *pfx) +{ + u_int8_t val; + unsigned int sl_size_mb; + unsigned long rtsf_in_sl_addr; + u_int64_t sl_in_mem_addr; + + val = readb_idx_reg(0x3c5, 0x68); + switch (val) { + case 0: + sl_size_mb = 512; + break; + case 0x80: + sl_size_mb = 256; + break; + case 0xc0: + sl_size_mb = 128; + break; + case 0xe0: + sl_size_mb = 64; + break; + case 0xf0: + sl_size_mb = 32; + break; + case 0xf8: + sl_size_mb = 16; + break; + case 0xfc: + sl_size_mb = 8; + break; + case 0xfe: + sl_size_mb = 4; + break; + case 0xff: + sl_size_mb = 2; + break; + } + + rtsf_in_sl_addr = readb_idx_reg(0x3c5, 0x6a) << 12; + rtsf_in_sl_addr |= readb_idx_reg(0x3c5, 0x6b) << 20; + val = readb_idx_reg(0x3c5, 0x6c); + rtsf_in_sl_addr |= (val & 0x1) << 28; + + sl_in_mem_addr = readb_idx_reg(0x3c5, 0x6d) << 21; + sl_in_mem_addr |= readb_idx_reg(0x3c5, 0x6d) << 29; + sl_in_mem_addr |= (readb_idx_reg(0x3c5, 0x6d) & 0x7f) << 37; + + printf("%sSL in System memory: 0x%llx, RTSF in SL: 0x%lx\n", + pfx, sl_in_mem_addr, rtsf_in_sl_addr); +} + +static int dump_lvds(void) +{ + u_int8_t val; + char *mode; + + writeb_idx_mask(0x3c5, 0x5a, 0x01, 0x01); + + val = readb_idx_reg(0x3c5, 0x13); + switch (val >> 6) { + case 0: + mode = "LVDS1 + LVDS2"; + break; + case 2: + mode = "One Dual LVDS Channel"; + break; + default: + mode = "RESERVED"; + break; + } + printf("LVDS Seq Mode: %s\n", mode); + + val = readb_idx_reg(0x3d5, 0xd2); + switch ((val >> 4) & 3) { + case 0: + mode = "LVDS1 + LVDS2"; + break; + case 2: + mode = "One Dual LVDS Channel"; + break; + default: + mode = "RESERVED"; + break; + } + printf("LVDS CRT Mode: %s\n", mode); + printf("LVDS Channel 1 Format %s, Power %s\n", + val & 2 ? "OpenLDI":"SPWG", val & 0x80 ? "Down" : "Up"); + printf("LVDS Channel 2 Format %s, Power %s\n", + val & 1 ? "OpenLDI":"SPWG", val & 0x40 ? "Down" : "Up"); + +} +static int parse_ioreg(u_int16_t *reg, u_int8_t *index, char *str) +{ + char *dot; + char buf[255]; + unsigned long ul; + + memset(buf, 0, sizeof(*buf)); + strncpy(buf, str, sizeof(buf)-1); + + dot = strchr(buf, '.'); + if (!dot) + return -EINVAL; + *dot = '\0'; + + *reg = strtoul(buf, NULL, 16); + *index = strtoul(dot+1, NULL, 16); + + return 0; +} + +static void reset_mode(int secondary) +{ + if (!secondary) { + writeb_idx_mask(0x3d5, 0x11, 0x00 , 0x80); + writeb_idx_mask(0x3d5, 0x03, 0x80 , 0x80); + } else { + } +} + +static void unlock_registers(void) +{ + writeb_idx_reg(0x3c5, 0x10, 0x01); /* unlock extended */ + writeb_idx_mask(0x3d5, 0x47, 0x00, 0x01); /* unlock CRT */ + writeb_idx_mask(0x3d5, 0x03, 0x80, 0x80); /* disable EGA lightpen */ + writeb_idx_mask(0x3d5, 0x11, 0x00, 0x80); /* unlock 0..7 */ +} + +static void usage(void) +{ + printf("Usage :\n"); + printf("-h | --help : Display this usage message.\n"); + printf("-d | --dump : Dump all registers.\n"); + printf("-p | --pll : Display PLL.\n"); + printf("-m | --mode : Display modes.\n"); + printf("-r | --read : Read register.\n"); + printf("-w | --write : Write register.\n"); + printf("-g | --gpio : Display GPIO state.\n"); +} + +int main(int argc, char **argv) +{ + struct mode m; + struct gpio_state gs; + int rc, option_index = 0; + + printf("via-chrome-tool (C) 2009 by VIA Technologies, Inc.\n"); + printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); + + rc = iopl(3); + if (rc < 0) { + perror("iopl"); + printf("Need root privileges.\n"); + exit(1); + } + + if (argc <= 1) { + usage(); + exit(1); + } + + unlock_registers(); + + while (1) { + int c; + u_int16_t reg; + u_int8_t index; + unsigned long val; + static struct option long_options[] = { + { "help", 0, 0, 'h' }, + { "dump", 0, 0, 'd' }, + { "pll", 0, 0, 'p' }, + { "mode", 0, 0, 'm' }, + { "read", 1, 0, 'r' }, + { "write", 1, 0, 'w' }, + { "gpio", 1, 0, 'g' }, + }; + + c = getopt_long(argc, argv, "hdpmr:w:g", long_options, + &option_index); + + if (c == -1) { + break; + } + + switch (c) { + case 'h': + usage(); + exit(1); + case 'd': + dump_all_registers(); + break; + case 'p': + get_vck_clock(PLL_VCK, REF_FREQ); + get_vck_clock(PLL_ECK, REF_FREQ); + get_vck_clock(PLL_LDCK, REF_FREQ); + break; + case 'm': + dump_sl(""); + printf("Primary Display:\n"); + get_mode(&m, 0); + dump_mode(" ", &m); + printf("\n"); + printf("Secondary Display:\n"); + get_mode(&m, 1); + dump_mode(" ", &m); + printf("\n"); + dump_scaling(); + printf("\n"); + dump_lvds(); + printf("\n"); + break; + case 'r': + parse_ioreg(®, &index, optarg); + printf("%03x.%02x = 0x%02x\n", reg, index, + readb_idx_reg(reg, index)); + break; + case 'w': + parse_ioreg(®, &index, optarg); + /* we need one extra argument */ + if (argc <= optind) + exit(1); + val = strtoul(argv[optind], NULL, 16); + if (val > 0xff) + exit(1); + writeb_idx_reg(reg, index, val); + printf("%03x.%02x = 0x%02x\n", reg, index, + readb_idx_reg(reg, index)); + break; + case 'g': + printf("GPIO State\n"); + get_gpio_state(&gs); + dump_gpio_state(" ", &gs); + printf("\n"); + break; + default: + usage(); + exit(1); + } + } + + exit(0); +} |