6572087 ship Xvnc for Solaris [PSARC/2007/545] nv_76
authorAlan Coopersmith <Alan.Coopersmith@Sun.COM>
Thu, 11 Oct 2007 11:47:20 -0700
changeset 235 06772554f851
parent 234 2ff870054a37
child 236 9c36c0a6f246
6572087 ship Xvnc for Solaris [PSARC/2007/545]
make_release_packages
open-src/Makefile
open-src/common/Makefile.inc
open-src/common/delibtoolize.pl
open-src/data/smf-rbac/Xserver
open-src/xserver/Makefile
open-src/xserver/Makefile.inc
open-src/xserver/xorg/IA.patch
open-src/xserver/xorg/Makefile
open-src/xserver/xorg/lg3d.patch
open-src/xserver/xorg/patch-list
open-src/xserver/xorg/sun-manpage.patch
open-src/xserver/xorg/xtsol.patch
open-src/xserver/xvnc/Makefile
open-src/xserver/xvnc/build-without-Xorg.patch
open-src/xserver/xvnc/c++public.patch
open-src/xserver/xvnc/solaris-port.patch
open-src/xserver/xvnc/vnc-24bit.patch
open-src/xserver/xvnc/vnc-64bit.patch
open-src/xserver/xvnc/vnc-always_use_fb.patch
open-src/xserver/xvnc/vnc-autotools-compile.patch
open-src/xserver/xvnc/vnc-autotools.patch
open-src/xserver/xvnc/vnc-int10.patch
open-src/xserver/xvnc/vnc-ipv6.patch
open-src/xserver/xvnc/vnc-modular-xorg.patch
open-src/xserver/xvnc/vnc-module_crash.patch
open-src/xserver/xvnc/vnc-nohttpd.patch
open-src/xserver/xvnc/vnc-render.patch
open-src/xserver/xvnc/vnc-restart.patch
open-src/xserver/xvnc/vnc-use-fb.patch
open-src/xserver/xvnc/xvnc-inetd.xml
packages/SUNWxwplr/prototype_com
--- a/make_release_packages	Tue Oct 09 16:36:29 2007 -0700
+++ b/make_release_packages	Thu Oct 11 11:47:20 2007 -0700
@@ -27,7 +27,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 # 
-# @(#)make_release_packages	1.53 07/08/29
+# @(#)make_release_packages	1.54 07/10/10
 #
 #	Create and fill a package staging area for X
 #
@@ -92,7 +92,7 @@
 XW_PLT_PACKAGE="SUNWxwplt SUNWxwplr SUNWxwfnt SUNWxwrtl SUNWxwslb \
     SUNWxwmod SUNWxscreensaver-hacks-gl SUNWxwman SUNWxwfsw \
     SUNWxorg-server SUNWxorg-graphics-ddx SUNWxorg-doc SUNWxorg-cfg \
-    SUNWxsun-server $TSOL_PACKAGE"
+    SUNWxsun-server SUNWxvnc $TSOL_PACKAGE"
 
 # Some packages are only built for certain platforms currently
 if [ "$MACH" = "sparc" ]; then
--- a/open-src/Makefile	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/Makefile	Thu Oct 11 11:47:20 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.17	07/09/04
+# @(#)Makefile	1.18	07/10/10
 #
 ###############################################################################
 #
@@ -48,7 +48,7 @@
 
 AFTERX = \
 	app \
-	xserver/xorg \
+	xserver \
 	driver \
 	data \
 	font
--- a/open-src/common/Makefile.inc	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/common/Makefile.inc	Thu Oct 11 11:47:20 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.78	07/08/27
+# @(#)Makefile.inc	1.79	07/10/10
 #
 
 # Borrowed from Solaris OS/Net makefile.master:
@@ -64,10 +64,13 @@
 CC     			= cc
 GCC			= /usr/sfw/bin/gcc
 CXX			= CC
-DEFAULT_OPT_CFLAGS 	= -xO4 -xbuiltin -xlibmil -xprefetch \
-				-xdepend -xstrconst
+DEFAULT_OPT_FLAGS 	= -xO4 -xbuiltin -xlibmil -xprefetch -xdepend
+DEFAULT_OPT_CFLAGS	= $(DEFAULT_OPT_FLAGS) -xstrconst
+DEFAULT_OPT_CXXFLAGS	= $(DEFAULT_OPT_FLAGS)
 OPT_CFLAGS 		= $(DEFAULT_OPT_CFLAGS)
-CFLAGS 			=  -v -mc $(OPT_CFLAGS) $(ARCH_FLAGS)
+OPT_CXXFLAGS 		= $(DEFAULT_OPT_CXXFLAGS)
+CFLAGS 			= -v -mc $(OPT_CFLAGS) $(ARCH_FLAGS)
+CXXFLAGS		= -mc $(OPT_CXXFLAGS) $(ARCH_FLAGS)
 LDFLAGS 		= -z combreloc -z lazyload $(MAPFILES_FOR_ALL)
 
 ### Flags for libraries to meet various Solaris requirements
@@ -81,6 +84,7 @@
 
 # Flags for programs
 PROG_CFLAGS		= $(CFLAGS)
+PROG_CXXFLAGS		= $(CXXFLAGS)
 PROG_LDFLAGS		= $(LDFLAGS) $(MAPFILES_FOR_PROGS) -B direct
 
 # Linker mapfiles to link with for better performance & security
@@ -154,6 +158,7 @@
 X11_INCLUDES_DIR=$(X11_DIR)/include
 X11_DOC_DIR=$(X11_DIR)/share/doc
 X11_LOCALE_DIR=$(X11_DIR)/share/locale
+X11_MAN_DIR=$(X11_DIR)/share/man
 X11_ACLOCAL_DIR=$(X11_DIR)/share/aclocal
 X11_LC_MESSAGES_DIR=$(X11_LOCALE_DIR)/C/LC_MESSAGES
 # Subdirectory of /usr/X11/lib for X server private libraries
--- a/open-src/common/delibtoolize.pl	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/common/delibtoolize.pl	Thu Oct 11 11:47:20 2007 -0700
@@ -1,9 +1,33 @@
 #! /usr/perl5/bin/perl
 #
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
 #
-# ident	"@(#)delibtoolize.pl	1.6	07/07/25 SMI"
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+# 
+# 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
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+# 
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+#
+# ident	"@(#)delibtoolize.pl	1.7	07/10/10 SMI"
 #
 
 #
