[PATCH] Remove unused facility to build modes code from uninstalled server.

Gaetan Nadon memsize at videotron.ca
Tue Jul 13 06:39:23 PDT 2010


This driver only configures against xserver 1.2 or higher.
Servers 1.2 and higher always include randr 1.2 modes code.
Therefore BUILD_XMODES will never be set to "yes".

There is no need to allow this driver to build from an arbitrary
modes and parser tree outside the installed server.

This will sove the issue where "make dist" fails "out of the box"
and requires manual fix-up on the build machine which is documented
in the comapt/README file.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am            |    2 +-
 compat/.gitignore      |    2 --
 compat/Makefile.am     |   16 ----------------
 compat/README          |    7 -------
 configure.ac           |   45 ---------------------------------------------
 src/Makefile.am        |   23 +----------------------
 src/local_xf86Rename.h |   23 -----------------------
 7 files changed, 2 insertions(+), 116 deletions(-)
 delete mode 100644 compat/.gitignore
 delete mode 100644 compat/Makefile.am
 delete mode 100644 compat/README
 delete mode 100644 src/local_xf86Rename.h

diff --git a/Makefile.am b/Makefile.am
index 94c0b1d..d8f84e2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
 #  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.
 
-SUBDIRS = src man compat
+SUBDIRS = src man
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
 EXTRA_DIST = README.G80
diff --git a/compat/.gitignore b/compat/.gitignore
deleted file mode 100644
index 8d30df6..0000000
--- a/compat/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-modes
-parser
diff --git a/compat/Makefile.am b/compat/Makefile.am
deleted file mode 100644
index de17f93..0000000
--- a/compat/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-EXTRA_DIST = \
-    parser/xf86Parser.h \
-    parser/xf86Optrec.h \
-    modes/xf86Crtc.c \
-    modes/xf86Crtc.h \
-    modes/xf86Cursors.c \
-    modes/xf86cvt.c \
-    modes/xf86DiDGA.c \
-    modes/xf86EdidModes.c \
-    modes/xf86gtf.c \
-    modes/xf86Modes.c \
-    modes/xf86Modes.h \
-    modes/xf86RandR12.c \
-    modes/xf86RandR12.h \
-    modes/xf86Rename.h \
-    modes/xf86Rotate.c
diff --git a/compat/README b/compat/README
deleted file mode 100644
index 3e2b089..0000000
--- a/compat/README
+++ /dev/null
@@ -1,7 +0,0 @@
-This directory contains a copy of the mode and parser code from RandR 1.2.
-
-If you are building from git and you don't have xorg-server-1.3 or higher or you
-want to be able to make dist, you should create symlinks to the modes and parser
-directories from a RandR 1.2-enabled server here:
-
-  $ ln -s /path/to/xorg/xserver/hw/xfree86/{modes,parser} .
diff --git a/configure.ac b/configure.ac
index 02f8ab3..84e1f5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,11 +55,6 @@ AC_ARG_WITH(xorg-module-dir,
             [moduledir="$withval"],
             [moduledir="$libdir/xorg/modules"])
 
-AC_ARG_WITH(xserver-source,AC_HELP_STRING([--with-xserver-source=XSERVER_SOURCE],
-                                          [Path to X server source tree]),
-                           [ XSERVER_SOURCE="$withval" ],
-                           [ XSERVER_SOURCE="" ])
-
 # Checks for extensions
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
@@ -81,9 +76,6 @@ AC_HEADER_STDC
 save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"
 
