summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog34
-rw-r--r--acinclude.m491
-rwxr-xr-xautogen.sh12
-rw-r--r--configure.ac131
-rw-r--r--libxvmc/Makefile.am31
-rw-r--r--libxvmc/driDrawable.c6
-rw-r--r--libxvmc/viaLowLevel.c4
-rw-r--r--libxvmc/viaLowLevelPro.c4
-rw-r--r--libxvmc/viaXvMC.c6
-rw-r--r--libxvmc/viaXvMCPriv.h6
-rw-r--r--libxvmc/xf86dri.c7
-rw-r--r--man/Makefile.am62
-rw-r--r--unichrome/Makefile.am88
-rw-r--r--unichrome/via_accel.c6
-rw-r--r--unichrome/via_bandwidth.c5
-rw-r--r--unichrome/via_ch7xxx.c4
-rw-r--r--unichrome/via_cursor.c4
-rw-r--r--unichrome/via_dga.c3
-rw-r--r--unichrome/via_dri.c5
-rw-r--r--unichrome/via_driver.c6
-rw-r--r--unichrome/via_i2c.c5
-rw-r--r--unichrome/via_id.c4
-rw-r--r--unichrome/via_memcpy.c4
-rw-r--r--unichrome/via_memory.c5
-rw-r--r--unichrome/via_mode.c4
-rw-r--r--unichrome/via_shadow.c4
-rw-r--r--unichrome/via_vbe.c4
-rw-r--r--unichrome/via_vgahw.c5
-rw-r--r--unichrome/via_vt162x.c4
-rw-r--r--unichrome/via_xvmc.c8
30 files changed, 550 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ff1da8..ed03bd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2005-12-06 Thomas Hellström <unichrome-at-shipmail-dot-org>
+
+ * acinclude.m4:
+ * autogen.sh:
+ * configure.ac:
+ * libxvmc/Makefile.am:
+ * libxvmc/driDrawable.c:
+ * libxvmc/viaLowLevel.c:
+ * libxvmc/viaLowLevelPro.c:
+ * libxvmc/viaXvMC.c:
+ * libxvmc/viaXvMCPriv.h:
+ * libxvmc/xf86dri.c:
+ * man/Makefile.am:
+ * unichrome/Makefile.am:
+ * unichrome/via_accel.c:
+ * unichrome/via_bandwidth.c:
+ * unichrome/via_ch7xxx.c:
+ * unichrome/via_cursor.c:
+ * unichrome/via_dga.c:
+ * unichrome/via_dri.c:
+ * unichrome/via_driver.c:
+ * unichrome/via_i2c.c:
+ * unichrome/via_id.c:
+ * unichrome/via_memcpy.c:
+ * unichrome/via_memory.c:
+ * unichrome/via_mode.c:
+ * unichrome/via_shadow.c:
+ * unichrome/via_vbe.c:
+ * unichrome/via_vgahw.c:
+ * unichrome/via_vt162x.c:
+ * unichrome/via_xvmc.c:
+
+ Adjust for modular build.
+
2005-12-04 Thomas Hellström <unichrome-at-shipmail-dot-org>
* unichrome/via_vt162x.c: (VT1622ModeCrtc):
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..127eed9
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,91 @@
+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_DRIVER_CHECK_EXT()
+# --------------------------
+# Checks for the $1 define in xorg-server.h (from the sdk). If it
+# is defined, then add $1 to $REQUIRED_MODULES.
+
+AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include "xorg-server.h"
+#if !defined $1
+#error $1 not defined
+#endif
+ ]])],
+ [_EXT_CHECK=yes],
+ [_EXT_CHECK=no])
+ CFLAGS="$SAVE_CFLAGS"
+ AC_MSG_CHECKING([if $1 is defined])
+ AC_MSG_RESULT([$_EXT_CHECK])
+ if test "$_EXT_CHECK" != no; then
+ REQUIRED_MODULES="$REQUIRED_MODULES $2"
+ fi
+])
+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
+# --------------------
+# Adds --with/without-release-string and changes the PACKAGE and
+# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
+# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.
+
+AC_DEFUN([XORG_RELEASE_VERSION],[
+ AC_ARG_WITH(release-version,
+ AC_HELP_STRING([--with-release-version=STRING],
+ [Use release version string in package name]),
+ [RELEASE_VERSION="$withval"],
+ [RELEASE_VERSION=""])
+ if test "x$RELEASE_VERSION" != "x"; then
+ PACKAGE="$PACKAGE-$RELEASE_VERSION"
+ PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
+ AC_MSG_NOTICE([Building with package name set to $PACKAGE])
+ fi
+])
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..bfd92e0
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,131 @@
+# Copyright 2005 Adam Jackson.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Process this file with autoconf to produce a configure script
+
+AC_PREREQ(2.57)
+AC_INIT([xf86-video-openchrome],
+ 0.1.32,
+ [https://www.openchrome.org/trac/report],
+ xf86-video-openchrome)
+
+AC_CONFIG_SRCDIR([Makefile.am])
+AM_CONFIG_HEADER([config.h])
+AC_CONFIG_AUX_DIR(.)
+
+AM_INIT_AUTOMAKE([dist-bzip2])
+
+AM_MAINTAINER_MODE
+AC_DISABLE_STATIC
+
+# Checks for programs.
+AC_PROG_LIBTOOL
+AC_PROG_CC
+
+AH_TOP([#include "xorg-server.h"])
+
+AC_ARG_WITH(xorg-module-dir,
+ AC_HELP_STRING([--with-xorg-module-dir=DIR],
+ [Default xorg module directory [[default=$libdir/xorg/modules]]]),
+ [moduledir="$withval"],
+ [moduledir="$libdir/xorg/modules"])
+
+AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
+ [Disable DRI support [[default=auto]]]),
+ [DRI="$enableval"],
+ [DRI=auto])
+
+# Checks for extensions
+XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
+XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
+XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
+XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
+XORG_DRIVER_CHECK_EXT(XV, videoproto)
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XORG, [xorg-server xproto xvmc fontsproto $REQUIRED_MODULES])
+sdkdir=$(pkg-config --variable=sdkdir xorg-server)
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+
+if test "$DRI" != no; then
+ AC_CHECK_FILE([${sdkdir}/dri.h],
+ [have_dri_h="yes"], [have_dri_h="no"])
+ AC_CHECK_FILE([${sdkdir}/sarea.h],
+ [have_sarea_h="yes"], [have_sarea_h="no"])
+ AC_CHECK_FILE([${sdkdir}/dristruct.h],
+ [have_dristruct_h="yes"], [have_dristruct_h="no"])
+fi
+
+AC_MSG_CHECKING([whether to include DRI support])
+if test x$DRI = xauto; then
+ if test "$have_dri_h" = yes -a \
+ "$have_sarea_h" = yes -a \
+ "$have_dristruct_h" = yes; then
+ DRI="yes"
+ else
+ DRI="no"
+ fi
+fi
+AC_MSG_RESULT([$DRI])
+
+AM_CONDITIONAL(DRI, test x$DRI = xyes)
+if test "$DRI" = yes; then
+ PKG_CHECK_MODULES(DRI, [libdrm >= 1.0.5 xf86driproto])
+ AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
+ AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
+ case "$host_cpu" in
+ i*86)
+ XVMC=yes ;;
+ amd64*|x86_64*)
+ XVMC=yes ;;
+ *)
+ XVMC=no ;;
+ esac
+fi
+AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
+
+AC_SUBST([DRI_CFLAGS])
+AC_SUBST([XORG_CFLAGS])
+AC_SUBST([moduledir])
+
+DRIVER_NAME=via
+AC_SUBST([DRIVER_NAME])
+
+AC_DEFINE(X_USE_LINEARFB,1,[Compatibility define for older Xen])
+AC_DEFINE(X_USE_REGION_NULL,1,[Compatibility define for older Xen])
+AC_DEFINE(X_HAVE_XAAGETROP,1,[Compatibility define for older Xen])
+AC_DEFINE(X_NEED_I2CSTART,1,[Compatibility define for older Xen])
+AC_DEFINE(VIA_HAVE_EXA,1,[Compatibility define for older Xen])
+
+DRIVER_MAN_SUFFIX="4x"
+AC_SUBST([DRIVER_MAN_SUFFIX])
+
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([
+ Makefile
+ unichrome/Makefile
+ libxvmc/Makefile
+ man/Makefile
+])
diff --git a/libxvmc/Makefile.am b/libxvmc/Makefile.am
new file mode 100644
index 0000000..17cbdd1
--- /dev/null
+++ b/libxvmc/Makefile.am
@@ -0,0 +1,31 @@
+
+lib_LTLIBRARIES=libviaXvMC.la libviaXvMCPro.la
+
+libviaXvMC_la_SOURCES = \
+ viaLowLevel.c \
+ driDrawable.c \
+ viaXvMC.c \
+ xf86dri.c \
+ viaLowLevel.h \
+ driDrawable.h \
+ viaXvMCPriv.h \
+ xf86dri.h \
+ xf86dristr.h \
+ vldXvMC.h
+libviaXvMCPro_la_SOURCES = \
+ viaLowLevel.c \
+ driDrawable.c \
+ viaXvMC.c \
+ xf86dri.c \
+ viaLowLevel.h \
+ driDrawable.h \
+ viaXvMCPriv.h \
+ xf86dri.h \
+ xf86dristr.h \
+ vldXvMC.h
+
+libviaXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ -I$(top_srcdir)/unichrome -I$(top_srcdir)/libxvmc -DTRUE=1 -DFALSE=0
+libviaXvMC_la_LDFLAGS = @DRI_LIBS@ -version-number 1:0:0
+
+libviaXvMCPro_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ -I$(top_srcdir)/unichrome -I$(top_srcdir)/libxvmc -DTRUE=1 -DFALSE=0
+libviaXvMCPro_la_LDFLAGS = @DRI_LIBS@ -version-number 1:0:0
diff --git a/libxvmc/driDrawable.c b/libxvmc/driDrawable.c
index 92aa853..35934d8 100644
--- a/libxvmc/driDrawable.c
+++ b/libxvmc/driDrawable.c
@@ -22,8 +22,12 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <X11/Xlibint.h>
-#include <Xutil.h>
+#include <X11/Xutil.h>
#include "xf86drm.h"
#include "drm.h"
#include "xf86dri.h"
diff --git a/libxvmc/viaLowLevel.c b/libxvmc/viaLowLevel.c
index 1add1ca..ef7d824 100644
--- a/libxvmc/viaLowLevel.c
+++ b/libxvmc/viaLowLevel.c
@@ -32,7 +32,9 @@
* Authors: Andreas Robinson 2003. Thomas Hellström 2004.
*/
-
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "viaXvMCPriv.h"
#include "viaLowLevel.h"
diff --git a/libxvmc/viaLowLevelPro.c b/libxvmc/viaLowLevelPro.c
index e63d759..afb0166 100644
--- a/libxvmc/viaLowLevelPro.c
+++ b/libxvmc/viaLowLevelPro.c
@@ -42,6 +42,10 @@
* are also operated through independent registers also.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#undef VIDEO_DMA
#define HQV_USE_IRQ
#define UNICHROME_PRO
diff --git a/libxvmc/viaXvMC.c b/libxvmc/viaXvMC.c
index ba14fd7..9b4344c 100644
--- a/libxvmc/viaXvMC.c
+++ b/libxvmc/viaXvMC.c
@@ -29,6 +29,10 @@
*DRI protocol support by Thomas Hellström, 2005.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#undef WAITPAUSE
#include "viaXvMCPriv.h"
@@ -38,7 +42,7 @@
#include <sys/time.h>
#include <time.h>
#include <fourcc.h>
-#include <Xv.h>
+#include <X11/extensions/Xv.h>
#include <xf86drm.h>
#include <pthread.h>
#include "vldXvMC.h"
diff --git a/libxvmc/viaXvMCPriv.h b/libxvmc/viaXvMCPriv.h
index d8c4635..bb7b905 100644
--- a/libxvmc/viaXvMCPriv.h
+++ b/libxvmc/viaXvMCPriv.h
@@ -26,10 +26,10 @@
#define _VIAXVMCPRIV_H 1
#include <X11/Xlibint.h>
-#include <XvMC.h>
-#include <XvMClib.h>
+#include <X11/extensions/XvMC.h>
+#include <X11/extensions/XvMClib.h>
#include <stdlib.h>
-#include <Xutil.h>
+#include <X11/Xutil.h>
#include "vldXvMC.h"
#include "via_xvmc.h"
diff --git a/libxvmc/xf86dri.c b/libxvmc/xf86dri.c
index 27ba480..12af13b 100644
--- a/libxvmc/xf86dri.c
+++ b/libxvmc/xf86dri.c
@@ -37,11 +37,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* THIS IS NOT AN X CONSORTIUM STANDARD */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#define NEED_REPLIES
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
-#include "extutil.h"
-/* #include "glheader.h" */
+#include <X11/extensions/extutil.h>
#include "xf86dristr.h"
static XExtensionInfo _xf86dri_info_data;
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..562204a
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,62 @@
+# $Id: Makefile.am,v 1.4 2005/10/18 00:01:55 alanc Exp $
+#
+# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation.
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the copyright holders shall
+# not be used in advertising or otherwise to promote the sale, use or
+# other dealings in this Software without prior written authorization
+# from the copyright holders.
+#
+
+drivermandir = $(mandir)/man$(DRIVER_MAN_SUFFIX)
+
+driverman_SOURCES = @DRIVER_NAME@.man
+
+driverman_DATA = $(driverman_SOURCES:man=@DRIVER_MAN_SUFFIX@)
+
+EXTRA_DIST = @DRIVER_NAME@.man
+
+CLEANFILES = $(driverman_DATA)
+
+SED = sed
+
+# 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
+
+.man.$(DRIVER_MAN_SUFFIX):
+ sed $(MAN_SUBSTS) < $< > $@
+
+@DRIVER_NAME@.man:
+ ln -s -f ../unichrome/@DRIVER_NAME@.man .
diff --git a/unichrome/Makefile.am b/unichrome/Makefile.am
new file mode 100644
index 0000000..b9f0a84
--- /dev/null
+++ b/unichrome/Makefile.am
@@ -0,0 +1,88 @@
+# Copyright 2005 Adam Jackson.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# this is obnoxious:
+# -module lets us name the module exactly how we want
+# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
+# _ladir passes a dummy rpath to libtool so the thing will actually link
+# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
+EXTRA_DIST = svnversion.h
+CONFIG_CLEAN_FILES= svnversion.h
+AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@
+via_drv_la_LTLIBRARIES = via_drv.la
+via_drv_la_LDFLAGS = -module -avoid-version
+via_drv_ladir = @moduledir@/drivers
+
+via_drv_la_SOURCES = \
+ via_accel.c \
+ via_bandwidth.c \
+ via_bios.h \
+ via_ch7xxx.c \
+ via_ch7xxx.h \
+ via_cursor.c \
+ via_dga.c \
+ via_dmabuffer.h \
+ via_driver.c \
+ via_driver.h \
+ via.h \
+ via_i2c.c \
+ via_id.c \
+ via_id.h \
+ via_memcpy.c \
+ via_memcpy.h \
+ via_memory.c \
+ via_mode.c \
+ via_mode.h \
+ via_priv.h \
+ via_regs.h \
+ via_shadow.c \
+ via_swov.c \
+ via_swov.h \
+ via_vbe.c \
+ via_vgahw.c \
+ via_vgahw.h \
+ via_video.c \
+ via_video.h \
+ via_vt162x.c \
+ via_vt162x.h \
+ via_xvpriv.h
+
+if DRI
+via_drv_la_SOURCES += \
+ via_dri.c \
+ via_dri.h \
+ via_xvmc.c \
+ via_xvmc.h \
+ via_drmclient.h
+endif
+
+via_driver.lo: svnversion.h
+svnversion.h:
+ @if [ -f svnrelease.h ]; then \
+ echo '#include "svnrelease.h"' > $@.tmp; \
+ elif [ -d .svn ]; then \
+ echo '#define BUILDCOMMENT "(development build, at svn revision '\
+ "`svnversion -nc . | sed -e s/^[^:]*://`"')\n"' > $@.tmp; \
+ else date +'#define BUILDCOMMENT "(development build, compiled on %c)\n"' > $@.tmp; fi
+
+ @(chmod 666 $@.tmp 2> /dev/null || /bin/true)
+ @cmp -s $@ $@.tmp || (mv $@.tmp $@ ; echo created $@)
+
+.PHONY: svnversion.h \ No newline at end of file
diff --git a/unichrome/via_accel.c b/unichrome/via_accel.c
index 78e43ef..b032ee1 100644
--- a/unichrome/via_accel.c
+++ b/unichrome/via_accel.c
@@ -31,7 +31,11 @@
*
************************************************************************/
-#include "Xarch.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <X11/Xarch.h>
#include "xaalocal.h"
#include "xaarop.h"
#include "miline.h"
diff --git a/unichrome/via_bandwidth.c b/unichrome/via_bandwidth.c
index cb819df..c1ce21d 100644
--- a/unichrome/via_bandwidth.c
+++ b/unichrome/via_bandwidth.c
@@ -22,6 +22,11 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_vgahw.h"
#include "via_id.h"
diff --git a/unichrome/via_ch7xxx.c b/unichrome/via_ch7xxx.c
index 0f75ea3..0c1f8f0 100644
--- a/unichrome/via_ch7xxx.c
+++ b/unichrome/via_ch7xxx.c
@@ -26,6 +26,10 @@
* 08/2005 Ivor Hewitt, updated to unichrome-pro codebase
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_vgahw.h"
#include "via_ch7xxx.h"
diff --git a/unichrome/via_cursor.c b/unichrome/via_cursor.c
index 9030600..7308b0f 100644
--- a/unichrome/via_cursor.c
+++ b/unichrome/via_cursor.c
@@ -29,6 +29,10 @@
*
************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
static void VIALoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src);
diff --git a/unichrome/via_dga.c b/unichrome/via_dga.c
index 1c705cb..a2fe938 100644
--- a/unichrome/via_dga.c
+++ b/unichrome/via_dga.c
@@ -22,6 +22,9 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "xaalocal.h"
#include "via_driver.h"
diff --git a/unichrome/via_dri.c b/unichrome/via_dri.c
index 359ff3f..8e27106 100644
--- a/unichrome/via_dri.c
+++ b/unichrome/via_dri.c
@@ -21,6 +21,11 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
diff --git a/unichrome/via_driver.c b/unichrome/via_driver.c
index cac2119..a6e2b32 100644
--- a/unichrome/via_driver.c
+++ b/unichrome/via_driver.c
@@ -30,12 +30,16 @@
*
************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86RAC.h"
#include "shadowfb.h"
#include "globals.h"
#define DPMS_SERVER
-#include "extensions/dpms.h"
+#include <X11/extensions/dpms.h>
#include "svnversion.h"
diff --git a/unichrome/via_i2c.c b/unichrome/via_i2c.c
index 042db16..8a52729 100644
--- a/unichrome/via_i2c.c
+++ b/unichrome/via_i2c.c
@@ -25,6 +25,11 @@
/*
* Implements three i2c busses through registers SR26, SR2c and SR31
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_vgahw.h"
diff --git a/unichrome/via_id.c b/unichrome/via_id.c
index 33b6847..a1ec53d 100644
--- a/unichrome/via_id.c
+++ b/unichrome/via_id.c
@@ -22,6 +22,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_id.h"
diff --git a/unichrome/via_memcpy.c b/unichrome/via_memcpy.c
index 08f1922..aa490af 100644
--- a/unichrome/via_memcpy.c
+++ b/unichrome/via_memcpy.c
@@ -21,6 +21,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_memcpy.h"
#include "compiler.h"
diff --git a/unichrome/via_memory.c b/unichrome/via_memory.c
index 819de57..09971cb 100644
--- a/unichrome/via_memory.c
+++ b/unichrome/via_memory.c
@@ -20,6 +20,11 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
diff --git a/unichrome/via_mode.c b/unichrome/via_mode.c
index fbd19b4..3ef6b71 100644
--- a/unichrome/via_mode.c
+++ b/unichrome/via_mode.c
@@ -30,6 +30,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_vgahw.h"
#include "via_id.h"
diff --git a/unichrome/via_shadow.c b/unichrome/via_shadow.c
index e1a4e18..d70c261 100644
--- a/unichrome/via_shadow.c
+++ b/unichrome/via_shadow.c
@@ -22,6 +22,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "shadowfb.h"
#include "servermd.h"
diff --git a/unichrome/via_vbe.c b/unichrome/via_vbe.c
index 9d010db..eee9bce 100644
--- a/unichrome/via_vbe.c
+++ b/unichrome/via_vbe.c
@@ -27,6 +27,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "vbe.h"
#include "vbeModes.h"
diff --git a/unichrome/via_vgahw.c b/unichrome/via_vgahw.c
index b1b79cb..853b7f0 100644
--- a/unichrome/via_vgahw.c
+++ b/unichrome/via_vgahw.c
@@ -27,6 +27,11 @@
* It's a bit daft to provide this short stuff in a seperate file,
* but then again, we'd only complicate matters in already complicated files.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86_ansic.h"
#include "compiler.h"
#include "xf86.h"
diff --git a/unichrome/via_vt162x.c b/unichrome/via_vt162x.c
index 8498932..c10ffd7 100644
--- a/unichrome/via_vt162x.c
+++ b/unichrome/via_vt162x.c
@@ -23,6 +23,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "via_driver.h"
#include "via_vgahw.h"
#include "via_vt162x.h"
diff --git a/unichrome/via_xvmc.c b/unichrome/via_xvmc.c
index a8cd19e..879181d 100644
--- a/unichrome/via_xvmc.c
+++ b/unichrome/via_xvmc.c
@@ -23,6 +23,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Resources.h"
@@ -49,8 +53,8 @@
#endif
#include "xf86xvmc.h"
-#include "Xv.h"
-#include "XvMC.h"
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/XvMC.h>
#include "xaa.h"
#include "xaalocal.h"
#include "dixstruct.h"