@@ -18,46 +42,47 @@
 use File::Find;
 
 sub process_file {
-  if ($_ eq "Makefile" && -f $_) {
+  if ($_ eq 'Makefile' && -f $_) {
     print "delibtoolizing $File::Find::name...\n";
-    my $old_file = $_ . "~";
+    my $old_file = $_ . '~';
     my $new_file = $_;
     rename($new_file, $old_file) or 
       die "Can't rename $new_file to $old_file: $!\n";
 
-    open(OLD, "<$old_file") or die "Can't open $old_file for reading: $!\n";
-    open(NEW, ">$new_file") or die "Can't open $new_file for writing: $!\n";
+    open my $OLD, '<', $old_file
+      or die "Can't open $old_file for reading: $!\n";
+    open my $NEW, '>', $new_file
+      or die "Can't open $new_file for writing: $!\n";
     
     my $compiler;
-    my $l;
     my @inlines = ();
     my %so_versions = ();
 
     # Read in original file and preprocess for data we'll need later
-    while ($l = <OLD>) {
-      if ($l =~ m%^\s*CC\s*=\s*(\S*)%) {
+    while (my $l = <$OLD>) {
+      if ($l =~ m/^\s*CC\s*=\s*(\S*)/) {
 	$compiler = $1;
       }
 
       # TODO: handle line continuation
-      if ($l =~ m%^(\S*)_la_LDFLAGS\s=.*-version-number (\d+)[:\d]+%) {
+      if ($l =~ m/^(\S*)_la_LDFLAGS\s=.*-version-number (\d+)[:\d]+/ms) {
 	$so_versions{$1} = $2;
       }
-      if ($l =~ m%^(\S*)_la_LDFLAGS\s=.*\s*-avoid-version\b%) {
-	$so_versions{$1} = "none";
-	$l =~ s%-avoid-version\b%%;
+      if ($l =~ m/^(\S*)_la_LDFLAGS\s=.*\s*-avoid-version\b/ms) {
+	$so_versions{$1} = 'none';
+	$l =~ s{-avoid-version\b}{}ms;
       }
 
       push @inlines, $l;
     }
-    close(OLD) or die;
+    close($OLD) or die;
 
-    my $picflags = "-Kpic -DPIC";
-    my $sharedobjflags = "-G";
+    my $picflags = '-Kpic -DPIC';
+    my $sharedobjflags = '-G';
 
-    if ($compiler =~ m/gcc/) {
-      $picflags = "-fpic -DPIC";
-      $sharedobjflags = "-shared";
+    if (defined($compiler) && ($compiler =~ m/gcc/)) {
+      $picflags = '-fpic -DPIC';
+      $sharedobjflags = '-shared';
     }
 
     my $curtarget = "";
@@ -67,58 +92,68 @@
     foreach my $curline (@inlines) {
       $l .= $curline;
       next if ($curline =~ m/\\$/);
+      chomp $l;
 
       # Remove libtool script from compile steps &
       # add PIC flags that libtool normally provides
       $l =~ s{\$\(LIBTOOL\)
-	      (?:[\\\s]+ --tag=CC)?
+	      (?:[\\\s]+ \$\(LT_QUIET\))?
+	      (?:[\\\s]+ --tag=(?:CC|CXX))?
 	      (?:[\\\s]+ \$\(AM_LIBTOOLFLAGS\) [\\\s]+ \$\(LIBTOOLFLAGS\))?
 	      [\\\s]+ --mode=compile
-	      [\\\s]+ (\$\(CC\)|\$\(CCAS\))
+	      [\\\s]+ (\$\(CC\)|\$\(CCAS\)|\$\(CXX\))
 	    }{$1 $picflags}xs;
 
       # Remove libtool script from link step
       $l =~ s{\$\(LIBTOOL\)
-	      (?:[\\\s]+ --tag=CC)?
+	      (?:[\\\s]+ \$\(LT_QUIET\))?
+	      (?:[\\\s]+ --tag=(?:CC|CXX))?
 	      (?:[\\\s]+ \$\(AM_LIBTOOLFLAGS\) [\\\s]+ \$\(LIBTOOLFLAGS\))?
 	      [\\\s]+ --mode=link
 	    }{}xs;
 
       # Change -rpath to -R in link arguments
-      $l =~ s{(\s*)-rpath(\s*)}{$1-R$2}g;
+      $l =~ s{(\s*)-rpath(\s*)}{$1-R$2}msg;
 
       # Change flags for building shared object from arguments to libtool
       # script into arguments to linker
-      $l =~ s{(_la_LDFLAGS\s*=.*) -module}{$1 $sharedobjflags};
-      $l =~ s{(_la_LDFLAGS\s*=.*) -version-number (\d+)[:\d]+}
-	     {$1 $sharedobjflags};
-      $l =~ s{(_la_LDFLAGS\s*=.*) -no-undefined}{$1 -z defs};
+      if ($l =~ m/_la_LDFLAGS\s*=/) {
+	$l =~ s{(\s*$sharedobjflags)+\b}{}msg;
+	$l =~ s{(_la_LDFLAGS\s*=\s*)}{$1 $sharedobjflags }ms;
+	$l =~ s{\s+-module\b}{}ms;
+	$l =~ s{\s+-version-number\s+\d+[:\d]+}{}ms;
+	$l =~ s{\s+-no-undefined\b}{ -z defs}ms;
+      }
 
       # Change file names
-      my $so;
-      foreach $so (keys %so_versions) {
-	if ($so_versions{$so} eq "none") {
-	  $l =~ s%$so\.la\b%$so.so%g;
+      foreach my $so (keys %so_versions) {
+	if ($so_versions{$so} eq 'none') {
+	  $l =~ s{$so\.la\b}{$so.so}msg;
 	} else {
-	  $l =~ s%$so\.la\b%$so.so.$so_versions{$so}%g;
+	  $l =~ s{$so\.la\b}{$so.so.$so_versions{$so}}msg;
 	}
       }
-      $l =~ s%\.la\b%.a%g;
+      $l =~ s{\.la\b}{.a}msg;
+      $l =~ s{\.libs/\*\.o\b}{*.lo}msg;
+      $l =~ s{\.lo\b}{.o}msg;
 
-      if ($l =~ m%^(\S+):%) {
+      if ($l =~ m/^(\S+):/) {
 	$curtarget = $1;
-      } elsif ($l =~ m%^\s*$%) {
+      } elsif ($l =~ m/^\s*$/) {
 	$curtarget = "";
       }
 
-      if ($curtarget =~ m%^.*\.a$%) {
-	$l =~ s%\$\(LINK\)%\$(AR) cru $curtarget%;
+      # Static libraries
+      if ($curtarget =~ m/^.*\.a$/) {
+	$l =~ s{\$\(\w*LINK\)}{\$(AR) cru $curtarget}ms;
+	$l =~ s{\$\(\w*(?:LIBS|LIBADD)\)}{}msg;
+	$l =~ s{(\$\((?:\w*_)?AR\).*\s+)-R\s*\$\(libdir\)}{$1}msg;
       }
 
-      print NEW $l;
+      print $NEW $l, "\n";
       $l = "";
     }
-    close(NEW) or die;
+    close($NEW) or die;
   }
 }
 
--- a/open-src/data/smf-rbac/Xserver	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/data/smf-rbac/Xserver	Thu Oct 11 11:47:20 2007 -0700
@@ -1,6 +1,6 @@
 #!/bin/ksh
 #
-# ident	"@(#)Xserver	1.4	07/09/04 SMI"
+# ident	"@(#)Xserver	1.5	07/10/10 SMI"
 #
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 #
@@ -141,6 +141,7 @@
     /usr/X11/bin/Xvfb)		;;
     /usr/X11/bin/amd64/Xvfb)	;;
     /usr/X11/bin/i386/Xvfb)	;;
+    /usr/X11/bin/Xvnc)		;;
     *)
 	echo "$0: $XSERVER is not a valid X server"
 	exit 1
@@ -149,10 +150,12 @@
 
 
 case $XSERVER in
-    *Xsun)
+    # Xsun based
+    /usr/openwin/bin/*)
 	DEPTHARG="-defdepth $DEFDEPTH"
 	;;
-    *Xorg)
+    # Xorg based
+    /usr/X11/bin/*)
 	DEPTHARG="-depth $DEFDEPTH"
 	;;
     *)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/Makefile	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,57 @@
+# Makefile for X Consolidation Open Source xserver modules
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use subject to license terms.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+# 
+# 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
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+# 
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+#
+# @(#)Makefile	1.1	07/10/10
+#
+###############################################################################
+
+OS_SUBDIRS = xorg xvnc
+
+all: 
+	$(MAKE) $(MFLAGS) subdirs OS_TARGET=all
+
+World: clean all
+
+clean: 
+	$(MAKE) $(MFLAGS) subdirs OS_TARGET=clean
+
+install:
+	$(MAKE) $(MFLAGS) subdirs OS_TARGET=install
+
+download:
+	$(MAKE) $(MFLAGS) subdirs OS_TARGET=download
+
+subdirs:
+	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
+	for i in $(OS_SUBDIRS) ;\
+	do \
+	(cd $$i ; echo "## making" $(OS_TARGET) "in open-src/proto/$$i..."; \
+	$(MAKE) $(MFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" $(OS_TARGET)); \
+	done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/Makefile.inc	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,120 @@
+# -*- Makefile -*- rules common to both Xorg & Xvnc builds
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use subject to license terms.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+# 
+# 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
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+# 
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+#
+# @(#)Makefile.inc	1.2	07/10/11
+#
+
+PWD:sh=pwd
+TOP=$(PWD)/../..
+
+# Xorg server source tarball to use sources from
+XORGSERVER_VERS=1.3.0.0
+
+include $(TOP)/common/Makefile.inc
+
+# Prefix for installation
+XSERVER_PREFIX=$(X11_DIR)
+
+FONTDIR=$(X11_DIR)/lib/X11/fonts
+MESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
+
+MODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
+DRI_MODULES_DIR='$${libdir}/modules/dri$(MODULE_subdir)'
+
+# Command line options to GNU autoconf configure script for xorg-server
+XSERVER_CONFIG_OPTS_COMMON = \
+	--prefix=$(XSERVER_PREFIX) --mandir='$${prefix}/share/man' \
+	--bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
+        --disable-xdm-auth-1 --enable-xcsecurity \
+	--enable-shared --disable-static \
+	--disable-xsdl --disable-xwin --disable-xgl \
+	--disable-install-setuid \
+	--with-vendor-name="Sun Microsystems, Inc." \
+	--with-vendor-web="http://sunsolve.sun.com/" \
+	--with-os-name="`uname -srmv`" \
+	--with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
+	--with-module-dir=$(MODULES_DIR) \
+	--with-dri-driver-path=$(DRI_MODULES_DIR) \
+	--with-xkb-path='$${libdir}/X11/xkb' \
+	--with-rgb-path='$${libdir}/X11/rgb' \
+	--with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/" 
+
+XSERVER_CONFIG_OPTS_sparc=$(XSERVER_CONFIG_OPTS_COMMON)
+XSERVER_CONFIG_OPTS_i386=$(XSERVER_CONFIG_OPTS_COMMON) \
+	--with-mesa-source=$(MESA_SRC_DIR)
+XSERVER_CONFIG_OPTS=$(XSERVER_CONFIG_OPTS_$(MACH))
+
+# Need to append header path with gcc headers for MMX/SSE intrinsics
+GCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
+
+# Default DPMS settings for Solaris
+DPMS_DEFINES=   -DDEFAULT_STANDBY_TIME=1440000 \
+		-DDEFAULT_SUSPEND_TIME=1620000 \
+                -DDEFAULT_OFF_TIME=1800000
+
+XSERVER_CPPFLAGS= \
+	-I$(MESA_SRC_DIR)/include \
+	-I$(PROTODIR)$(X11_INCLUDES_DIR) \
+	-I$(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
+	$(DPMS_DEFINES) -DSUNSOFT -DTSOL
+
+# Environment variable options to GNU autoconf configure script
+#  - XSERVERCFLAGS_CFLAGS - force CFLAGS to avoid -I /usr/X11/include breaking
+#    use of headers from proto area
+CONFIG_ENV_common = \
+        PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
+	INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
+	XSERVERCFLAGS_CFLAGS="-DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DXTHREADS -DXUSE_MTSAFE_API" \
+	PATH=$(PATH):/usr/sbin
+
+LDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
+	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
+
+CONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
+	CXX=$(CXX) CXXFLAGS="$(PROG_CXXFLAGS)" \
+	LDFLAGS="$(PROG_LDFLAGS) $(LDPATH_ADD)" \
+	CPPFLAGS="$($(XSERVER)_CPPFLAGS)"
+
+CONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
+	CXX=$(GCC:gcc=g++) CXXFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
+	LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
+	CPPFLAGS="$(GCC_HEADERS) $($(XSERVER)_CPPFLAGS)"
+
+CONFIG_ENV= $(CONFIG_ENV_$(COMPILER)) $(CONFIG_ENV_common)
+
+BUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
+
+BUILD_64_FLAGS_sparc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
+BUILD_64_FLAGS_i386=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
+BUILD_64_FLAGS=$(BUILD_64_FLAGS_$(MACH))
+
+# Environment variable options to use when building
+BUILD_ENV= PATH=$(PATH):/usr/sbin \
+	LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
--- a/open-src/xserver/xorg/IA.patch	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/xserver/xorg/IA.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -28,7 +28,7 @@
 
 diff -urp -x '*~' -x '*.orig' Makefile.am Makefile.am
 --- Makefile.am	2006-11-16 10:01:22.000000000 -0800
-+++ Makefile.am	2007-07-30 18:33:49.554487000 -0700
++++ Makefile.am	2007-09-20 14:21:57.003122000 -0700
 @@ -58,6 +58,7 @@ SUBDIRS = \
  	$(XTRAP_DIR) \
  	$(COMPOSITE_DIR) \
@@ -38,9 +38,46 @@
  	hw
  
 diff -urp -x '*~' -x '*.orig' configure.ac configure.ac
---- configure.ac	2007-07-30 18:33:33.880185000 -0700
-+++ configure.ac	2007-07-30 18:33:49.575258000 -0700
-@@ -1865,3 +1865,6 @@ hw/xprint/config/en_US/print/Makefile
+--- configure.ac	2007-09-20 14:21:36.871770000 -0700
++++ configure.ac	2007-09-20 14:21:57.684612000 -0700
+@@ -783,6 +783,9 @@
+ 	XI_INC='-I$(top_srcdir)/Xi'
+ fi
+ 
++# SolarisIA extension
++IA_LIB='$(top_builddir)/IA/libIA.la'
++
+ AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
+ 
+ AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
+@@ -1023,7 +1026,7 @@
+ AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
+ 
+ if test "x$XVFB" = xyes; then
+-	XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS"
++	XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ 	AC_SUBST([XVFB_LIBS])
+ fi
+ 
+@@ -1039,7 +1042,7 @@
+ AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
+ 
+ if test "x$XNEST" = xyes; then
+-	XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS"
++	XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ 	AC_SUBST([XNEST_LIBS])
+ fi
+ 
+@@ -1559,7 +1562,7 @@
+     # dix os fb mi extension glx (NOTYET) damage shadow xpstubs
+     #KDRIVE_PURE_LIBS="$DIX_LIB $OS_LIB $FB_LIB $XEXT_LIB $MIEXT_DAMAGE_LIB \
+     #    $MIEXT_SHADOW_LIB $XPSTUBS_LIB"
+-    KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
++    KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $OS_LIB"
+     KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
+     case $host_os in
+ 	*linux*)
+@@ -1866,3 +1866,6 @@ hw/xprint/config/en_US/print/Makefile
  hw/xprint/config/en_US/Makefile
  xorg-server.pc
  ])
@@ -49,7 +86,7 @@
 +AC_OUTPUT([IA/Makefile])
 diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86AutoConfig.c hw/xfree86/common/xf86AutoConfig.c
 --- hw/xfree86/common/xf86AutoConfig.c	2006-11-16 10:01:24.000000000 -0800
-+++ hw/xfree86/common/xf86AutoConfig.c	2007-07-30 18:33:49.575752000 -0700
++++ hw/xfree86/common/xf86AutoConfig.c	2007-09-20 14:21:57.861184000 -0700
 @@ -51,6 +51,7 @@
  	"\tLoad\t\"type1\"\n" \
  	"\tLoad\t\"record\"\n" \
@@ -60,7 +97,7 @@
  #define BUILTIN_DEVICE_NAME \
 diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Config.c hw/xfree86/common/xf86Config.c
 --- hw/xfree86/common/xf86Config.c	2006-11-30 17:40:10.000000000 -0800
-+++ hw/xfree86/common/xf86Config.c	2007-07-30 18:33:49.577216000 -0700
++++ hw/xfree86/common/xf86Config.c	2007-09-20 14:21:57.862784000 -0700
 @@ -294,6 +294,10 @@ xf86ModulelistFromConfig(pointer **optli
  	ptr = xf86addNewLoadDirective(ptr, "record", XF86_LOAD_MODULE, NULL);
  	ptr = xf86addNewLoadDirective(ptr, "dri", XF86_LOAD_MODULE, NULL);
@@ -74,7 +111,7 @@
      /*
 diff -urp -x '*~' -x '*.orig' hw/xfree86/dixmods/Makefile.am hw/xfree86/dixmods/Makefile.am
 --- hw/xfree86/dixmods/Makefile.am	2006-11-16 10:01:24.000000000 -0800
-+++ hw/xfree86/dixmods/Makefile.am	2007-07-30 18:33:49.577490000 -0700
++++ hw/xfree86/dixmods/Makefile.am	2007-09-20 14:21:57.863164000 -0700
 @@ -102,3 +102,10 @@ libxorgxkb_la_LIBADD = $(top_builddir)/d
  libxtrap_la_LDFLAGS = -avoid-version
  libxtrap_la_LIBADD = $(top_builddir)/XTrap/libxtrap.la
@@ -86,3 +123,73 @@
 +libIA_la_LDFLAGS = -avoid-version
 +libIA_la_LIBADD = $(top_builddir)/IA/libIA.la
 +libIA_la_SOURCES = iamodule.c
+diff -urp -x '*~' -x '*.orig' mi/miinitext.c mi/miinitext.c
+--- mi/miinitext.c	2006-11-16 10:01:26.000000000 -0800
++++ mi/miinitext.c	2007-09-20 14:21:57.965252000 -0700
+@@ -84,6 +84,8 @@ SOFTWARE.
+ #include "micmap.h"
+ #include "globals.h"
+ 
++#define SolarisIAExtension
++
+ #if defined(QNX4) /* sleaze for Watcom on QNX4 ... */
+ #undef GLXEXT
+ #endif
+@@ -109,6 +111,7 @@ SOFTWARE.
+ #undef DAMAGE
+ #undef XFIXES
+ #undef XEVIE
++#undef SolarisIAExtension
+ #else
+ #ifndef LOADABLEPRINTDDX
+ #undef XPRINT
+@@ -215,6 +218,9 @@ extern Bool noXIdleExtension;
+ #ifdef XV
+ extern Bool noXvExtension;
+ #endif
++#ifdef SolarisIAExtension
++Bool noIAExtension;
++#endif
+ 
+ #ifndef XFree86LOADER
+ #define INITARGS void
+@@ -257,6 +263,9 @@ typedef void (*InitExtension)(INITARGS);
+ #ifdef RES
+ #include <X11/extensions/XResproto.h>
+ #endif
++#ifdef SolarisIAExtension
++#include <X11/extensions/interactive.h>
++#endif
+ 
+ /* FIXME: this whole block of externs should be from the appropriate headers */
+ #ifdef EVI
+@@ -384,6 +393,9 @@ extern void DamageExtensionInit(INITARGS
+ #ifdef COMPOSITE
+ extern void CompositeExtensionInit(INITARGS);
+ #endif
++#ifdef SolarisIAExtension
++extern void IAExtensionInit(void);
++#endif
+ 
+ /* The following is only a small first step towards run-time
+  * configurable extensions.
+@@ -447,6 +459,9 @@ static ExtensionToggle ExtensionToggleLi
+ #ifdef XSYNC
+     { "SYNC", &noSyncExtension },
+ #endif
++#ifdef SolarisIAExtension
++    { IANAME /* "SolarisIA" */, &noIAExtension },
++#endif    
+ #ifdef TOGCUP
+     { "TOG-CUP", &noXcupExtension },
+ #endif
+@@ -663,6 +678,9 @@ InitExtensions(argc, argv)
+ #ifdef DAMAGE
+     if (!noDamageExtension) DamageExtensionInit();
+ #endif
++#ifdef SolarisIAExtension
++    if (!noIAExtension) IAExtensionInit();
++#endif
+ }
+ 
+ void
--- a/open-src/xserver/xorg/Makefile	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/xserver/xorg/Makefile	Thu Oct 11 11:47:20 2007 -0700
@@ -30,12 +30,10 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.58	07/10/09
+# @(#)Makefile	1.60	07/10/11
 #
 
-PWD:sh=pwd
-TOP=$(PWD)/../..
-
+# Build 32-bit or 64-bit?
 BUILD_TYPES_SET=yes
 BUILD_TYPES_sparc=64
 BUILD_TYPES_i386=32 64
@@ -44,69 +42,20 @@
 # Package name used in tarballs
 MODULE_NAME=xorg-server
 
-# Version number (used in path names)
-XORGSERVER_VERS=1.3.0.0
+# Name used in server-specific rules in ../Makefile.inc
+XSERVER=XORG
 
 # Source tarball
 SOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
 SOURCE_TARBALL_DIR=xserver
 
 # Patches to apply to source after unpacking, in order
-SOURCE_PATCHES = \
-	xephyr.patch,-p1 \
-	dtrace.patch \
-	automake-1.10.patch,-p1 \
-	render-security.patch,-p1 \
-	ramdac-symbols.patch,-p1 \
-	RandR-1.2-man.patch,-p1 \
-	secure-rpc.patch,-p1 \
-	sun-paths.patch \
-	sun-extramodes.patch \
-	sun-apm.patch \
-	sun-kb-autodetect.patch \
-	sun-keymappings.patch \
-	sun-manpage.patch \
-	cli-nolock.patch \
-	cli-nobanner.patch \
-	keep-aperture-open.patch \
-	sun-virtual-mouse.patch \
-	dtlogin-userinfo.patch \
-	IA.patch \
-	xtsol.patch \
-	sun-loginfo.patch \
-	xorgconfig.patch \
-	xorgcfg.patch \
-	amd64-loader-path.patch \
-	Xorg-mapfile.patch \
-	fontmod.patch \
-	xevie.patch \
-	wsfb.patch \
-	sparc-probe.patch \
-	glx-byteswap.patch \
-	glx-impure.patch \
-	dri.patch \
-	nvidia-autoconfig.patch \
-	autoconfig.patch \
-	autoconfig2.patch \
-	6406044.patch \
-	cfbmskbits.patch \
-	lg3d.patch \
-	6535006.patch \
-	6540484.patch \
-	signal-handler.patch \
-	kbd-driver.patch  \
-	6559710.patch \
-	6561019.patch \
-	6577124.patch \
-	shm-across-zones.patch \
-	6425775.patch
+# *** Moved to patch-list file so they can be shared between Xorg & Xvnc builds
+SOURCE_PATCHES:sh=cat patch-list
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(XORGSERVER_VERS)
 
-# Prefix for installation
-XORGSERVER_PREFIX=$(X11_DIR)
-
 # Man pages to apply Sun footer to & attributes to list
 # XXX: Need to adjust some of these to correct packages/stability
 SUNTOUCHED_MANPAGES= \
@@ -119,100 +68,35 @@
 	hw/xfree86/doc/man/Xorg.man.pre \
 	hw/xfree86/doc/man/xorg.conf.man.pre 
 
-SUNTOUCH_MAN_FLAGS= -p $(XORGSERVER_PREFIX)/bin/ \
+SUNTOUCH_MAN_FLAGS= -p $(XSERVER_PREFIX)/bin/ \
  -a '{Availability, SUNWxorg-server} {Interface Stability, Volatile}'
 
+# Compiler to use - x86 MMX code only builds with gcc, not Sun Studio, so use
+# gcc on x86 for now, but keep Sun Studio on SPARC
+COMPILER_sparc=cc
+COMPILER_i386=gcc
+COMPILER=$(COMPILER_$(MACH))
+
 # Binary built in tree
 XORGSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
 
 BUILD_TARGETS=$(XORGSERVER_BIN) $(BUILD_DIR)/mapfile-Xorg-externs
 
-include $(TOP)/common/Makefile.inc
+include ../Makefile.inc
 
 # Merge in additional sources from sun-src directory
 source_gen:: $(LNDIR)
 	(cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
 
-FONTDIR=$(X11_DIR)/lib/X11/fonts
-
-MESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
-
-MODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
-DRI_MODULES_DIR='$${libdir}/modules/dri$(MODULE_subdir)'
-
 # Command line options to GNU autoconf configure script
 # XXX: --disable-dga
-CONFIG_OPTS_COMMON = \
-	--prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
-	--bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
-        --enable-builddocs --disable-xdm-auth-1 --enable-xcsecurity \
-	--enable-shared --disable-static \
-	--enable-kdrive --enable-xephyr --disable-xsdl \
-	--disable-install-setuid --enable-xorgcfg \
-	--with-vendor-name="Sun Microsystems, Inc." \
-	--with-vendor-web="http://sunsolve.sun.com/" \
-	--with-os-name="`uname -srmv`" \
-	--with-log-dir=/var/log --with-xkb-output=/var/run/xkb \
-	--with-module-dir=$(MODULES_DIR) \
-	--with-dri-driver-path=$(DRI_MODULES_DIR) \
-	--with-xkb-path='$${libdir}/X11/xkb' \
-	--with-rgb-path='$${libdir}/X11/rgb' \
-	--with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/" 
-
-CONFIG_OPTS_sparc=$(CONFIG_OPTS_COMMON)
-CONFIG_OPTS_i386=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
-CONFIG_OPTS=$(CONFIG_OPTS_$(MACH))
-
-
-# Need to append header path with gcc headers for MMX/SSE intrinsics
-GCC_HEADERS:sh=gcc -print-search-dirs | awk -F: '$1 == "install" {printf "-idirafter %s/install-tools/include", $2}'
-
-# Default DPMS settings for Solaris
-DPMS_DEFINES=   -DDEFAULT_STANDBY_TIME=1440000 \
-		-DDEFAULT_SUSPEND_TIME=1620000 \
-                -DDEFAULT_OFF_TIME=1800000
+CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
+        --enable-builddocs --enable-xorgcfg \
+	--enable-kdrive --enable-xephyr --disable-xsdl
 
-XORG_CPPFLAGS= \
-	-I $(MESA_SRC_DIR)/include \
-	-I $(PROTODIR)$(X11_INCLUDES_DIR) \
-	-I $(PROTODIR)$(X11_INCLUDES_DIR)/drm \
-	-I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri \
-	-I $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions \
-	$(DPMS_DEFINES) -DSUNSOFT -DTSOL
-
-# Uncomment to build debug
-# OPT_CFLAGS = -g
-# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
-
-# Environment variable options to GNU autoconf configure script
-#  - XSERVERCFLAGS_CFLAGS - force CFLAGS to avoid -I /usr/X11/include breaking
-#    use of headers from proto area
-CONFIG_ENV_common = \
-        PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
-	INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
-	XSERVERCFLAGS_CFLAGS="-DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DXTHREADS -DXUSE_MTSAFE_API" \
-	PATH=$(PATH):/usr/sbin
-
-LDPATH_ADD = -L$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
-	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
-
-CONFIG_ENV_cc = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" \
-	LDFLAGS="$(PROG_LDFLAGS) $(LDPATH_ADD)" \
-	CPPFLAGS="$(XORG_CPPFLAGS)"
-
-CONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
-	LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
-	CPPFLAGS="$(GCC_HEADERS) $(XORG_CPPFLAGS)"
-
-CONFIG_ENV_sparc= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
-CONFIG_ENV_i386= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
-CONFIG_ENV= $(CONFIG_ENV_$(MACH))
-
-BUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
-
-BUILD_64_FLAGS_sparc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
-BUILD_64_FLAGS_i386=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
-BUILD_64_FLAGS=$(BUILD_64_FLAGS_$(MACH))
+XORG_CPPFLAGS= $(XSERVER_CPPFLAGS) \
+	-I$(PROTODIR)$(X11_INCLUDES_DIR)/drm \
+	-I$(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri
 
 # Run configure script
 $(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(SOURCE_DIR)/configure
@@ -224,12 +108,6 @@
 $(SOURCE_DIR)/configure: $(UNPACK_TARGET) $(SOURCE_DIR)/configure.ac
 	$(MAKE) $(MFLAGS) autoreconf
 
-# Environment variable options to use when building
-BUILD_ENV= PATH=$(PATH):/usr/sbin \
-	LD_LIBRARY_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR):$(PROTODIR)$(X11_DIR)/lib/xorgcfg$(ARCHLIBSUBDIR)
-
-#LD_OPTIONS="-z textwarn"
-
 $(XORGSERVER_BIN): $(SOURCE_DIR)/Makefile
 	(cd $(SOURCE_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
 
--- a/open-src/xserver/xorg/lg3d.patch	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/xserver/xorg/lg3d.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -27,8 +27,8 @@
 # of the copyright holder.
 
 diff -urp -x '*~' -x '*.orig' Xext/Makefile.am Xext/Makefile.am
---- Xext/Makefile.am	2007-07-30 18:38:42.289597000 -0700
-+++ Xext/Makefile.am	2007-07-30 18:38:58.872659000 -0700
+--- Xext/Makefile.am	2007-09-20 14:28:19.261551000 -0700
++++ Xext/Makefile.am	2007-09-20 14:28:43.819660000 -0700
 @@ -153,6 +153,12 @@ endif
  TSOL_SRCS = tsolCompat.c
  BUILTIN_SRCS += $(TSOL_SRCS)
@@ -51,8 +51,8 @@
 +	$(LGE_SRCS) 
  
 diff -urp -x '*~' -x '*.orig' configure.ac configure.ac
---- configure.ac	2007-07-30 18:38:42.685647000 -0700
-+++ configure.ac	2007-07-30 18:38:58.875135000 -0700
+--- configure.ac	2007-09-20 14:28:19.766564000 -0700
++++ configure.ac	2007-09-20 14:28:43.826445000 -0700
 @@ -444,6 +444,7 @@ AC_ARG_ENABLE(appgroup,       AS_HELP_ST
  AC_ARG_ENABLE(xcalibrate,     AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no])
  AC_ARG_ENABLE(tslib,          AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no])
@@ -61,7 +61,7 @@
  AC_ARG_ENABLE(cup,            AS_HELP_STRING([--disable-cup], [Build TOG-CUP extension (default: enabled)]), [CUP=$enableval], [CUP=yes])
  AC_ARG_ENABLE(evi,            AS_HELP_STRING([--disable-evi], [Build Extended-Visual-Information extension (default: enabled)]), [EVI=$enableval], [EVI=yes])
  AC_ARG_ENABLE(multibuffer,    AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
-@@ -673,6 +674,12 @@ if test "x$XEVIE" = xyes; then
+@@ -674,6 +675,12 @@ if test "x$XEVIE" = xyes; then
  	REQUIRED_MODULES="$REQUIRED_MODULES evieproto"
  fi
  
@@ -74,7 +74,7 @@
  AM_CONDITIONAL(APPGROUP, [test "x$APPGROUP" = xyes])
  if test "x$APPGROUP" = xyes; then
  	if test "x$XACE" != xyes || test "x$XCSECURITY" != xyes; then
-@@ -896,7 +903,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(t
+@@ -897,7 +904,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(t
  PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
  PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
  
@@ -84,8 +84,8 @@
  XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
  AC_SUBST([SYS_LIBS])
 diff -urp -x '*~' -x '*.orig' dix/Makefile.am dix/Makefile.am
---- dix/Makefile.am	2007-07-30 18:38:41.946697000 -0700
-+++ dix/Makefile.am	2007-07-30 18:38:58.875437000 -0700
+--- dix/Makefile.am	2007-09-20 14:28:18.529208000 -0700
++++ dix/Makefile.am	2007-09-20 14:28:43.826833000 -0700
 @@ -30,7 +30,8 @@ libdix_la_SOURCES = 	\
  	swapreq.c	\
  	tables.c	\
@@ -97,8 +97,8 @@
  libxpstubs_la_SOURCES =	\
  	xpstubs.c
 diff -urp -x '*~' -x '*.orig' dix/events.c dix/events.c
---- dix/events.c	2007-07-30 18:38:42.325047000 -0700
-+++ dix/events.c	2007-07-30 18:38:58.878579000 -0700
+--- dix/events.c	2007-09-20 14:28:19.287006000 -0700
++++ dix/events.c	2007-09-20 14:28:43.829681000 -0700
 @@ -167,6 +167,23 @@ xEvent *xeviexE;
  #include "dixgrabs.h"
  #include "dispatch.h"
@@ -721,8 +721,8 @@
 +
 +#endif /* LG3D */
 diff -urp -x '*~' -x '*.orig' dix/extension.c dix/extension.c
---- dix/extension.c	2007-07-30 18:38:41.952219000 -0700
-+++ dix/extension.c	2007-07-30 18:38:58.879424000 -0700
+--- dix/extension.c	2007-09-20 14:28:18.534141000 -0700
++++ dix/extension.c	2007-09-20 14:28:43.830242000 -0700
 @@ -63,6 +63,10 @@ SOFTWARE.
  #include "xace.h"
  #endif
@@ -782,7 +782,7 @@
  	    bufptr += len;
 diff -urp -x '*~' -x '*.orig' include/globals.h include/globals.h
 --- include/globals.h	2006-09-17 23:04:18.000000000 -0700
-+++ include/globals.h	2007-07-30 18:38:58.898264000 -0700
++++ include/globals.h	2007-09-20 14:28:43.830529000 -0700
 @@ -184,4 +184,8 @@ extern Bool noXIdleExtension;
  extern Bool noXvExtension;
  #endif
@@ -793,9 +793,9 @@
 +
  #endif /* !_XSERV_GLOBAL_H_ */
 diff -urp -x '*~' -x '*.orig' mi/miinitext.c mi/miinitext.c
---- mi/miinitext.c	2007-07-30 18:38:42.408483000 -0700
-+++ mi/miinitext.c	2007-07-30 18:38:58.899770000 -0700
-@@ -88,6 +88,11 @@ SOFTWARE.
+--- mi/miinitext.c	2007-09-20 14:28:19.434320000 -0700
++++ mi/miinitext.c	2007-09-20 14:28:43.892780000 -0700
+@@ -90,6 +90,11 @@ SOFTWARE.
  #include "extnsionst.h"
  #endif
  
@@ -807,15 +807,15 @@
  #if defined(QNX4) /* sleaze for Watcom on QNX4 ... */
  #undef GLXEXT
  #endif
-@@ -113,6 +118,7 @@ SOFTWARE.
- #undef DAMAGE
+@@ -116,6 +121,7 @@ SOFTWARE.
  #undef XFIXES
  #undef XEVIE
+ #undef SolarisIAExtension
 +#undef LG3D
  #else
  #ifndef LOADABLEPRINTDDX
  #undef XPRINT
-@@ -185,6 +191,9 @@ extern Bool noXCMiscExtension;
+@@ -188,6 +194,9 @@ extern Bool noXCMiscExtension;
  #ifdef XEVIE
  extern Bool noXevieExtension;
  #endif
@@ -825,9 +825,9 @@
  #ifdef XF86BIGFONT
  extern Bool noXFree86BigfontExtension;
  #endif
-@@ -388,6 +397,9 @@ extern void DamageExtensionInit(INITARGS
- #ifdef COMPOSITE
- extern void CompositeExtensionInit(INITARGS);
+@@ -410,6 +419,9 @@ extern void IAExtensionInit(void);
+ #ifdef TSOL
+ extern void TsolExtensionInit(void);
  #endif
 +#ifdef LG3D
 +extern void LgeExtensionInit(INITARGS);
@@ -835,7 +835,7 @@
  
  /* The following is only a small first step towards run-time
   * configurable extensions.
-@@ -497,6 +509,9 @@ static ExtensionToggle ExtensionToggleLi
+@@ -525,6 +537,9 @@ static ExtensionToggle ExtensionToggleLi
  #ifdef XV
      { "XVideo", &noXvExtension },
  #endif
@@ -845,7 +845,7 @@
      { NULL, NULL }
  };
  
-@@ -533,6 +548,53 @@ InitExtensions(argc, argv)
+@@ -561,6 +576,53 @@ InitExtensions(argc, argv)
      int		argc;
      char	*argv[];
  {
@@ -899,9 +899,9 @@
  #ifdef XCSECURITY
      SecurityExtensionSetup();
  #endif
-@@ -667,6 +729,9 @@ InitExtensions(argc, argv)
- #ifdef DAMAGE
-     if (!noDamageExtension) DamageExtensionInit();
+@@ -706,6 +768,9 @@ InitExtensions(argc, argv)
+ 	}
+     }
  #endif
 +#ifdef LG3D
 +    if (!noLgeExtension) LgeExtensionInit();
@@ -909,7 +909,7 @@
  }
  
  void
-@@ -737,6 +802,9 @@ static ExtensionModule staticExtensions[
+@@ -776,6 +841,9 @@ static ExtensionModule staticExtensions[
  #ifdef XEVIE
      { XevieExtensionInit, "XEVIE", &noXevieExtension, NULL },
  #endif 
@@ -919,7 +919,7 @@
      { NULL, NULL, NULL, NULL, NULL }
  };
      
-@@ -750,6 +818,21 @@ InitExtensions(argc, argv)
+@@ -789,6 +857,21 @@ InitExtensions(argc, argv)
      ExtensionModule *ext;
      static Bool listInitialised = FALSE;
  
@@ -943,7 +943,7 @@
  	for (i = 0; staticExtensions[i].name; i++)
 diff -urp -x '*~' -x '*.orig' mi/misprite.c mi/misprite.c
 --- mi/misprite.c	2006-09-17 23:04:18.000000000 -0700
-+++ mi/misprite.c	2007-07-30 18:38:58.909854000 -0700
++++ mi/misprite.c	2007-09-20 14:28:43.893409000 -0700
 @@ -156,8 +156,23 @@ miSpriteInitialize (pScreen, cursorFuncs
      miSpriteScreenPtr	pScreenPriv;
      VisualPtr		pVisual;
@@ -969,8 +969,8 @@
      if (miSpriteGeneration != serverGeneration)
      {
 diff -urp -x '*~' -x '*.orig' os/utils.c os/utils.c
---- os/utils.c	2007-07-30 18:38:42.573625000 -0700
-+++ os/utils.c	2007-07-30 18:38:58.935850000 -0700
+--- os/utils.c	2007-09-20 14:28:19.683418000 -0700
++++ os/utils.c	2007-09-20 14:28:43.900842000 -0700
 @@ -236,6 +236,9 @@ _X_EXPORT Bool noXIdleExtension = FALSE;
  #ifdef XV
  _X_EXPORT Bool noXvExtension = FALSE;
@@ -983,7 +983,7 @@
  #include <X11/Xos_r.h>
 diff -urp -x '*~' -x '*.orig' xkb/xkbPrKeyEv.c xkb/xkbPrKeyEv.c
 --- xkb/xkbPrKeyEv.c	2006-09-17 23:04:18.000000000 -0700
-+++ xkb/xkbPrKeyEv.c	2007-07-30 18:38:58.940146000 -0700
++++ xkb/xkbPrKeyEv.c	2007-09-20 14:28:43.901278000 -0700
 @@ -39,6 +39,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
  #include <X11/extensions/XKBsrv.h>
  #include <ctype.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/patch-list	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,47 @@
+xephyr.patch,-p1
+dtrace.patch
+automake-1.10.patch,-p1
+render-security.patch,-p1
+ramdac-symbols.patch,-p1
+RandR-1.2-man.patch,-p1
+secure-rpc.patch,-p1
+sun-paths.patch
+sun-extramodes.patch
+sun-apm.patch
+sun-kb-autodetect.patch
+sun-keymappings.patch
+sun-manpage.patch
+cli-nolock.patch
+cli-nobanner.patch
+keep-aperture-open.patch
+sun-virtual-mouse.patch
+dtlogin-userinfo.patch
+IA.patch
+xtsol.patch
+sun-loginfo.patch
+xorgconfig.patch
+xorgcfg.patch
+amd64-loader-path.patch
+Xorg-mapfile.patch
+fontmod.patch
+xevie.patch
+wsfb.patch
+sparc-probe.patch
+glx-byteswap.patch
+glx-impure.patch
+dri.patch
+nvidia-autoconfig.patch
+autoconfig.patch
+autoconfig2.patch
+6406044.patch
+cfbmskbits.patch
+lg3d.patch
+6535006.patch
+6540484.patch
+signal-handler.patch
+kbd-driver.patch 
+6559710.patch
+6561019.patch
+6577124.patch
+shm-across-zones.patch
+6425775.patch
--- a/open-src/xserver/xorg/sun-manpage.patch	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/xserver/xorg/sun-manpage.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -14,7 +14,7 @@
 --- doc/Xserver.man.pre	2006-12-21 10:50:46.000000000 -0800
 +++ doc/Xserver.man.pre	2007-01-19 16:24:28.082214000 -0800
 @@ -1,3 +1,32 @@
-+.\" ident	"@(#)sun-manpage.patch	1.4	07/02/21 SMI"
++.\" ident	"@(#)sun-manpage.patch	1.5	07/10/10 SMI"
 +.\" 
 +.\" Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 +.\" 
@@ -281,7 +281,7 @@
  .TP 8
  .B \-xkbmap \fIfilename\fP
  loads keyboard description in \fIfilename\fP on server startup.
-@@ -732,6 +873,90 @@ __default_font_path__ .
+@@ -732,6 +873,91 @@ __default_font_path__ .
  .LP
  The font path can be set with the \fB\-fp\fP option or by \fIxset\fP(1)
  after the server has started.
@@ -339,6 +339,7 @@
 +\fB/usr/X11/bin/Xvfb\fP
 +\fB/usr/X11/bin/i386/Xvfb\fP
 +\fB/usr/X11/bin/amd64/Xvfb\fP
++\fB/usr/X11/bin/Xvnc\fP
 +.fi
 +.TP
 +.B options/tcp_listen
--- a/open-src/xserver/xorg/xtsol.patch	Tue Oct 09 16:36:29 2007 -0700
+++ b/open-src/xserver/xorg/xtsol.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -1,6 +1,6 @@
 diff -urp -x '*~' -x '*.orig' Makefile.am Makefile.am
---- Makefile.am	2007-01-24 20:08:20.608596000 -0800
-+++ Makefile.am	2007-01-24 20:08:34.851352000 -0800
+--- Makefile.am	2007-09-20 14:21:57.003122000 -0700
++++ Makefile.am	2007-09-20 14:22:20.855563000 -0700
 @@ -34,6 +34,10 @@ if DBE
  DBE_DIR=dbe
  endif
@@ -21,8 +21,8 @@
  	hw
  
 diff -urp -x '*~' -x '*.orig' Xext/Makefile.am Xext/Makefile.am
---- Xext/Makefile.am	2007-01-24 20:08:20.471166000 -0800
-+++ Xext/Makefile.am	2007-01-24 20:08:34.853082000 -0800
+--- Xext/Makefile.am	2007-09-20 14:21:56.845261000 -0700
++++ Xext/Makefile.am	2007-09-20 14:22:20.855984000 -0700
 @@ -149,6 +149,10 @@ if DPMSExtension
  MODULE_SRCS += $(DPMS_SRCS)
  endif
@@ -35,8 +35,8 @@
  
  libXext_la_SOURCES =		$(BUILTIN_SRCS) $(MODULE_SRCS)
 diff -urp -x '*~' -x '*.orig' Xext/security.c Xext/security.c
---- Xext/security.c	2007-01-22 21:39:15.000000000 -0800
-+++ Xext/security.c	2007-01-24 20:08:34.879559000 -0800
+--- Xext/security.c	2006-11-16 09:39:03.000000000 -0800
++++ Xext/security.c	2007-09-20 14:22:20.858055000 -0700
 @@ -72,10 +72,15 @@ typedef struct {
      ((extnsn)->devPrivates[securityExtnsnPrivateIndex].val)
  #define STATEPTR(client) \
@@ -54,20 +54,59 @@
  CallbackListPtr SecurityValidateGroupCallback = NULL;  /* see security.h */
  
 diff -urp -x '*~' -x '*.orig' configure.ac configure.ac
---- configure.ac	2007-07-30 18:33:49.575258000 -0700
-+++ configure.ac	2007-07-30 18:34:04.958972000 -0700
-@@ -127,6 +127,10 @@ AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP
+--- configure.ac	2007-09-20 14:21:57.684612000 -0700
++++ configure.ac	2007-09-20 14:22:20.875351000 -0700
+@@ -127,6 +127,13 @@ AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP
  dnl Find the math libary
  AC_CHECK_LIB(m, sqrt)
  
 +dnl Check for libtsol for Solaris Trusted Extensions module
 +AC_CHECK_LIB(tsol, bsllow, [BUILD_TSOL_MODULE=yes], [BUILD_TSOL_MODULE=no])
 +AM_CONDITIONAL(BUILD_TSOL_MODULE, [test x$BUILD_TSOL_MODULE = xyes])
++if test "x$BUILD_TSOL_MODULE" = xyes; then
++	TSOL_LIB='$(top_builddir)/tsol/libxtsol.la -ltsol -ltsnet -lsecdb -lbsm'
++fi
 +
  AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
  
  dnl AGPGART headers
-@@ -1868,3 +1872,6 @@ xorg-server.pc
+@@ -1026,7 +1029,7 @@
+ AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
+ 
+ if test "x$XVFB" = xyes; then
+-	XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $CWRAP_LIB $OS_LIB $LIBS"
++	XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $TSOL_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ 	AC_SUBST([XVFB_LIBS])
+ fi
+ 
+@@ -1042,7 +1045,7 @@
+ AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
+ 
+ if test "x$XNEST" = xyes; then
+-	XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $CWRAP_LIB $OS_LIB $LIBS"
++	XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $TSOL_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ 	AC_SUBST([XNEST_LIBS])
+ fi
+ 
+@@ -1403,7 +1406,7 @@
+ 
+ if test "x$XPRINT" = xyes; then
+ 	PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau])
+-	XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS"
++	XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $TSOL_LIB"
+ 	XPRINT_LIBS="$XPRINT_LIBS $DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS"
+ 	AC_SUBST([XPRINT_CFLAGS])
+ 	AC_SUBST([XPRINT_LIBS])
+@@ -1562,7 +1565,7 @@
+     # dix os fb mi extension glx (NOTYET) damage shadow xpstubs
+     #KDRIVE_PURE_LIBS="$DIX_LIB $OS_LIB $FB_LIB $XEXT_LIB $MIEXT_DAMAGE_LIB \
+     #    $MIEXT_SHADOW_LIB $XPSTUBS_LIB"
+-    KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $OS_LIB"
++    KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $IA_LIB $TSOL_LIB $OS_LIB"
+     KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
+     case $host_os in
+ 	*linux*)
+@@ -1869,3 +1873,6 @@ xorg-server.pc
  
  # Add Sun IA extension
  AC_OUTPUT([IA/Makefile])
@@ -75,8 +114,8 @@
 +# Add Sun Trusted Extensions extension
 +AC_OUTPUT([tsol/Makefile])
 diff -urp -x '*~' -x '*.orig' dix/dispatch.c dix/dispatch.c
---- dix/dispatch.c	2007-01-24 20:08:20.363701000 -0800
-+++ dix/dispatch.c	2007-02-15 15:47:10.697015000 -0800
+--- dix/dispatch.c	2007-09-20 14:21:56.671742000 -0700
++++ dix/dispatch.c	2007-09-20 14:22:20.877325000 -0700
 @@ -74,8 +74,8 @@ Equipment Corporation.
  
  ******************************************************************/
@@ -142,8 +181,8 @@
  }
  
 diff -urp -x '*~' -x '*.orig' dix/events.c dix/events.c
---- dix/events.c	2007-01-24 20:08:20.365698000 -0800
-+++ dix/events.c	2007-01-24 20:08:34.871662000 -0800
+--- dix/events.c	2007-09-20 14:21:56.673705000 -0700
++++ dix/events.c	2007-09-20 14:22:20.879320000 -0700
 @@ -76,7 +76,7 @@ Equipment Corporation.
  
  /*****************************************************************
@@ -182,8 +221,8 @@
  {
      register WindowPtr  pWin;
 diff -urp -x '*~' -x '*.orig' dix/property.c dix/property.c
---- dix/property.c	2007-01-22 21:39:15.000000000 -0800
-+++ dix/property.c	2007-01-24 20:08:34.872393000 -0800
+--- dix/property.c	2006-10-24 17:25:19.000000000 -0700
++++ dix/property.c	2007-09-20 14:22:20.880023000 -0700
 @@ -45,6 +45,34 @@ SOFTWARE.
  
  ******************************************************************/
@@ -287,8 +326,8 @@
      if (client->noClientException != Success)
  	return(client->noClientException);
 diff -urp -x '*~' -x '*.orig' dix/window.c dix/window.c
---- dix/window.c	2007-01-22 21:39:15.000000000 -0800
-+++ dix/window.c	2007-01-24 20:08:34.874164000 -0800
+--- dix/window.c	2007-03-17 17:29:16.000000000 -0700
++++ dix/window.c	2007-09-20 14:22:20.881976000 -0700
 @@ -98,6 +98,33 @@ Equipment Corporation.
  
  ******************************************************************/
@@ -390,8 +429,8 @@
      register WindowPtr pWin,
      register WindowPtr pSib,
 diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86AutoConfig.c hw/xfree86/common/xf86AutoConfig.c
---- hw/xfree86/common/xf86AutoConfig.c	2007-01-24 20:08:20.616860000 -0800
-+++ hw/xfree86/common/xf86AutoConfig.c	2007-01-24 20:08:34.874529000 -0800
+--- hw/xfree86/common/xf86AutoConfig.c	2007-09-20 14:21:57.861184000 -0700
++++ hw/xfree86/common/xf86AutoConfig.c	2007-09-20 14:22:20.882348000 -0700
 @@ -52,6 +52,7 @@
  	"\tLoad\t\"record\"\n" \
  	"\tLoad\t\"dri\"\n" \
@@ -401,8 +440,8 @@
  
  #define BUILTIN_DEVICE_NAME \
 diff -urp -x '*~' -x '*.orig' hw/xfree86/common/xf86Config.c hw/xfree86/common/xf86Config.c
---- hw/xfree86/common/xf86Config.c	2007-01-24 20:08:20.618280000 -0800
-+++ hw/xfree86/common/xf86Config.c	2007-01-24 20:08:34.875808000 -0800
+--- hw/xfree86/common/xf86Config.c	2007-09-20 14:21:57.862784000 -0700
++++ hw/xfree86/common/xf86Config.c	2007-09-20 14:22:20.883535000 -0700
 @@ -298,6 +298,10 @@ xf86ModulelistFromConfig(pointer **optli
  	/* Sun addition - IA extension */
  	ptr = xf86addNewLoadDirective(ptr, "IA", XF86_LOAD_MODULE, NULL);
@@ -415,8 +454,8 @@
  
      /*
 diff -urp -x '*~' -x '*.orig' hw/xfree86/dixmods/Makefile.am hw/xfree86/dixmods/Makefile.am
---- hw/xfree86/dixmods/Makefile.am	2007-01-24 20:08:20.618782000 -0800
-+++ hw/xfree86/dixmods/Makefile.am	2007-01-24 20:08:34.876106000 -0800
+--- hw/xfree86/dixmods/Makefile.am	2007-09-20 14:21:57.863164000 -0700
++++ hw/xfree86/dixmods/Makefile.am	2007-09-20 14:22:20.883822000 -0700
 @@ -109,3 +109,11 @@ extsmodule_LTLIBRARIES += libIA.la
  libIA_la_LDFLAGS = -avoid-version
  libIA_la_LIBADD = $(top_builddir)/IA/libIA.la
@@ -430,8 +469,8 @@
 +libxtsol_la_SOURCES = tsolmodule.c
 +endif
 diff -urp -x '*~' -x '*.orig' include/dixstruct.h include/dixstruct.h
---- include/dixstruct.h	2007-01-22 21:39:17.000000000 -0800
-+++ include/dixstruct.h	2007-01-24 20:08:34.876423000 -0800
+--- include/dixstruct.h	2006-10-24 17:25:19.000000000 -0700
++++ include/dixstruct.h	2007-09-20 14:22:20.884203000 -0700
 @@ -127,7 +127,20 @@ typedef struct _Client {
      unsigned char requestLog[MAX_REQUEST_LOG];
      int         requestLogIndex;
@@ -454,8 +493,8 @@
      struct _AppGroupRec*	appgroup;
  #endif
 diff -urp -x '*~' -x '*.orig' include/extnsionst.h include/extnsionst.h
---- include/extnsionst.h	2007-01-22 21:39:17.000000000 -0800
-+++ include/extnsionst.h	2007-01-24 20:08:34.876825000 -0800
+--- include/extnsionst.h	2006-10-24 17:25:19.000000000 -0700
++++ include/extnsionst.h	2007-09-20 14:22:20.884616000 -0700
 @@ -45,6 +45,34 @@ SOFTWARE.
  
  ******************************************************************/
@@ -542,8 +581,8 @@
  #endif /* EXTENSIONSTRUCT_H */
  
 diff -urp -x '*~' -x '*.orig' include/propertyst.h include/propertyst.h
---- include/propertyst.h	2007-01-22 21:39:17.000000000 -0800
-+++ include/propertyst.h	2007-01-24 20:08:34.877120000 -0800
+--- include/propertyst.h	2006-09-17 23:04:18.000000000 -0700
++++ include/propertyst.h	2007-09-20 14:22:20.884994000 -0700
 @@ -45,6 +45,35 @@ SOFTWARE.
  
  ******************************************************************/
@@ -595,8 +634,8 @@
  
  #endif /* PROPERTYSTRUCT_H */
 diff -urp -x '*~' -x '*.orig' include/selection.h include/selection.h
---- include/selection.h	2007-01-22 21:39:17.000000000 -0800
-+++ include/selection.h	2007-01-24 20:08:34.877423000 -0800
+--- include/selection.h	2006-09-17 23:04:18.000000000 -0700
++++ include/selection.h	2007-09-20 14:22:20.885346000 -0700
 @@ -49,6 +49,34 @@ SOFTWARE.
  
  ******************************************************************/
@@ -643,11 +682,11 @@
  
  #endif /* SELECTION_H */
 diff -urp -x '*~' -x '*.orig' mi/miinitext.c mi/miinitext.c
---- mi/miinitext.c	2007-01-22 21:39:17.000000000 -0800
-+++ mi/miinitext.c	2007-01-24 20:08:34.877931000 -0800
-@@ -84,6 +84,10 @@ SOFTWARE.
- #include "micmap.h"
- #include "globals.h"
+--- mi/miinitext.c	2007-09-20 14:21:57.965252000 -0700
++++ mi/miinitext.c	2007-09-20 14:22:21.276990000 -0700
+@@ -86,6 +86,10 @@ SOFTWARE.
+ 
+ #define SolarisIAExtension
  
 +#ifdef TSOL	/* Maintaining binary compatibility with Xtsol module */
 +#include "extnsionst.h"
@@ -656,7 +695,63 @@
  #if defined(QNX4) /* sleaze for Watcom on QNX4 ... */
  #undef GLXEXT
  #endif
-@@ -774,6 +778,11 @@ InitExtensions(argc, argv)
+@@ -221,6 +225,9 @@ extern Bool noXvExtension;
+ #ifdef SolarisIAExtension
+ Bool noIAExtension;
+ #endif
++#ifdef TSOL
++Bool noXTSolExtension;
++#endif
+ 
+ #ifndef XFree86LOADER
+ #define INITARGS void
+@@ -266,6 +273,10 @@ typedef void (*InitExtension)(INITARGS);
+ #ifdef SolarisIAExtension
+ #include <X11/extensions/interactive.h>
+ #endif
++#ifdef TSOL
++#define _XTSOL_SERVER
++#include <X11/extensions/Xtsol.h>
++#endif
+ 
+ /* FIXME: this whole block of externs should be from the appropriate headers */
+ #ifdef EVI
+@@ -396,6 +407,9 @@ extern void CompositeExtensionInit(INITA
+ #ifdef SolarisIAExtension
+ extern void IAExtensionInit(void);
+ #endif
++#ifdef TSOL
++extern void TsolExtensionInit(void);
++#endif
+ 
+ /* The following is only a small first step towards run-time
+  * configurable extensions.
+@@ -456,6 +470,9 @@ static ExtensionToggle ExtensionToggleLi
+ #ifdef XCSECURITY
+     { "SECURITY", &noSecurityExtension },
+ #endif
++#ifdef TSOL
++    { TSOLNAME /* "SUN_TSOL" */, &noXTSolExtension },
++#endif    
+ #ifdef XSYNC
+     { "SYNC", &noSyncExtension },
+ #endif
+@@ -681,6 +698,14 @@ InitExtensions(argc, argv)
+ #ifdef SolarisIAExtension
+     if (!noIAExtension) IAExtensionInit();
+ #endif
++#ifdef TSOL
++    if (!noXTSolExtension) {
++	TsolExtensionInit();
++	if (pSecHook) { /* If TSOL security hooks set, add to XACE callbacks */
++	    tsolCompatRegisterHooks();
++	}
++    }
++#endif
+ }
+ 
+ void
+@@ -792,6 +817,11 @@ InitExtensions(argc, argv)
  	    (ext->initFunc)();
  	}
      }
@@ -669,8 +764,8 @@
  
  static void (*__miHookInitVisualsFunction)(miInitVisualsProcPtr *);
 diff -urp -x '*~' -x '*.orig' os/connection.c os/connection.c
---- os/connection.c	2007-01-24 20:08:20.601169000 -0800
-+++ os/connection.c	2007-01-24 20:08:34.878666000 -0800
+--- os/connection.c	2007-09-20 14:21:56.995403000 -0700
++++ os/connection.c	2007-09-20 14:22:21.289634000 -0700
 @@ -44,6 +44,33 @@ ARISING OUT OF OR IN CONNECTION WITH THE
  SOFTWARE.
  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/Makefile	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,224 @@
+###############################################################################
+#
+# Xvnc server Makefile
+# Based on Fedora's vnc-4.1.2-21.fc8/vnc.spec
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use subject to license terms.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+# 
+# 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
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+# 
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+#
+# @(#)Makefile	1.3	07/10/11
+#
+
+# Build 32-bit or 64-bit?
+BUILD_TYPES_SET=yes
+BUILD_TYPES_sparc=64
+BUILD_TYPES_i386=32
+BUILD_TYPES=$(BUILD_TYPES_$(MACH))
+
+# Package name used in tarballs
+MODULE_NAME=vnc
+
+# Name used in server-specific rules in ../Makefile.inc
+XSERVER=XVNC
+
+# Version number (used in path names)
+VNC_VERS=4.1.2
+VNC_TARBALL_VERS=4_1_2-unixsrc
+
+# Source tarball
+SOURCE_TARBALL_NAME=$(MODULE_NAME)-$(VNC_TARBALL_VERS).tar.gz
+
+# Xorg server source tarball to use sources from
+XORG_TARBALL=$(TARBALLDIR)/xorg-server-$(XORGSERVER_VERS).tar.bz2
+XORG_SOURCE_DIR=$(BUILD_DIR)/xorg-server-$(XORGSERVER_VERS)
+XORG_BUILD_DIR=$(SOURCE_DIR)/unix/xorg-x11-server-source
+
+# Download site for source
+# - Master source site doesn't allow wget downloads, so we use a mirror
+#SOURCE_URL=http://www.realvnc.com/dist/$(SOURCE_TARBALL_NAME)
+SOURCE_URL=http://ltsp.mirrors.tds.net/pub/ltsp/tarballs/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
+SOURCE_UNCOMPRESS=gzcat
+
+# Directory created by unpacking source
+SOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(VNC_TARBALL_VERS)
+
+# Patches to apply to source after unpacking, in order
+SOURCE_PATCHES = \
+	vnc-use-fb.patch,-p1 \
+	vnc-restart.patch,-p1 \
+	vnc-modular-xorg.patch,-p1 \
+	vnc-nohttpd.patch,-p1 \
+	vnc-int10.patch,-p1 \
+	vnc-64bit.patch,-p1 \
+	vnc-ipv6.patch,-p1 \
+	vnc-render.patch,-p1 \
+	vnc-autotools.patch,-p1 \
+	vnc-autotools-compile.patch,-p1 \
+	vnc-always_use_fb.patch,-p1 \
+	vnc-24bit.patch,-p1 \
+	c++public.patch \
+	build-without-Xorg.patch \
+	solaris-port.patch
+
+XORG_SOURCE_PATCHES:sh=cat ../xorg/patch-list
+
+# Man pages to apply Sun footer to & attributes to list
+SUNTOUCHED_MANPAGES= unix/xc/programs/Xserver/Xvnc.man \
+	unix/vncconfig/vncconfig.man unix/vncpasswd/vncpasswd.man \
+	unix/vncserver.man unix/vncviewer/vncviewer.man \
+	unix/x0vncserver/x0vncserver.man
+SUNTOUCH_MAN_FLAGS= \
+ -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}'
+
+# Compiler to use - VNC code only builds with g++, not Sun Studio, so use
+# gcc/g++ on both platforms for now
+COMPILER=gcc
+
+# Binary built in tree
+XVNCSERVER_BIN=$(SOURCE_DIR)/hw/xfree86/Xorg
+
+BUILD_TARGETS=$(XVNCSERVER_BIN)
+
+default: all
+
+# Merge in additional sources from Xorg tarball & sun-src directory
+# Use layout from Fedora RPM so their patches apply
+# This step has to be done before including common/Makefile.inc so
+# that patches applied in that step work correctly.
+source_gen:: $(LNDIR)
+	mkdir -p $(SOURCE_DIR)/unix
+	bzcat $(XORG_TARBALL) | (cd $(BUILD_DIR) ; tar -xf - )
+	@if [ "x$(XORG_SOURCE_PATCHES)" != "x" ] ; then \
+	    for p in $(XORG_SOURCE_PATCHES) x ; do \
+	        if [ "$$p" != "x" ] ; then \
+		    PATCH_CMD=`echo $$p | awk -F, '{if (NF > 1) FLAGS = $$2; else FLAGS="-p0" ; printf "gpatch -d $(XORG_SOURCE_DIR) %s < ../xorg/%s\n", FLAGS, $$1}'` ; \
+		    echo "$${PATCH_CMD}" ; \
+		    eval $${PATCH_CMD} ; \
+		fi ; \
+	    done ; \
+	fi
+	mv $(XORG_SOURCE_DIR) $(XORG_BUILD_DIR)
+	(cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
+
+
+include ../Makefile.inc
+
+# Merge in additional sources from Xorg tarball & sun-src directory
+# Use layout from Fedora RPM so their patches apply
+# This step has to be done after including common/Makefile.inc since
+# it depends on files created in that stage
+source_gen:: 
+	(cd $(SOURCE_DIR) ; \
+	cp -p unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc \
+		unix/xc/programs/Xserver/Xvnc.man \
+		unix/xc/programs/Xserver/vnc/*.h \
+		unix/xc/programs/Xserver/vnc/*.cc \
+		unix/xorg-x11-server-source/hw/vnc/ ; \
+	cp -p unix/xorg-x11-server-source/cfb/cfb.h \
+		unix/xorg-x11-server-source/fb/fb.h \
+		unix/xorg-x11-server-source/fb/fbrop.h \
+		unix/xorg-x11-server-source/hw/vnc/ ; \
+	perl -i -p -e 's,\b(xor|and)\b,c_$$1,g' \
+		unix/xorg-x11-server-source/hw/vnc/cfb.h \
+		unix/xorg-x11-server-source/hw/vnc/fb.h \
+		unix/xorg-x11-server-source/hw/vnc/fbrop.h )
+
+# Command line options to GNU autoconf configure script for vnc
+VNC_CONFIG_OPTS= --with-installed-zlib --prefix=$(XVNCSERVER_PREFIX) \
+	--mandir='$${prefix}/share/man' --libdir='$${exec_prefix}/lib/vnc'
+
+# Command line options to GNU autoconf configure script for Xorg
+XVNC_CONFIG_OPTS = $(XSERVER_CONFIG_OPTS) \
+        --disable-builddocs --with-int10=stub \
+	--disable-dga --disable-xfree86-utils --disable-dri \
+	--disable-xorg --disable-dmx --disable-xvfb --disable-xnest \
+	--disable-xprint --disable-kdrive
+
+XVNC_CPPFLAGS = \
+	-I$(PWD)/$(SOURCE_DIR)/common \
+	-I$(PWD)/$(SOURCE_DIR)/unix/vncconfig \
+	$(XSERVER_CPPFLAGS)
+
+# Uncomment to build debug
+# OPT_CFLAGS = -g
+# DEFAULT_GCC_CFLAGS = -g -O3 -fno-omit-frame-pointer -Wall
+
+DEFAULT_GCC_CFLAGS += -fPIC
+
+# Environment variable options to GNU autoconf configure script
+XVNC_CONFIG_ENV = LIBS="-lsocket -lnsl"
+CONFIG_ENV += $(XVNC_CONFIG_ENV)
+
+LDPATH_ADD += -L$(PROTODIR)$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR) \
+        -R$(X11_SERVERMODS_DIR)/extensions/mesa/$(ARCHLIBSUBDIR) \
+        -R$(X11_SERVERMODS_DIR)/extensions$(ARCHLIBSUBDIR)
+
+# Run configure scripts for vnc sources
+$(SOURCE_DIR)/unix/Makefile: $(UNPACK_TARGET)
+	(cd $(SOURCE_DIR)/common && autoreconf --install --force && \
+		$(CONFIG_ENV) ./configure $(VNC_CONFIG_OPTS) )
+	(cd $(SOURCE_DIR)/unix && autoreconf --install --force && \
+		$(CONFIG_ENV) ./configure $(VNC_CONFIG_OPTS) )
+
+# Run configure script for Xvnc
+$(XORG_BUILD_DIR)/Makefile: $(UNPACK_TARGET)
+	(cd $(XORG_BUILD_DIR) &&  \
+	 ACLOCAL="$(ACLOCAL_PATH)" autoreconf --install --force && \
+	 $(CONFIG_ENV) ./configure $(XVNC_CONFIG_OPTS) )
+	$(TOP)/common/delibtoolize.pl $(SOURCE_DIR)
+
+$(XVNCSERVER_BIN): $(SOURCE_DIR)/unix/Makefile $(XORG_BUILD_DIR)/Makefile
+	(cd $(SOURCE_DIR)/common ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
+	(cd $(SOURCE_DIR)/unix ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
+	(cd $(XORG_BUILD_DIR) ; $(BUILD_ENV) $(MAKE) $(MFLAGS))
+
+install_gen: $(XVNCSERVER_BIN)
+	(cd $(XORG_BUILD_DIR)/hw/vnc \
+	 &&  $(BUILD_ENV) $(MAKE) $(MFLAGS) -e install \
+	 DESTDIR=$(PROTODIR) CPPROG="cp -p" )
+	mkdir -p $(PROTODIR)/usr/bin \
+		$(PROTODIR)/usr/share/man/man1 \
+		$(PROTODIR)$(X11_MAN_DIR)/man/man1 \
+		$(PROTODIR)/usr/share/vnc \
+		$(PROTODIR)/var/svc/manifest/application/x11 
+	cp -pf $(SOURCE_DIR)/unix/vncserver \
+		$(SOURCE_DIR)/unix/vncpasswd/vncpasswd \
+		$(SOURCE_DIR)/unix/vncconfig/vncconfig \
+		$(PROTODIR)/usr/bin
+	cp -pf $(SOURCE_DIR)/unix/vncserver.man \
+		$(PROTODIR)/usr/share/man/man1/vncserver.1
+	cp -pf $(SOURCE_DIR)/unix/vncconfig/vncconfig.man \
+		$(PROTODIR)/usr/share/man/man1/vncconfig.1
+	cp -pf $(SOURCE_DIR)/unix/vncpasswd/vncpasswd.man \
+		$(PROTODIR)/usr/share/man/man1/vncpasswd.1
+	cp -pf $(SOURCE_DIR)/common/javabin/index.vnc \
+		$(PROTODIR)/usr/share/vnc
+	cp -pf $(XORG_BUILD_DIR)/hw/vnc/Xvnc.man \
+		$(PROTODIR)$(X11_MAN_DIR)/man1/Xvnc.1
+	cp -pf xvnc-inetd.xml $(PROTODIR)/var/svc/manifest/application/x11/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/build-without-Xorg.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,53 @@
+--- unix/xorg-x11-server-source/configure.ac~	2007-09-19 14:00:02.330977000 -0700
++++ unix/xorg-x11-server-source/configure.ac	2007-09-19 14:16:41.522248000 -0700
+@@ -1121,7 +1121,7 @@
+ xorg_bus_sparcpci=no
+ xorg_bus_sparc=no
+ 
+-if test "x$XORG" = xyes -o "x$XGL" = xyes; then
++if test "xyes" = xyes -o "x$XGL" = xyes; then
+ 	XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
+ 	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
+ 	XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
+
+
+--- unix/xorg-x11-server-source/Xext/Makefile.am~	2007-09-19 14:18:08.721581000 -0700
++++ unix/xorg-x11-server-source/Xext/Makefile.am	2007-09-19 14:36:05.327716000 -0700
+@@ -4,11 +4,7 @@
+ #                    Xorg by default
+ # libXextmodule.la:  includes those extensions that are built into a module
+ #                    that Xorg loads
+-if XORG
+ noinst_LTLIBRARIES = libXext.la libXextbuiltin.la libXextmodule.la
+-else
+-noinst_LTLIBRARIES = libXext.la
+-endif
+ 
+ INCLUDES = -I$(top_srcdir)/hw/xfree86/dixmods/extmod
+ 
+@@ -163,11 +159,9 @@
+ 
+ libXext_la_SOURCES =		$(BUILTIN_SRCS) $(MODULE_SRCS)
+ 
+-if XORG
+ libXextbuiltin_la_SOURCES =	$(BUILTIN_SRCS)
+ 
+ libXextmodule_la_SOURCES =	$(MODULE_SRCS)
+-endif
+ 
+ EXTRA_DIST = \
+ 	$(SERVERCONFIG_DATA) \
+
+--- unix/xorg-x11-server-source/hw/Makefile.am~	2007-09-19 13:17:07.009236000 -0700
++++ unix/xorg-x11-server-source/hw/Makefile.am	2007-09-19 13:57:41.224962000 -0700
+@@ -4,6 +4,8 @@
+ 
+ if XORG
+ XORG_SUBDIRS = xfree86
++else
++XORG_SUBDIRS = xfree86/os-support xfree86/common
+ endif
+ 
+ if XVFB
+
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/c++public.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,18 @@
+--- unix/xc/programs/Xserver/vnc/vncExtInit.cc	2006-05-15 09:56:20.000000000 -0700
++++ unix/xc/programs/Xserver/vnc/vncExtInit.cc	2007-06-26 18:11:37.123722000 -0700
+@@ -20,6 +20,7 @@
+ 
+ extern "C" {
+ #define class c_class
++#define public c_public    
+ #define NEED_EVENTS
+ #include "X.h"
+ #include "Xproto.h"
+@@ -34,6 +35,7 @@
+ #include "vncExt.h"
+ #undef class
+ #undef xalloc
++#undef public
+ }
+ 
+ #include <rfb/Configuration.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/solaris-port.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,203 @@
+--- common/rfb/Makefile.am	2007-06-27 19:05:47.368239000 -0700
++++ common/rfb/Makefile.am	2007-06-27 19:47:41.890789000 -0700
+@@ -130,8 +130,8 @@
+ 	ZRLEEncoder.cxx \
+ 	ZRLEEncoder.h
+ 
+-librfb_la_LIBADD = \
++librfb_la_LIBADD = -lsocket -lnsl \
+ 	$(top_srcdir)/network/libnetwork.la \
+ 	$(top_srcdir)/rdr/librdr.la \
+ 	$(top_srcdir)/Xregion/libXregion.la
+
+--- unix/vncviewer/Makefile.am	2007-06-29 10:08:32.097924000 -0700
++++ unix/vncviewer/Makefile.am	2007-06-29 10:43:37.891451000 -0700
+@@ -19,6 +19,8 @@
+ 	-I$(top_srcdir)/tx
+ 
+ vncviewer_LDADD = \
+-	$(top_srcdir)/../common/rfb/librfb.la \
+ 	$(top_srcdir)/tx/libtx.la \
+-	-lXext
++	$(top_srcdir)/../common/rfb/librfb.la \
++	$(top_srcdir)/../common/network/libnetwork.la \
++	$(top_srcdir)/../common/rdr/librdr.la \
++	-lXext -lX11 -lsocket -lnsl -lz
+
+--- unix/vncconfig/Makefile.am	2007-06-29 10:08:32.073422000 -0700
++++ unix/vncconfig/Makefile.am	2007-06-29 10:46:21.399874000 -0700
+@@ -13,5 +13,7 @@
+ 	-I$(top_srcdir)/tx
+ 
+ vncconfig_LDADD = \
++	$(top_srcdir)/tx/libtx.la \
+ 	$(top_srcdir)/../common/rfb/librfb.la \
+-	$(top_srcdir)/tx/libtx.la
++	$(top_srcdir)/../common/rdr/librdr.la \
++	-lX11
+
+--- unix/x0vncserver/Makefile.am~	2007-06-29 14:25:14.848138000 -0700
++++ unix/x0vncserver/Makefile.am	2007-06-29 16:29:44.949322000 -0700
+@@ -14,7 +14,10 @@
+ 	-I$(top_srcdir)/tx
+ 
+ x0vncserver_LDADD = \
+-	$(top_srcdir)/../common/rfb/librfb.la \
+ 	$(top_srcdir)/tx/libtx.la \
++	$(top_srcdir)/../common/rfb/librfb.la \
++	$(top_srcdir)/../common/network/libnetwork.la \
++	$(top_srcdir)/../common/rdr/librdr.la \
++	-lX11 -lsocket -lnsl -lz \
+ 	-lXext \
+ 	-lXtst
+
+
+--- unix/xorg-x11-server-source/hw/Makefile.am~	2007-09-19 13:17:07.009236000 -0700
++++ unix/xorg-x11-server-source/hw/Makefile.am	2007-09-19 13:57:41.224962000 -0700
+@@ -6,6 +6,15 @@
+ XORG_SUBDIRS = xfree86
+ else
+ XORG_SUBDIRS = xfree86/os-support xfree86/common
++
++# Needs to be built before any files are compiled when using Sun compilers
++# so in*/out* inline definitions are properly processed.
++
++BUILT_SOURCES = xfree86/os-support/solaris/solaris-@[email protected]
++
++xfree86/os-support/solaris/solaris-@[email protected]:
++	cd xfree86/os-support/solaris ; make solaris-@[email protected]
++
+ endif
+ 
+ if XVFB
+
+--- unix/xorg-x11-server-source/hw/vnc/Makefile.am~	2007-09-19 16:36:35.755205000 -0700
++++ unix/xorg-x11-server-source/hw/vnc/Makefile.am	2007-09-19 16:40:43.150927000 -0700
+@@ -26,10 +26,25 @@
+ 		$(top_srcdir)/mi/miinitext.c \
+ 		$(top_srcdir)/fb/fbcmap.c
+ 
++if MMX_CAPABLE
++FBMMX_LIBS = ../../fb/libfbmmx.la
++endif
++
++if BUILD_TSOL_MODULE
++TSOL_LIBS = 	../../tsol/libxtsol.la -ltsol -ltsnet -lsecdb -lbsm
++endif
++
++if GLX
++GLX_LIBS = 	-lGLcore
++endif
++
+ Xvnc_LDADD =	$(XORG_CORE_LIBS) \
+ 		$(XORG_LIBS) \
+ 		$(XSERVER_LIBS) \
+ 		../../fb/libfb.la \
++		$(FBMMX_LIBS) \
++		../../IA/libIA.la \
++		$(TSOL_LIBS) \
+ 		../../mi/libminimi.la \
+ 		../../render/librender.la \
+ 		../../xkb/libxkbstubs.la \
+@@ -42,7 +46,12 @@
+ 		../xfree86/common/libcommon.la \
+ 		-lX11 \
+ 		libvnccommon.la \
+-		../../../../common/rfb/librfb.la
++		../../../../common/rfb/librfb.la \
++		../../../../common/network/libnetwork.la \
++		../../../../common/rdr/librdr.la \
++		../../../../common/Xregion/libXregion.la \
++		-lz \
++		$(GLX_LIBS)
+ 
+ Xvnc_CFLAGS =  -DHAVE_DIX_CONFIG_H \
+ 		-DNO_HW_ONLY_EXTS \
+
+--- unix/xc/programs/Xserver/Xvnc.man	2007-10-08 21:26:03.141427000 -0700
++++ unix/xc/programs/Xserver/Xvnc.man	2007-10-09 11:37:23.168899000 -0700
+@@ -68,8 +68,7 @@
+ 
+ .SH PARAMETERS
+ VNC parameters can be set both via the command-line and through the
+-\fBvncconfig\fP(1) program, and with a VNC-enabled XFree86 server via Options
+-entries in the XF86Config file.
++\fBvncconfig\fP(1) program.
+ 
+ Parameters can be turned on with -\fIparam\fP or off with
+ -\fIparam\fP=0.  Parameters which take a value can be specified as
+@@ -222,12 +221,12 @@
+ RemapKeys=0x22<>0x40
+ 
+ .SH USAGE WITH INETD
+-By configuring the \fBinetd\fP(1) service appropriately, Xvnc can be launched
++By configuring the \fBinetd\fP(1M) service appropriately, Xvnc can be launched
+ on demand when a connection comes in, rather than having to be started
+ manually.  When given the \fB-inetd\fP option, instead of listening for TCP
+ connections on a given port it uses its standard input and standard output.
+ There are two modes controlled by the wait/nowait entry in the inetd.conf file.
+-
++.PP
+ In the nowait mode, Xvnc uses its standard input and output directly as the
+ connection to a viewer.  It never has a listening socket, so cannot accept
+ further connections from viewers (it can however connect out to listening
+@@ -235,17 +234,28 @@
+ same TCP port result in inetd spawning off a new Xvnc to deal with each
+ connection.  When the connection to the viewer dies, the Xvnc and any
+ associated X clients die.  This behaviour is most useful when combined with the
+-XDMCP options -query and -once.  An typical example in inetd.conf might be (all
+-on one line):
+-
+-5950   stream   tcp nowait nobody  /usr/local/bin/Xvnc Xvnc -inetd -query
+-localhost -once securitytypes=none
+-
+-In this example a viewer connection to :50 will result in a new Xvnc for that
+-connection which should display the standard XDM login screen on that machine.
+-Because the user needs to login via XDM, it is usually OK to accept connections
+-without a VNC password in this case.
+-
++XDMCP options -query and -once.  
++.PP
++The provided application/x11/xvnc-inetd service defaults to running
++
++.B "/usr/X11/bin/Xvnc -inetd -query localhost -once securitytypes=none"
++
++in nowait mode.   This service can be enabled via 
++.BR svcadm (1m),
++and configured to use other modes or arguments via
++.BR svccfg (1m).
++.PP
++In this configuration, connecting to :0 will result in a new Xvnc for that
++connection which should display the standard graphical login screen on that 
++machine.   (To enable this, you will also have to enable XDMCP network 
++connections on the login screen.   See 
++.BR dtlogin (1)
++or 
++.BR gdm (1)
++for details.)
++Because the user needs to login via this screen, it is usually OK to accept 
++connections without a VNC password in this case.
++.PP
+ In the wait mode, when the first connection comes in, inetd gives the listening
+ socket to Xvnc.  This means that for a given TCP port, there is only ever one
+ Xvnc at a time.  Further viewer connections to the same port are accepted by
+@@ -253,14 +263,14 @@
+ the Xvnc will continue to run.  If this is used with the XDMCP options -query
+ and -once, the Xvnc and associated X clients will die when the user logs out of
+ the X session in the normal way.  It is important to use a VNC password in this
+-case.  A typical entry in inetd.conf might be:
+-
+-5951   stream   tcp wait   james     /usr/local/bin/Xvnc Xvnc -inetd -query localhost -once passwordFile=/home/james/.vnc/passwd
++case.  A typical command line to include in the service exec property might be:
+ 
++.B "/usr/local/bin/Xvnc Xvnc -inetd -query localhost -once passwordFile=/home/james/.vnc/passwd"
++.PP
+ In fact typically, you would have one entry for each user who uses VNC
+ regularly, each of whom has their own dedicated TCP port which they use.  In
+-this example, when user "james" connects to :51, he enters his VNC password,
+-then gets the XDM login screen where he logs in in the normal way.  However,
++this example, when user "james" connects, he enters his VNC password,
++then gets the login screen where he logs in in the normal way.  However,
+ unlike the previous example, if he disconnects, the session remains persistent,
+ and when he reconnects he will get the same session back again.  When he logs
+ out of the X session, the Xvnc will die, but of course a new one will be
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-24bit.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,44 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-render.patch
+
+--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.24bit	2007-06-07 17:27:46.000000000 +0200
++++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2007-06-07 17:29:01.000000000 +0200
+@@ -762,7 +762,7 @@ static Bool vfbScreenInit(int index, Scr
+ 
+   miSetPixmapDepths();
+ 
+-  switch (pvfb->bitsPerPixel)
++  switch (pvfb->depth)
+   {
+   case 8:
+       miSetVisualTypesAndMasks (8, 1 << PseudoColor, 8, PseudoColor, 0, 0, 0);
+@@ -771,6 +771,9 @@ static Bool vfbScreenInit(int index, Scr
+   case 16:
+         miSetVisualTypesAndMasks (16, 1 << TrueColor, 8, TrueColor, 0xf800, 0x07e0, 0x001f);
+     break;
++  case 24:
++	miSetVisualTypesAndMasks (24, 1 << TrueColor, 8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff);
++    break;
+   case 32:
+         miSetVisualTypesAndMasks (32, 1 << TrueColor , 8, TrueColor, 0xff000000, 0x00ff0000, 0x0000ff00);
+     break;
+@@ -778,15 +781,17 @@ static Bool vfbScreenInit(int index, Scr
+     return FALSE;
+   }
+ 
+-  if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+-                    dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
+-      return FALSE;
++  ret =fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
++                    dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel);
+ 
+ #ifdef RENDER
+   if (ret && Render)
+       fbPictureInit(pScreen, 0, 0);
+ #endif /* RENDER */
+ 
++  if (!ret)
++      return FALSE;
++
+   pScreen->InstallColormap = vfbInstallColormap;
+   pScreen->UninstallColormap = vfbUninstallColormap;
+   pScreen->ListInstalledColormaps = vfbListInstalledColormaps;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-64bit.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,41 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-64bit.patch
+
+--- vnc-4_1_1-unixsrc/unix/xc/programs/Xserver/vnc/XserverDesktop.h.64bit	2005-03-11 15:08:41.000000000 +0000
++++ vnc-4_1_1-unixsrc/unix/xc/programs/Xserver/vnc/XserverDesktop.h	2005-12-06 14:31:11.000000000 +0000
+@@ -29,6 +29,8 @@
+ #include <rfb/VNCServerST.h>
+ #include <rdr/SubstitutingInStream.h>
+ 
++#include "xorg-server.h"
++
+ extern "C" {
+ #define class c_class;
+ #include <scrnintstr.h>
+--- vnc-4_1_1-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.64bit	2005-12-06 14:31:24.000000000 +0000
++++ vnc-4_1_1-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2005-12-06 14:31:30.000000000 +0000
+@@ -973,25 +973,6 @@
+ 
+ } /* end InitOutput */
+ 
+-#ifdef DPMSExtension
+-extern "C" {
+-#if NeedFunctionPrototypes
+-  void DPMSSet(CARD16 level)
+-#else
+-    void DPMSSet(level)
+-    CARD16 level;
+-#endif
+-  {
+-    return;
+-  }
+-
+-  Bool DPMSSupported()
+-  {
+-    return FALSE;
+-  }
+-}
+-#endif
+-
+ /* this is just to get the server to link on AIX */
+ #ifdef AIXV3
+ int SelectWaitTime = 10000; /* usec */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-always_use_fb.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,212 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-always_use_fb.patch
+
+--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.always_use_fb	2007-03-05 14:03:21.000000000 +0100
++++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2007-03-05 14:10:57.000000000 +0100
+@@ -33,27 +33,28 @@
+ #include <network/TcpSocket.h>
+ #include "vncExtInit.h"
+ 
++#ifdef HAVE_DIX_CONFIG_H
++#include <dix-config.h>
++#endif
++
+ extern "C" {
+ #define class c_class
+ #define public c_public
++#define new c_new
+ #ifdef WIN32
+ #include <X11/Xwinsock.h>
+ #endif
+ #include <stdio.h>
+-#include "X11/X.h"
++#include <X11/X.h>
+ #define NEED_EVENTS
+-#include "X11/Xproto.h"
+-#include "X11/Xos.h"
++#include <X11/Xproto.h>
++#include <X11/Xos.h>
+ #include "scrnintstr.h"
+ #include "servermd.h"
+-#ifdef VNC_USE_FB
+ #include "fb.h"
+-#else
+-#define PSZ 8
+-#include "cfb.h"
+-#endif
+ #include "mi.h"
+-#include "mibstore.h"
++#include "micmap.h"
++#include "miline.h"
+ #include "colormapst.h"
+ #include "gcstruct.h"
+ #include "input.h"
+@@ -66,24 +67,12 @@
+ #endif
+ #include <X11/XWDFile.h>
+ #include "dix.h"
+-#include "miline.h"
+ #include "inputstr.h"
+ #include "keysym.h"
+   extern int defaultColorVisualClass;
++#undef new
+ #undef class
+ #undef public
+-#ifndef VNC_USE_FB
+-  extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
+-  extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
+-  extern Bool cfb16CreateGC(GCPtr);
+-  extern Bool cfb32CreateGC(GCPtr);
+-  extern void cfb16GetSpans(DrawablePtr, int, DDXPointPtr, int*, int, char*);
+-  extern void cfb32GetSpans(DrawablePtr, int, DDXPointPtr, int*, int, char*);
+-  extern void cfb16GetImage(DrawablePtr, int, int, int, int, unsigned int,
+-                            unsigned long, char*);
+-  extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int,
+-                            unsigned long, char*);
+-#endif
+ }
+ 
+ #define XVNCVERSION "Free Edition 4.1.2"
+@@ -502,67 +491,6 @@
+ }
+ #endif
+ 
+-#ifndef VNC_USE_FB
+-static Bool vfbMultiDepthCreateGC(GCPtr   pGC)
+-{
+-  switch (vfbBitsPerPixel(pGC->depth))
+-  {
+-  case 1:  return mfbCreateGC (pGC);
+-  case 8:  return cfbCreateGC (pGC);
+-  case 16: return cfb16CreateGC (pGC);
+-  case 32: return cfb32CreateGC (pGC);
+-  default: return FALSE;
+-  }
+-}
+-
+-static void vfbMultiDepthGetSpans(
+-                                  DrawablePtr		pDrawable,	/* drawable from which to get bits */
+-                                  int			wMax,		/* largest value of all *pwidths */
+-                                  register DDXPointPtr ppt,		/* points to start copying from */
+-                                  int			*pwidth,	/* list of number of bits to copy */
+-                                  int			nspans,		/* number of scanlines to copy */
+-                                  char		*pdstStart)	/* where to put the bits */
+-{
+-  switch (pDrawable->bitsPerPixel) {
+-  case 1:
+-    mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+-    break;
+-  case 8:
+-    cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+-    break;
+-  case 16:
+-    cfb16GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+-    break;
+-  case 32:
+-    cfb32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+-    break;
+-  }
+-  return;
+-}
+-
+-static void
+-vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+-                      unsigned int format, unsigned long planeMask,
+-                      char *pdstLine)
+-{
+-  switch (pDrawable->bitsPerPixel)
+-  {
+-  case 1:
+-    mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+-    break;
+-  case 8:
+-    cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+-    break;
+-  case 16:
+-    cfb16GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+-    break;
+-  case 32:
+-    cfb32GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
+-    break;
+-  }
+-}
+-#endif
+-
+ static ColormapPtr InstalledMaps[MAXSCREENS];
+ 
+ static int vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
+@@ -832,44 +760,32 @@
+   defaultColorVisualClass
+     = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor;
+ 
+-#ifdef VNC_USE_FB
+-  if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+-                    dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
+-      return FALSE;
++  miSetPixmapDepths();
+ 
+-#ifdef RENDER
+-  if (ret && Render)
+-      fbPictureInit(pScreen, 0, 0);
+-#endif /* RENDER */
+-#else /* VNC_USE_FB */
+   switch (pvfb->bitsPerPixel)
+   {
+-  case 1:
+-    ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+-                        dpi, dpi, pvfb->paddedWidth);
+-    break;
+   case 8:
+-    ret = cfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+-                        dpi, dpi, pvfb->paddedWidth);
++      miSetVisualTypesAndMasks (8, 1 << PseudoColor, 8, PseudoColor, 0, 0, 0);
++
+     break;
+   case 16:
+-    ret = cfb16ScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+-                          dpi, dpi, pvfb->paddedWidth);
++        miSetVisualTypesAndMasks (16, 1 << TrueColor, 8, TrueColor, 0xf800, 0x07e0, 0x001f);
+     break;
+   case 32:
+-    ret = cfb32ScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+-                          dpi, dpi, pvfb->paddedWidth);
++        miSetVisualTypesAndMasks (32, 1 << TrueColor , 8, TrueColor, 0xff000000, 0x00ff0000, 0x0000ff00);
+     break;
+   default:
+     return FALSE;
+   }
+ 
+-  if (!ret) return FALSE;
++  if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
++                    dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
++      return FALSE;
+ 
+-  pScreen->CreateGC = vfbMultiDepthCreateGC;
+-  pScreen->GetImage = vfbMultiDepthGetImage;
+-  pScreen->GetSpans = vfbMultiDepthGetSpans;
+-#endif
++#ifdef RENDER
++  if (ret && Render)
++      fbPictureInit(pScreen, 0, 0);
++#endif /* RENDER */
+ 
+   pScreen->InstallColormap = vfbInstallColormap;
+   pScreen->UninstallColormap = vfbUninstallColormap;
+@@ -915,18 +831,7 @@
+     }
+   }
+ 
+-#ifdef VNC_USE_FB
+   ret = fbCreateDefColormap(pScreen);
+-#else
+-  if (pvfb->bitsPerPixel == 1)
+-  {
+-    ret = mfbCreateDefColormap(pScreen);
+-  }
+-  else
+-  {
+-    ret = cfbCreateDefColormap(pScreen);
+-  }
+-#endif
+ 
+   miSetZeroLineBias(pScreen, pvfb->lineBias);
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-autotools-compile.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,13 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-autotools-compile.patch
+
+--- vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.autotools-compile	2007-02-15 18:56:52.000000000 +0100
++++ vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx	2007-02-15 18:57:21.000000000 +0100
+@@ -42,7 +42,7 @@
+ #include <rfb/LogWriter.h>
+ 
+ #ifndef VNC_SOCKLEN_T
+-#define VNC_SOCKLEN_T int
++#define VNC_SOCKLEN_T socklen_t
+ #endif
+ 
+ #ifndef INADDR_NONE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-autotools.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,446 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-autotools.patch
+
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/common/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,5 @@
++SUBDIRS = \
++	rdr \
++	network \
++	Xregion \
++	rfb
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/common/rfb/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,136 @@
++lib_LTLIBRARIES = librfb.la
++
++librfb_la_SOURCES = \
++	Blacklist.cxx \
++	Blacklist.h \
++	CConnection.cxx \
++	CConnection.h \
++	CMsgHandler.cxx \
++	CMsgHandler.h \
++	CMsgReader.cxx \
++	CMsgReader.h \
++	CMsgReaderV3.cxx \
++	CMsgReaderV3.h \
++	CMsgWriter.cxx \
++	CMsgWriter.h \
++	CMsgWriterV3.cxx \
++	CMsgWriterV3.h \
++	ColourCube.h \
++	ColourMap.h \
++	ComparingUpdateTracker.cxx \
++	ComparingUpdateTracker.h \
++	Configuration.cxx \
++	Configuration.h \
++	ConnParams.cxx \
++	ConnParams.h \
++	CSecurity.h \
++	CSecurityNone.h \
++	CSecurityVncAuth.cxx \
++	CSecurityVncAuth.h \
++	Cursor.cxx \
++	Cursor.h \
++	Decoder.cxx \
++	Decoder.h \
++	d3des.c \
++	d3des.h \
++	Encoder.cxx \
++	Encoder.h \
++	encodings.cxx \
++	encodings.h \
++	Exception.h \
++	hextileConstants.h \
++	hextileDecode.h \
++	HextileDecoder.cxx \
++	HextileDecoder.h \
++	hextileEncode.h \
++	HextileEncoder.cxx \
++	HextileEncoder.h \
++	Hostname.h \
++	HTTPServer.cxx \
++	HTTPServer.h \
++	ImageGetter.h \
++	InputHandler.h \
++	KeyRemapper.cxx \
++	KeyRemapper.h \
++	keysymdef.h \
++	Logger.cxx \
++	Logger_file.cxx \
++	Logger_file.h \
++	Logger.h \
++	Logger_stdio.cxx \
++	Logger_stdio.h \
++	LogWriter.cxx \
++	LogWriter.h \
++	msgTypes.h \
++	Password.cxx \
++	Password.h \
++	PixelBuffer.cxx \
++	PixelBuffer.h \
++	PixelFormat.cxx \
++	PixelFormat.h \
++	Pixel.h \
++	RawDecoder.cxx \
++	RawDecoder.h \
++	RawEncoder.cxx \
++	RawEncoder.h \
++	Rect.h \
++	Region.cxx \
++	Region.h \
++	rreDecode.h \
++	RREDecoder.cxx \
++	RREDecoder.h \
++	rreEncode.h \
++	RREEncoder.cxx \
++	RREEncoder.h \
++	SConnection.cxx \
++	SConnection.h \
++	SDesktop.h \
++	secTypes.cxx \
++	secTypes.h \
++	ServerCore.cxx \
++	ServerCore.h \
++	SMsgHandler.cxx \
++	SMsgHandler.h \
++	SMsgReader.cxx \
++	SMsgReader.h \
++	SMsgReaderV3.cxx \
++	SMsgReaderV3.h \
++	SMsgWriter.cxx \
++	SMsgWriter.h \
++	SMsgWriterV3.cxx \
++	SMsgWriterV3.h \
++	SSecurityFactoryStandard.cxx \
++	SSecurityFactoryStandard.h \
++	SSecurity.h \
++	SSecurityNone.h \
++	SSecurityVncAuth.cxx \
++	SSecurityVncAuth.h \
++	Threading.h \
++	Timer.cxx \
++	Timer.h \
++	TransImageGetter.cxx \
++	TransImageGetter.h \
++	transInitTempl.h \
++	transTempl.h \
++	TrueColourMap.h \
++	UpdateTracker.cxx \
++	UpdateTracker.h \
++	UserPasswdGetter.h \
++	util.cxx \
++	util.h \
++	VNCSConnectionST.cxx \
++	VNCSConnectionST.h \
++	VNCServer.h \
++	VNCServerST.cxx \
++	VNCServerST.h \
++	zrleDecode.h \
++	ZRLEDecoder.cxx \
++	ZRLEDecoder.h \
++	zrleEncode.h \
++	ZRLEEncoder.cxx \
++	ZRLEEncoder.h
++
++librfb_la_LIBADD = \
++	$(top_srcdir)/network/libnetwork.la \
++	$(top_srcdir)/rdr/librdr.la \
++	$(top_srcdir)/Xregion/libXregion.la
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/common/rdr/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,30 @@
++noinst_LTLIBRARIES = librdr.la
++
++librdr_la_SOURCES = \
++	Exception.cxx \
++	FdInStream.h \
++	FixedMemOutStream.h \
++	HexOutStream.cxx \
++	InStream.h \
++	OutStream.h \
++	SubstitutingInStream.h \
++	ZlibInStream.h \
++	Exception.h \
++	FdOutStream.cxx \
++	HexInStream.cxx \
++	HexOutStream.h \
++	MemInStream.h \
++	RandomStream.cxx \
++	types.h \
++	ZlibOutStream.cxx \
++	FdInStream.cxx \
++	FdOutStream.h \
++	HexInStream.h \
++	InStream.cxx \
++	MemOutStream.h \
++	RandomStream.h \
++	ZlibInStream.cxx \
++	ZlibOutStream.h
++
++librdr_la_LIBADD = \
++	-lz
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/common/configure.ac	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,42 @@
++#                                               -*- Autoconf -*-
++# Process this file with autoconf to produce a configure script.
++
++AC_PREREQ(2.61)
++AC_INIT([vnc-libs], 4.1.2, [bugzilla.redhat.com])
++AC_CONFIG_HEADER([config.h])
++AM_INIT_AUTOMAKE([-Wall -Werror foreign])
++
++# Checks for programs.
++AC_PROG_CXX
++AC_PROG_CC
++AC_PROG_LIBTOOL
++
++# Checks for libraries.
++
++# Checks for header files.
++AC_HEADER_STDC
++AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h unistd.h])
++
++# Checks for typedefs, structures, and compiler characteristics.
++AC_HEADER_STDBOOL
++AC_C_CONST
++AC_C_INLINE
++AC_TYPE_SIZE_T
++AC_HEADER_TIME
++AC_STRUCT_TM
++
++# Checks for library functions.
++AC_FUNC_ERROR_AT_LINE
++AC_FUNC_MEMCMP
++AC_FUNC_SELECT_ARGTYPES
++AC_TYPE_SIGNAL
++AC_FUNC_STRFTIME
++AC_FUNC_VPRINTF
++AC_CHECK_FUNCS([ftime gethostbyname getpass gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strncasecmp])
++
++AC_CONFIG_FILES([Makefile
++                 Xregion/Makefile
++                 network/Makefile
++                 rdr/Makefile
++                 rfb/Makefile])
++AC_OUTPUT
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/common/Xregion/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,6 @@
++noinst_LTLIBRARIES = libXregion.la
++
++libXregion_la_SOURCES = \
++	Region.c \
++	region.h \
++	Xregion.h
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/common/network/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,6 @@
++noinst_LTLIBRARIES = libnetwork.la
++
++libnetwork_la_SOURCES = \
++	Socket.h \
++	TcpSocket.cxx \
++	TcpSocket.h
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,6 @@
++SUBDIRS = \
++	tx \
++	vncpasswd \
++	vncviewer \
++	vncconfig \
++	x0vncserver
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/tx/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,25 @@
++noinst_LTLIBRARIES = libtx.la
++
++libtx_la_SOURCES = \
++	TXButton.h \
++	TXDialog.h \
++	TXEntry.h \
++	TXCheckbox.h \
++	TXImage.cxx \
++	TXImage.h \
++	TXLabel.h \
++	TXMenu.cxx \
++	TXMenu.h \
++	TXMsgBox.h \
++	TXScrollbar.cxx \
++	TXScrollbar.h \
++	TXViewport.cxx \
++	TXViewport.h \
++	TXWindow.cxx \
++	TXWindow.h
++
++AM_CPPFLAGS = \
++	-I$(top_srcdir)/../common/
++
++libtx_la_LIBADD = \
++	-lX11
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/vncpasswd/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,10 @@
++bin_PROGRAMS = vncpasswd
++
++vncpasswd_SOURCES = \
++	vncpasswd.cxx
++
++AM_CPPFLAGS = \
++	-I$(top_srcdir)/../common
++
++vncpasswd_LDADD = \
++	$(top_srcdir)/../common/rfb/librfb.la
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/vncconfig/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,17 @@
++bin_PROGRAMS = vncconfig
++
++vncconfig_SOURCES = \
++	buildtime.c \
++	QueryConnectDialog.cxx \
++	QueryConnectDialog.h \
++	vncconfig.cxx \
++	vncExt.c \
++	vncExt.h
++
++AM_CPPFLAGS = \
++	-I$(top_srcdir)/../common \
++	-I$(top_srcdir)/tx
++
++vncconfig_LDADD = \
++	$(top_srcdir)/../common/rfb/librfb.la \
++	$(top_srcdir)/tx/libtx.la
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/configure.ac	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,52 @@
++#                                               -*- Autoconf -*-
++# Process this file with autoconf to produce a configure script.
++
++AC_PREREQ(2.61)
++AC_INIT([vnc], 4.1.2, [bugzilla.redhat.com])
++AC_CONFIG_SRCDIR([x0vncserver/buildtime.c])
++AC_CONFIG_HEADER([config.h])
++AM_INIT_AUTOMAKE([-Wall -Werror foreign])
++
++# Checks for programs.
++AC_PROG_CXX
++AC_PROG_CC
++AC_PROG_LIBTOOL
++
++# Checks for libraries.
++
++# Checks for header files.
++AC_PATH_X
++AC_HEADER_STDC
++AC_HEADER_SYS_WAIT
++AC_CHECK_HEADERS([fcntl.h stdlib.h string.h strings.h sys/time.h termios.h unistd.h])
++
++# Checks for typedefs, structures, and compiler characteristics.
++AC_HEADER_STDBOOL
++AC_C_CONST
++AC_C_INLINE
++AC_C_RESTRICT
++AC_TYPE_SIZE_T
++AC_HEADER_TIME
++
++# Checks for library functions.
++AC_FUNC_ERROR_AT_LINE
++AC_FUNC_FORK
++AC_FUNC_LSTAT
++AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
++AC_FUNC_MALLOC
++AC_FUNC_MEMCMP
++AC_FUNC_REALLOC
++AC_FUNC_SELECT_ARGTYPES
++AC_TYPE_SIGNAL
++AC_FUNC_STAT
++AC_FUNC_VPRINTF
++AC_FUNC_WAIT3
++AC_CHECK_FUNCS([memset mkdir select setenv strchr strdup strerror strspn strtol])
++
++AC_CONFIG_FILES([Makefile
++                 tx/Makefile
++                 vncconfig/Makefile
++                 vncpasswd/Makefile
++                 vncviewer/Makefile
++                 x0vncserver/Makefile])
++AC_OUTPUT
+--- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/Makefile.am.autotools	2007-02-16 09:52:43.000000000 +0100
++++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/Makefile.am	2007-02-16 09:53:24.000000000 +0100
+@@ -42,10 +42,7 @@
+ 		../xfree86/common/libcommon.la \
+ 		-lX11 \
+ 		libvnccommon.la \
+-		../../../../common/rfb/librfb.a \
+-		../../../../common/rdr/librdr.a \
+-		../../../../common/network/libnetwork.a \
+-		../../../../common/Xregion/libXregion.a
++		../../../../common/rfb/librfb.la
+ 
+ Xvnc_CFLAGS =  -DHAVE_DIX_CONFIG_H \
+ 		-DNO_HW_ONLY_EXTS \
+@@ -68,10 +65,7 @@
+ libvnc_la_SOURCES = xf86vncModule.cc
+ libvnc_la_LIBADD = \
+ 		libvnccommon.la \
+-		../../../../common/rfb/librfb.a \
+-		../../../../common/rdr/librdr.a \
+-		../../../../common/network/libnetwork.a \
+-		../../../../common/Xregion/libXregion.a
++		../../../../common/rfb/librfb.la
+ libvnc_la_CXXFLAGS = \
+ 		-I../../../../common \
+ 		-I$(top_srcdir)/hw/xfree86/common \
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/vncviewer/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,24 @@
++bin_PROGRAMS = vncviewer
++
++vncviewer_SOURCES = \
++	AboutDialog.h \
++	buildtime.c \
++	CConn.cxx \
++	CConn.h \
++	DesktopWindow.cxx \
++	DesktopWindow.h \
++	InfoDialog.h \
++	OptionsDialog.h \
++	parameters.h \
++	PasswdDialog.h \
++	ServerDialog.h \
++	vncviewer.cxx
++
++AM_CPPFLAGS = \
++	-I$(top_srcdir)/../common \
++	-I$(top_srcdir)/tx
++
++vncviewer_LDADD = \
++	$(top_srcdir)/../common/rfb/librfb.la \
++	$(top_srcdir)/tx/libtx.la \
++	-lXext
+--- /dev/null	2007-02-16 09:39:42.585819347 +0100
++++ vnc-4_1_2-unixsrc/unix/x0vncserver/Makefile.am	2007-02-16 09:51:11.000000000 +0100
+@@ -0,0 +1,20 @@
++bin_PROGRAMS = x0vncserver
++
++x0vncserver_SOURCES = \
++	buildtime.c \
++	Image.cxx \
++	Image.h \
++	x0vncserver.cxx \
++	$(top_srcdir)/vncconfig/QueryConnectDialog.h \
++	$(top_srcdir)/vncconfig/QueryConnectDialog.cxx
++
++AM_CPPFLAGS = \
++	-I$(top_srcdir)/../common \
++	-I$(top_srcdir)/vncconfig \
++	-I$(top_srcdir)/tx
++
++x0vncserver_LDADD = \
++	$(top_srcdir)/../common/rfb/librfb.la \
++	$(top_srcdir)/tx/libtx.la \
++	-lXext \
++	-lXtst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-int10.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,14 @@
+## Subset of patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-s390.patch
+
+--- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/xfree86/int10/Makefile.am.s390	2007-06-06 15:00:23.000000000 +0200
++++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/xfree86/int10/Makefile.am	2007-06-06 15:00:26.000000000 +0200
+@@ -38,7 +38,8 @@ libint10_la_SOURCES = \
+ endif
+ 
+ if INT10_STUB
+-AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(XORG_CFLAGS) $(EXTRA_CFLAGS)
++AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(XORG_CFLAGS) $(EXTRA_CFLAGS) \
++	-I../common -I../os-support -I../os-support/bus
+ libint10_la_SOURCES = stub.c xf86int10module.c
+ endif
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-ipv6.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,69 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-210617.patch
+
+--- vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.ipv6	2006-10-13 11:31:37.000000000 +0100
++++ vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx	2006-10-13 12:05:40.000000000 +0100
+@@ -106,11 +106,29 @@
+ TcpSocket::TcpSocket(const char *host, int port)
+   : closeFd(true)
+ {
++  struct sockaddr_storage addr;
++  size_t addrlen;
++  struct addrinfo *hostai;
+   int sock;
+ 
+-  // - Create a socket
+   initSockets();
+-  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
++
++  if (getaddrinfo(host, NULL, NULL, &hostai)) {
++    int e = errorNumber;
++    throw SocketException("unable to resolve host by name", e);
++  }
++
++  addrlen = hostai->ai_addrlen;
++  memset(&addr, 0, sizeof(addr));
++  memcpy(&addr, hostai->ai_addr, addrlen);
++  freeaddrinfo(hostai);
++  if (addr.ss_family == AF_INET)
++    ((struct sockaddr_in *)&addr)->sin_port = htons(port);
++  else if (addr.ss_family == AF_INET6)
++    ((struct sockaddr_in6 *)&addr)->sin6_port = htons(port);
++
++  // - Create a socket
++  if ((sock = socket(addr.ss_family, SOCK_STREAM, 0)) < 0)
+     throw SocketException("unable to create socket", errorNumber);
+ 
+ #ifndef WIN32
+@@ -118,30 +136,9 @@
+   fcntl(sock, F_SETFD, FD_CLOEXEC);
+ #endif
+ 
+-  // - Connect it to something
+-
+-  // Try processing the host as an IP address
+-  struct sockaddr_in addr;
+-  memset(&addr, 0, sizeof(addr));
+-  addr.sin_family = AF_INET;
+-  addr.sin_addr.s_addr = inet_addr(host);
+-  addr.sin_port = htons(port);
+-  if ((int)addr.sin_addr.s_addr == -1) {
+-    // Host was not an IP address - try resolving as DNS name
+-    struct hostent *hostinfo;
+-    hostinfo = gethostbyname(host);
+-    if (hostinfo && hostinfo->h_addr) {
+-      addr.sin_addr.s_addr = ((struct in_addr *)hostinfo->h_addr)->s_addr;
+-    } else {
+-      int e = errorNumber;
+-      closesocket(sock);
+-      throw SocketException("unable to resolve host by name", e);
+-    }
+-  }
+-
+   // Attempt to connect to the remote host
+   for (;;) {
+-    if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
++    if (connect(sock, (struct sockaddr *)&addr, addrlen) != 0) {
+       int e = errorNumber;
+       if (e == EINTR)
+         continue;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-modular-xorg.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,182 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-modular-xorg.patch
+
+--- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/mi/miinitext.c.modular-xorg	2007-03-02 15:45:37.000000000 +0100
++++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/mi/miinitext.c	2007-03-02 15:45:38.000000000 +0100
+@@ -283,6 +283,9 @@
+ #ifdef MITMISC
+ extern void MITMiscExtensionInit(INITARGS);
+ #endif
++#ifdef VNCEXT
++extern void vncExtensionInit(INITARGS);
++#endif
+ #ifdef XIDLE
+ extern void XIdleExtensionInit(INITARGS);
+ #endif
+@@ -561,6 +564,9 @@
+ #ifdef MITMISC
+     if (!noMITMiscExtension) MITMiscExtensionInit();
+ #endif
++#ifdef VNCEXT
++    vncExtensionInit();
++#endif
+ #ifdef XIDLE
+     if (!noXIdleExtension) XIdleExtensionInit();
+ #endif
+--- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/Makefile.am.modular-xorg	2007-03-02 15:45:38.000000000 +0100
++++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/Makefile.am	2007-03-02 15:47:10.000000000 +0100
+@@ -30,6 +30,8 @@
+ XPRINT_SUBDIRS = xprint
+ endif
+ 
++XVNC_SUBDIRS = vnc
++
+ # need to add darwin support here
+ 
+ SUBDIRS =			\
+@@ -39,6 +41,7 @@
+ 	$(XVFB_SUBDIRS)		\
+ 	$(XNEST_SUBDIRS)	\
+ 	$(DMX_SUBDIRS)          \
++	$(XVNC_SUBDIRS)		\
+         $(KDRIVE_SUBDIRS)	\
+ 	$(XPRINT_SUBDIRS)
+ 
+--- /dev/null	2007-03-01 10:25:08.783929433 +0100
++++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/Makefile.am	2007-03-02 15:45:38.000000000 +0100
+@@ -0,0 +1,85 @@
++noinst_LTLIBRARIES = libvnccommon.la
++libvnccommon_la_SOURCES = \
++		RegionHelper.h     \
++		vncExtInit.cc     \
++		vncExtInit.h      \
++		vncHooks.cc       \
++		vncHooks.h        \
++		XserverDesktop.cc \
++		XserverDesktop.h
++
++libvnccommon_la_CXXFLAGS = \
++		-DVENDOR_RELEASE="$(VENDOR_RELEASE)" \
++		-DVENDOR_STRING="\"$(VENDOR_STRING)\"" \
++		-DGC_HAS_COMPOSITE_CLIP \
++		-DVNC_USE_FB \
++		-I/usr/include/X11 \
++		-I../../../../common \
++		-I../../../vncconfig
++
++bin_PROGRAMS = Xvnc
++
++Xvnc_SOURCES = \
++		xvnc.cc \
++		$(top_srcdir)/Xext/dpmsstubs.c \
++		$(top_srcdir)/Xi/stubs.c \
++		$(top_srcdir)/mi/miinitext.c \
++		$(top_srcdir)/fb/fbcmap.c
++
++Xvnc_LDADD =	$(XORG_CORE_LIBS) \
++		$(XORG_LIBS) \
++		$(XSERVER_LIBS) \
++		../../fb/libfb.la \
++		../../mi/libminimi.la \
++		../../render/librender.la \
++		../../xkb/libxkbstubs.la \
++		../../dbe/libdbe.la \
++		../../Xext/libXext.la \
++		../../XTrap/libxtrap.la \
++		../../record/librecord.la \
++		../xfree86/os-support/libxorgos.la \
++		../../os/libos.la \
++		../xfree86/common/libcommon.la \
++		-lX11 \
++		libvnccommon.la \
++		../../../../common/rfb/librfb.a \
++		../../../../common/rdr/librdr.a \
++		../../../../common/network/libnetwork.a \
++		../../../../common/Xregion/libXregion.a
++
++Xvnc_CFLAGS =  -DHAVE_DIX_CONFIG_H \
++		-DNO_HW_ONLY_EXTS \
++		-DNO_MODULE_EXTS \
++		-DXFree86Server -DVNCEXT
++
++Xvnc_CXXFLAGS = $(Xvnc_CFLAGS) \
++		-DVENDOR_RELEASE="$(VENDOR_RELEASE)" \
++		-DVENDOR_STRING="\"$(VENDOR_STRING)\"" \
++		-DVNC_USE_FB \
++		-I../../../../common \
++		-I../../../vncconfig \
++		-I../../mi \
++		-I ../../render \
++		-I/usr/include/X11
++
++libvnc_la_LTLIBRARIES = libvnc.la
++libvnc_la_LDFLAGS = -module -avoid-version
++libvnc_ladir = $(moduledir)/extensions
++libvnc_la_SOURCES = xf86vncModule.cc
++libvnc_la_LIBADD = \
++		libvnccommon.la \
++		../../../../common/rfb/librfb.a \
++		../../../../common/rdr/librdr.a \
++		../../../../common/network/libnetwork.a \
++		../../../../common/Xregion/libXregion.a
++libvnc_la_CXXFLAGS = \
++		-I../../../../common \
++		-I$(top_srcdir)/hw/xfree86/common \
++		-I$(top_srcdir)/hw/xfree86/os-support \
++		-I$(top_srcdir)/hw/xfree86/os-support/bus \
++		-DXFree86Module -DXFree86LOADER -DIN_MODULE
++
++AM_CXXFLAGS =	$(CFLAGS) \
++		-DVENDOR_RELEASE="$(VENDOR_RELEASE)" \
++		-DVENDOR_STRING="\"$(VENDOR_STRING)\""
++
+--- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/configure.ac.modular-xorg	2007-03-02 15:45:38.000000000 +0100
++++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/configure.ac	2007-03-02 15:45:38.000000000 +0100
+@@ -1793,6 +1793,7 @@
+ hw/xnest/Makefile
+ hw/xwin/Makefile
+ hw/darwin/Makefile
++hw/vnc/Makefile
+ hw/kdrive/Makefile
+ hw/kdrive/ati/Makefile
+ hw/kdrive/chips/Makefile
+--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.modular-xorg	2007-03-02 15:45:38.000000000 +0100
++++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2007-03-02 15:45:38.000000000 +0100
+@@ -36,8 +36,6 @@
+ extern "C" {
+ #define class c_class
+ #define public c_public
+-#define xor c_xor
+-#define and c_and
+ #ifdef WIN32
+ #include <X11/Xwinsock.h>
+ #endif
+@@ -72,11 +70,8 @@
+ #include "inputstr.h"
+ #include "keysym.h"
+   extern int defaultColorVisualClass;
+-  extern char buildtime[];
+ #undef class
+ #undef public
+-#undef xor
+-#undef and
+ #ifndef VNC_USE_FB
+   extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
+   extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
+@@ -221,7 +216,7 @@
+ 
+   void ddxUseMsg()
+   {
+-    ErrorF("\nXvnc %s - built %s\n%s", XVNCVERSION, buildtime, XVNCCOPYRIGHT);
++    ErrorF("\nXvnc %s\n%s", XVNCVERSION, XVNCCOPYRIGHT);
+     ErrorF("Underlying X server release %d, %s\n\n", VENDOR_RELEASE,
+            VENDOR_STRING);
+     ErrorF("-screen scrn WxHxD     set screen's width, height, depth\n");
+@@ -927,7 +922,7 @@
+ 
+ void InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
+ {
+-  ErrorF("\nXvnc %s - built %s\n%s", XVNCVERSION, buildtime, XVNCCOPYRIGHT);
++  ErrorF("\nXvnc %s\n%s", XVNCVERSION, XVNCCOPYRIGHT);
+   ErrorF("Underlying X server release %d, %s\n\n", VENDOR_RELEASE,
+          VENDOR_STRING);
+   wellKnownSocketsCreated = true;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-module_crash.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,30 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-module_crash.patch
+
+--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc.module_crash	2007-03-26 20:00:49.000000000 +0200
++++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc	2007-03-26 20:05:20.000000000 +0200
+@@ -509,7 +509,12 @@
+   BoxRec box;
+   PictureScreenPtr ps = GetPictureScreen(pScreen);
+ 
+-  if ((xDst >= 0) && (yDst >= 0)) {
++  ps->Composite = vncHooksScreen->Composite;
++  (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
++                   xMask, yMask, xDst, yDst, width, height);
++  ps->Composite = vncHooksComposite;
++
++  if((xDst >= 0) && (yDst >= 0) && pDst->pDrawable->type == DRAWABLE_WINDOW) {
+       box.x1 = pDst->pDrawable->x + xDst;
+       box.y1 = pDst->pDrawable->y + yDst;
+       box.x2 = box.x1 + width;
+@@ -518,11 +523,6 @@
+       RegionHelper changed(pScreen, &box, 0);
+       vncHooksScreen->desktop->add_changed(changed.reg);
+   }
+-
+-  ps->Composite = vncHooksScreen->Composite;
+-  (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
+-                   xMask, yMask, xDst, yDst, width, height);
+-  ps->Composite = vncHooksComposite;
+ }
+ 
+ #endif /* RENDER */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-nohttpd.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,57 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-nohttpd.patch
+## Modified to make httpd service off by default and only offered via -httpd
+
+--- vnc-4_1_1-unixsrc/unix/vncserver.nohttpd	2005-08-08 15:51:09.000000000 +0100
++++ vnc-4_1_1-unixsrc/unix/vncserver	2005-08-11 12:13:59.000000000 +0100
+@@ -58,6 +58,7 @@
+ # Check command line options
+ 
+ &ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,
++              "-httpd",0,
+ 	      "-help",0,"-h",0,"--help",0);
+ 
+ &Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
+@@ -78,6 +79,12 @@
+ if ($opt{'-pixelformat'}) {
+     $pixelformat = $opt{'-pixelformat'};
+ }
++if ($opt{'-httpd'}) {
++    $nohttpd = 0;
++  }
++else {
++    $nohttpd = 1;
++}
+ 
+ &CheckGeometryAndDepth();
+ 
+@@ -137,7 +144,7 @@
+ 
+ $cmd = "Xvnc :$displayNumber";
+ $cmd .= " -desktop " . &quotedString($desktopName);
+-$cmd .= " -httpd $vncJavaFiles" if ($vncJavaFiles);
++$cmd .= " -httpd $vncJavaFiles" if ($vncJavaFiles && ! $nohttpd);
+ $cmd .= " -auth $xauthorityFile";
+ $cmd .= " -geometry $geometry" if ($geometry);
+ $cmd .= " -depth $depth" if ($depth);
+@@ -413,7 +420,7 @@
+ 
+ sub Usage
+ {
+-    die("\nusage: $prog [:<number>] [-name <desktop-name>] [-depth <depth>]\n".
++    die("\nusage: $prog [:<number>] [-httpd] [-name <desktop-name>] [-depth <depth>]\n".
+ 	"                 [-geometry <width>x<height>]\n".
+ 	"                 [-pixelformat rgbNNN|bgrNNN]\n".
+ 	"                 <Xvnc-options>...\n\n".
+--- vnc-4_1_1-unixsrc/unix/vncserver.man.nohttpd	2005-08-11 12:17:46.000000000 +0100
++++ vnc-4_1_1-unixsrc/unix/vncserver.man	2005-08-11 12:19:35.000000000 +0100
+@@ -77,6 +77,10 @@
+ must be 8 bits deep.
+ 
+ .TP
++.B \-httpdl
++Instruct Xvnc to run a mini-httpd if the VNC Java applet is found.
++
++.TP
+ .B \-kill :\fIdisplay#\fP
+ This kills a VNC desktop previously started with vncserver.  It does this by
+ killing the Xvnc process, whose process ID is stored in the file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-render.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,226 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-render.patch
+
+--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc.render	2007-06-07 15:50:16.000000000 +0200
++++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/vncHooks.cc	2007-06-07 15:57:54.000000000 +0200
+@@ -20,6 +20,10 @@
+ #include "XserverDesktop.h"
+ #include "vncHooks.h"
+ 
++#ifdef HAVE_DIX_CONFIG_H
++#include <dix-config.h>
++#endif
++
+ extern "C" {
+ #define class c_class
+ #define private c_private
+@@ -29,6 +33,9 @@ extern "C" {
+ #include "regionstr.h"
+ #include "dixfontstr.h"
+ #include "colormapst.h"
++#ifdef RENDER
++#include "../../render/picturestr.h"
++#endif
+ 
+ #ifdef GC_HAS_COMPOSITE_CLIP
+ #define COMPOSITE_CLIP(gc) ((gc)->pCompositeClip)
+@@ -74,6 +81,10 @@ typedef struct {
+   StoreColorsProcPtr           StoreColors;
+   DisplayCursorProcPtr         DisplayCursor;
+   ScreenBlockHandlerProcPtr    BlockHandler;
++#ifdef RENDER
++  CompositeProcPtr             Composite;
++  GlyphsProcPtr                Glyphs;
++#endif
+ } vncHooksScreenRec, *vncHooksScreenPtr;
+ 
+ typedef struct {
+@@ -105,6 +116,15 @@ static Bool vncHooksDisplayCursor(Screen
+ static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout,
+                                  pointer pReadmask);
+ 
++// RENDER support
++static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
++                              INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
++                              INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
++
++static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
++                           PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
++                           GlyphListPtr list, GlyphPtr *glyphs);
++
+ // GC "funcs"
+ 
+ static void vncHooksValidateGC(GCPtr pGC, unsigned long changes,
+@@ -230,6 +250,16 @@ Bool vncHooksInit(ScreenPtr pScreen, Xse
+   vncHooksScreen->DisplayCursor = pScreen->DisplayCursor;
+   vncHooksScreen->BlockHandler = pScreen->BlockHandler;
+ 
++#ifdef RENDER
++  PictureScreenPtr    ps = GetPictureScreenIfSet(pScreen);
++  if (ps) {
++    vncHooksScreen->Composite = ps->Composite;
++    vncHooksScreen->Glyphs = ps->Glyphs;
++    ps->Composite = vncHooksComposite;
++    ps->Glyphs = vncHooksGlyphs;
++  }
++#endif
++
+   pScreen->CloseScreen = vncHooksCloseScreen;
+   pScreen->CreateGC = vncHooksCreateGC;
+   pScreen->PaintWindowBackground = vncHooksPaintWindowBackground;
+@@ -1473,3 +1503,80 @@ static void vncHooksPushPixels(GCPtr pGC
+ 
+   vncHooksScreen->desktop->add_changed(changed.reg);
+ }
++
++#ifdef RENDER
++#define RENDER_MAKE_BOX(pDrawable,X,Y,W,H) { \
++    box.x1 = X + pDrawable->x; \
++    box.x2 = X + pDrawable->x + W; \
++    box.y1 = Y + pDrawable->y; \
++    box.y2 = Y + pDrawable->y + H; \
++}
++
++static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
++                              INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
++                              INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
++{
++    ScreenPtr           pScreen = pDst->pDrawable->pScreen;
++    vncHooksScreenPtr vncHooksScreen = \
++        ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr);
++    PictureScreenPtr    ps = GetPictureScreen(pScreen);
++    BoxRec              box;
++
++    ps->Composite = vncHooksScreen->Composite;
++    (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
++                     xMask, yMask, xDst, yDst, width, height);
++    ps->Composite = vncHooksComposite;
++
++    if (pDst->pDrawable->type == DRAWABLE_WINDOW) {
++        RENDER_MAKE_BOX(pDst->pDrawable, xDst, yDst, width, height);
++        RegionHelper changed(pScreen, &box, 0);
++        vncHooksScreen->desktop->add_changed(changed.reg);
++    }
++}
++
++
++static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
++                           PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
++                           GlyphListPtr list, GlyphPtr *glyphs)
++{
++    ScreenPtr           pScreen = pDst->pDrawable->pScreen;
++    vncHooksScreenPtr vncHooksScreen = \
++        ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr);
++    PictureScreenPtr    ps = GetPictureScreen(pScreen);
++    int                 x, y;
++    int                 n;
++    GlyphPtr            glyph;
++    BoxRec              box;
++
++    ps->Glyphs = vncHooksScreen->Glyphs;
++    (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc,
++                   nlist, list, glyphs);
++    ps->Glyphs = vncHooksGlyphs;
++
++    if (pDst->pDrawable->type == DRAWABLE_WINDOW)
++    {
++        x = xSrc;
++        y = ySrc;
++        while (nlist--)
++        {
++            x += list->xOff;
++            y += list->yOff;
++            n = list->len;
++            while (n--)
++            {
++                glyph = *glyphs++;
++                RENDER_MAKE_BOX(pDst->pDrawable,
++                                x - glyph->info.x, y - glyph->info.y,
++                                glyph->info.width, glyph->info.height);
++                RegionHelper changed(pScreen, &box, 0);
++                vncHooksScreen->desktop->add_changed(changed.reg);
++
++                x += glyph->info.xOff;
++                y += glyph->info.yOff;
++            }
++            list++;
++        }
++    }
++}
++#endif
++
+--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.render	2007-06-07 15:49:32.000000000 +0200
++++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2007-06-07 15:49:32.000000000 +0200
+@@ -130,6 +130,7 @@ static vfbScreenInfo vfbScreens[MAXSCREE
+ static Bool vfbPixmapDepths[33];
+ static char needswap = 0;
+ static int lastScreen = -1;
++static Bool Render = TRUE;
+ 
+ static bool displaySpecified = false;
+ static bool wellKnownSocketsCreated = false;
+@@ -221,6 +222,10 @@ extern "C" {
+            VENDOR_STRING);
+     ErrorF("-screen scrn WxHxD     set screen's width, height, depth\n");
+     ErrorF("-pixdepths list-of-int support given pixmap depths\n");
++#ifdef RENDER
++    ErrorF("+/-render             turn on/off RENDER extension support"
++          "(default on)\n");
++#endif
+     ErrorF("-linebias n            adjust thin line pixelization\n");
+     ErrorF("-blackpixel n          pixel value for black\n");
+     ErrorF("-whitepixel n          pixel value for white\n");
+@@ -317,6 +322,20 @@ int ddxProcessArgument(int argc, char *a
+     return ret;
+   }
+ 
++#ifdef RENDER
++  if (strcmp (argv[i], "+render") == 0)        /* +render */
++  {
++    Render = TRUE;
++    return 1;
++  }
++
++  if (strcmp (argv[i], "-render") == 0)        /* -render */
++  {
++    Render = FALSE;
++    return 1;
++  }
++#endif
++
+   if (strcmp (argv[i], "-blackpixel") == 0)	/* -blackpixel n */
+   {
+     Pixel pix;
+@@ -817,7 +836,12 @@ static Bool vfbScreenInit(int index, Scr
+   if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
+                     dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
+       return FALSE;
+-#else
++
++#ifdef RENDER
++  if (ret && Render)
++      fbPictureInit(pScreen, 0, 0);
++#endif /* RENDER */
++#else /* VNC_USE_FB */
+   switch (pvfb->bitsPerPixel)
+   {
+   case 1:
+@@ -938,6 +962,19 @@ void InitOutput(ScreenInfo *screenInfo, 
+     vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
+   }
+ 
++#ifdef RENDER
++  /* RENDER needs a good set of pixmaps. */
++  if (Render) {
++      vfbPixmapDepths[1] = TRUE;
++      vfbPixmapDepths[4] = TRUE;
++      vfbPixmapDepths[8] = TRUE;
++/*    vfbPixmapDepths[15] = TRUE; */
++      vfbPixmapDepths[16] = TRUE;
++      vfbPixmapDepths[24] = TRUE;
++      vfbPixmapDepths[32] = TRUE;
++  }
++#endif
++
+   for (i = 1; i <= 32; i++)
+   {
+     if (vfbPixmapDepths[i])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-restart.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,23 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-restart.patch
+
+--- vnc-4_1-unixsrc/common/network/TcpSocket.cxx.restart	2005-03-04 09:02:21.000000000 +0000
++++ vnc-4_1-unixsrc/common/network/TcpSocket.cxx	2005-03-04 09:03:05.000000000 +0000
+@@ -140,10 +140,14 @@
+   }
+ 
+   // Attempt to connect to the remote host
+-  if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
+-    int e = errorNumber;
+-    closesocket(sock);
+-    throw SocketException("unable to connect to host", e);
++  for (;;) {
++    if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
++      int e = errorNumber;
++      if (e == EINTR)
++        continue;
++      closesocket(sock);
++      throw SocketException("unable to connect to host", e);
++    } else break;
+   }
+ 
+   // Disable Nagle's algorithm, to reduce latency
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/vnc-use-fb.patch	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,87 @@
+## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-use-fb.patch
+
+--- vnc-4_1-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.use-fb	2005-02-28 12:59:09.000000000 +0000
++++ vnc-4_1-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2005-03-04 16:13:19.000000000 +0000
+@@ -48,8 +48,12 @@
+ #include "X11/Xos.h"
+ #include "scrnintstr.h"
+ #include "servermd.h"
++#ifdef VNC_USE_FB
++#include "fb.h"
++#else
+ #define PSZ 8
+ #include "cfb.h"
++#endif
+ #include "mi.h"
+ #include "mibstore.h"
+ #include "colormapst.h"
+@@ -73,6 +77,7 @@
+ #undef public
+ #undef xor
+ #undef and
++#ifndef VNC_USE_FB
+   extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
+   extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
+   extern Bool cfb16CreateGC(GCPtr);
+@@ -83,6 +88,7 @@
+                             unsigned long, char*);
+   extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int,
+                             unsigned long, char*);
++#endif
+ }
+ 
+ #define XVNCVERSION "Free Edition 4.1"
+@@ -482,7 +488,7 @@
+ }
+ #endif
+ 
+-
++#ifndef VNC_USE_FB
+ static Bool vfbMultiDepthCreateGC(GCPtr   pGC)
+ {
+   switch (vfbBitsPerPixel(pGC->depth))
+@@ -541,6 +547,7 @@
+     break;
+   }
+ }
++#endif
+ 
+ static ColormapPtr InstalledMaps[MAXSCREENS];
+ 
+@@ -811,6 +818,11 @@
+   defaultColorVisualClass
+     = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor;
+ 
++#ifdef VNC_USE_FB
++  if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
++                    dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel))
++      return FALSE;
++#else
+   switch (pvfb->bitsPerPixel)
+   {
+   case 1:
+@@ -838,6 +850,7 @@
+   pScreen->CreateGC = vfbMultiDepthCreateGC;
+   pScreen->GetImage = vfbMultiDepthGetImage;
+   pScreen->GetSpans = vfbMultiDepthGetSpans;
++#endif
+ 
+   pScreen->InstallColormap = vfbInstallColormap;
+   pScreen->UninstallColormap = vfbUninstallColormap;
+@@ -883,6 +896,9 @@
+     }
+   }
+ 
++#ifdef VNC_USE_FB
++  ret = fbCreateDefColormap(pScreen);
++#else
+   if (pvfb->bitsPerPixel == 1)
+   {
+     ret = mfbCreateDefColormap(pScreen);
+@@ -891,6 +907,7 @@
+   {
+     ret = cfbCreateDefColormap(pScreen);
+   }
++#endif
+ 
+   miSetZeroLineBias(pScreen, pvfb->lineBias);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xvnc/xvnc-inetd.xml	Thu Oct 11 11:47:20 2007 -0700
@@ -0,0 +1,102 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+<!--
+    Service manifest for the Xvnc service, when run from inetd(1M)
+
+    Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, and/or sell copies of the Software, and to permit persons
+    to whom the Software is furnished to do so, provided that the above
+    copyright notice(s) and this permission notice appear in all copies of
+    the Software and that both the above copyright notice(s) and this
+    permission notice appear in supporting documentation.
+
+    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
+    OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+    HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+
+    Except as contained in this notice, the name of a copyright holder
+    shall not be used in advertising or otherwise to promote the sale, use
+    or other dealings in this Software without prior written authorization
+    of the copyright holder.
+-->
+
+<service_bundle type='manifest' name='SUNWxwplr:vnc'>
+
+<service
+	name='application/x11/xvnc-inetd'
+	type='service'
+	version='1'>
+
+	<create_default_instance enabled='false' />
+
+	<restarter>
+		<service_fmri value='svc:/network/inetd:default' />
+	</restarter>
+
+	<!--
+	    Set a timeout of 0 to signify to inetd that we don't want to
+	    timeout this service, since the forked process is the one that
+	    does the service's work. This is the case for most/all legacy
+	    inetd services; for services written to take advantage of SMF
+	    capabilities, the start method should fork off a process to
+	    handle the request and return a success code.
+	-->
+	<exec_method
+		type='method'
+		name='inetd_start'
+		exec='/usr/X11/bin/Xvnc -inetd -query localhost -once securitytypes=none'
+		timeout_seconds='0'>
+		<method_context>
+			<method_credential user='noaccess' group='noaccess' />
+		</method_context>
+	</exec_method>
+
+	<!--
+	    Use inetd's built-in kill support to disable services.
+	-->
+	<exec_method
+		type='method'
+		name='inetd_disable'
+		exec=':kill'
+		timeout_seconds='0'>
+	</exec_method>
+
+	<property_group name='inetd' type='framework'>
+		<propval name='name' type='astring' value='vnc-server' />
+		<propval name='endpoint_type' type='astring' value='stream' />
+		<propval name='proto' type='astring' value='tcp' />
+		<propval name='wait' type='boolean' value='false' />
+		<propval name='isrpc' type='boolean' value='false' />
+                <propval name='action_authorization' type='astring'
+                        value='solaris.smf.manage.x11' />
+                <propval name='value_authorization' type='astring'
+                        value='solaris.smf.manage.x11' />
+	</property_group>
+
+	<stability value='External' />
+
+	<template>
+		<common_name>
+			<loctext xml:lang='C'>
+				X server that displays to VNC viewers
+			</loctext>
+		</common_name>
+		<documentation>
+			<manpage title='Xvnc' section='1' 
+				manpath='/usr/X11/share/man' />
+		</documentation>
+	</template>
+</service>
+
+</service_bundle>
--- a/packages/SUNWxwplr/prototype_com	Tue Oct 09 16:36:29 2007 -0700
+++ b/packages/SUNWxwplr/prototype_com	Thu Oct 11 11:47:20 2007 -0700
@@ -1,4 +1,4 @@
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the
@@ -25,7 +25,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# ident	"@(#)prototype_com	1.5	07/09/04 SMI"
+# ident	"@(#)prototype_com	1.6	07/10/10 SMI"
 #
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
@@ -64,3 +64,4 @@
 !search ../var/svc/manifest/application/x11
 f manifest var/svc/manifest/application/x11/x11-server.xml 0444 root sys
 f manifest var/svc/manifest/application/x11/xfs.xml 0444 root sys
+f manifest var/svc/manifest/application/x11/xvnc-inetd.xml 0444 root sys