-# RandR 1.2
-AC_CHECK_HEADER(xf86Modes.h,[BUILD_XMODES=no],[BUILD_XMODES=yes],[#include "xorg-server.h"])
-
 # PCI rework
 AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
               [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
@@ -94,42 +86,6 @@ fi
 
 CFLAGS="$save_CFLAGS"
 
-AM_CONDITIONAL(BUILD_XMODES, test "x$BUILD_XMODES" = xyes)
-if test "x$XSERVER_SOURCE" != x; then
-    if test -d "$XSERVER_SOURCE"; then
-        XSERVER_SOURCE=`cd "$XSERVER_SOURCE" && pwd`
-        if test -f "$XSERVER_SOURCE/hw/xfree86/modes/xf86Modes.h" -a -f "$XSERVER_SOURCE/hw/xfree86/parser/xf86Parser.h"; then
-            :
-        else
-            AC_ERROR([Server source at $XSERVER_SOURCE doesn't have the new mode code])
-        fi
-    else
-        AC_ERROR([Can't find xserver-source path $XSERVER_SOURCE])
-    fi
-fi
-if test "x$BUILD_XMODES" = xno; then
-    AC_MSG_NOTICE([X server has new mode code])
-    XMODES_CFLAGS=
-    parser_dir=
-    modes_dir=
-else
-    if test "x$XSERVER_SOURCE" = x; then
-            AC_MSG_NOTICE([X server is missing new mode code and --with-xserver-source not specified, using local copy])
-            AC_MSG_NOTICE([If you're building from git, please read compat/README])
-            parser_dir='$(top_srcdir)/compat/parser'
-            modes_dir='$(top_srcdir)/compat/modes'
-    else
-            AC_MSG_NOTICE([Using mode code from $XSERVER_SOURCE])
-            parser_dir="$XSERVER_SOURCE/hw/xfree86/parser"
-            modes_dir="$XSERVER_SOURCE/hw/xfree86/modes"
-    fi
-    XMODES_CFLAGS="-DXF86_MODES_RENAME -I\"$modes_dir\" -I\"$parser_dir\""
-    AC_DEFINE(BUILD_XMODES, 1,[X server doesn't have built-in mode code, so we need to build it])
-fi
-AC_SUBST([XMODES_CFLAGS])
-AC_SUBST([parser_dir])
-AC_SUBST([modes_dir])
-
 # Substitutions
 AC_SUBST([XORG_CFLAGS])
 AC_SUBST([moduledir])
@@ -141,5 +97,4 @@ AC_OUTPUT([
 	Makefile
 	src/Makefile
 	man/Makefile
-	compat/Makefile
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index 2677d9c..70e127c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,7 +23,7 @@
 # -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.
-AM_CFLAGS = @XMODES_CFLAGS@ @XORG_CFLAGS@
+AM_CFLAGS = @XORG_CFLAGS@
 nv_drv_la_LTLIBRARIES = nv_drv.la
 nv_drv_la_LDFLAGS = -module -avoid-version
 nv_drv_ladir = @moduledir@/drivers
@@ -82,24 +82,3 @@ g80_sources = \
          g80_xaa.c \
          g80_xaa.h
 
-xmode_sources = \
-         @parser_dir@/xf86Parser.h \
-         @parser_dir@/xf86Optrec.h \
-         @modes_dir@/xf86Modes.h \
-         @modes_dir@/xf86Modes.c \
-         @modes_dir@/xf86cvt.c \
-         @modes_dir@/xf86Crtc.h \
-         @modes_dir@/xf86Crtc.c \
-         @modes_dir@/xf86Cursors.c \
-         @modes_dir@/xf86EdidModes.c \
-         @modes_dir@/xf86gtf.c \
-         @modes_dir@/xf86RandR12.c \
-         @modes_dir@/xf86RandR12.h \
-         @modes_dir@/xf86Rename.h \
-         @modes_dir@/xf86Rotate.c \
-         @modes_dir@/xf86DiDGA.c
-
-if BUILD_XMODES
-EXTRA_nv_drv_la_SOURCES = local_xf86Rename.h
-nodist_nv_drv_la_SOURCES = $(xmode_sources)
-endif
diff --git a/src/local_xf86Rename.h b/src/local_xf86Rename.h
deleted file mode 100644
index f3a07c6..0000000
--- a/src/local_xf86Rename.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *Copyright © 2006 Keith Packard
- *
- * 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, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  The copyright holders make no representations
- * about the suitability of this software for any purpose.  It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#define XF86NAME(x) nv_##x
-- 
1.6.0.4

I am aware it has recently been deprecated.
I expect this drive will continue to build for quite some time.
I'd like to fix the "dist" target. The easiest way is to remove
this unused feature, but there are other ways.

The key assumption is that xserver 1.2 always includes randr 1.2.
The RANDR extension is not optional and is always defined in xorg-server.h
I have verified this using git xserver "server-1.2-branch ".




More information about the xorg-devel mailing list