6941861 Collected X gate build fixes
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Wed, 07 Apr 2010 15:57:52 -0700
changeset 935 f812f9863e75
parent 934 247d473d46df
child 936 c00d9e917133
6941861 Collected X gate build fixes
.hgignore
open-src/app/Makefile.inc
open-src/app/xterm/Makefile
open-src/common/Makefile.inc
open-src/common/Makefile.init
open-src/data/workspace-patterns/Makefile
open-src/doc/docbook-utils/Makefile
open-src/doc/xorg-docs/Makefile
open-src/driver/xf86-input-vmmouse/Makefile
open-src/driver/xf86-video-radeonhd/Makefile
open-src/font/Makefile.ttf
open-src/font/deja-vu/Makefile
open-src/font/sun-aliases/Makefile
open-src/lib/fontconfig/Makefile
open-src/lib/libXmu/Makefile
open-src/lib/libXt/Makefile
open-src/lib/libXtsol/Makefile
open-src/lib/libpciaccess/Makefile
open-src/proto/sun-ext-protos/Makefile
open-src/xserver/xorg/Makefile
open-src/xserver/xvnc/Makefile
packages/SUNWxorg-server/prototype_com
--- a/.hgignore	Tue Apr 06 13:10:11 2010 -0700
+++ b/.hgignore	Wed Apr 07 15:57:52 2010 -0700
@@ -5,10 +5,12 @@
 /build-amd64/
 /build-sparc/
 /build-sparcv9/
-/build_core/
-/build_iso8859-\d*/
+/build-core/
+/build-iso8859-\d*/
 # Skip downloaded tarballs
 open-src/tarballs
+# Skip checksum verification files for downloaded tarballs
+/\.checksum_done\.
 # Skip proto area and packages
 proto-.*
 # Skip build logs & reports from build cron jobs
--- a/open-src/app/Makefile.inc	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/app/Makefile.inc	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org application modules
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. 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"),
@@ -35,9 +34,6 @@
 # Changes to apply to man pages
 MODTYPE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
 
-# All modules depend on Xproto
-MODTYPE_CONFIGURE_DEPS=$(XPROTO_DEP)
-
 # Flags to build & link applications with
 MODTYPE_CFLAGS=$(PROG_CFLAGS)
 MODTYPE_CXXFLAGS=$(PROG_CXXFLAGS)
--- a/open-src/app/xterm/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/app/xterm/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # xterm Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -88,7 +87,7 @@
   XVENDORVERS = "$(XORGRELSTRING)" "$(XORGMANNAME)"
 
 fix_manpages: $(UNPACK_TARGET)
-	/usr/perl5/bin/perl -i -p -e 's{__vendorversion__}{$(XVENDORVERS)}g' \
+	$(PERL) -i -p -e 's{__vendorversion__}{$(XVENDORVERS)}g' \
 	  $(SOURCE_DIR)/*.man
 
 # Install documentation of xterm control sequences for packaging
--- a/open-src/common/Makefile.inc	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/common/Makefile.inc	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 # -*- Makefile -*- rules commonly shared among X consolidation open source dirs
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. 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"),
@@ -54,9 +53,9 @@
 SOURCE_DIRNAME_DEFAULT		= $(SOURCE_DIRNAME_SET:yes=$(POUND_SIGN))
 $(SOURCE_DIRNAME_DEFAULT)	SOURCE_DIRNAME=$(MODULE_NAME)-$(MODULE_VERSION)
 
-BUILD_DIR_$(BUILD_TYPE) = build_$(BUILD_TYPE)
+BUILD_DIR_$(BUILD_TYPE) = build-$(BUILD_TYPE)
 # Special cases for 32-bit & 64-bit directory names to allow building
-# both architectures in the same tree (serially - building both in 
+# both architectures in the same tree (serially - building both in
 # parallel is likely to have race conditions)
 BUILD_DIR_32 = build-$(MACH32)
 BUILD_DIR_64 = build-$(MACH64)
@@ -89,8 +88,7 @@
 
 # Set default rules if not set in module/modtype Makefile
 SOURCE_TARGETS_DEFAULT		= $(SOURCE_TARGETS_SET:yes=$(POUND_SIGN))
-$(SOURCE_TARGETS_DEFAULT)	SOURCE_TARGETS=default_source \
-					check-checksums \
+$(SOURCE_TARGETS_DEFAULT)	SOURCE_TARGETS=$(UNPACK_TARGET) \
 					$(MODTYPE_ADD_SOURCE_TARGETS) \
 					$(MODULE_ADD_SOURCE_TARGETS)
 
@@ -125,7 +123,7 @@
 
 # Remove directories with both styles of naming
 $(CLEAN_RULES):
-	-rm -rf $(BUILD_DIR_$(@:clean_%=%)) $(@:clean_%=build_%)
+	-rm -rf $(BUILD_DIR_$(@:clean_%=%)) $(@:clean_%=build_%) $(@:clean_%=build-%)
 
 # Tell dmake not to remove and create source in parallel
 .NOPARALLEL: clean source
@@ -187,7 +185,7 @@
 # Allow downloading from local archive/mirror
 TARBALL_ARCHIVE_sun.com		= http://xserver.sfbay.sun.com/tarballs
 TARBALL_ARCHIVE_DEFAULT		= $(TARBALL_ARCHIVE_SET:yes=$(POUND_SIGN))
-$(TARBALL_ARCHIVE_DEFAULT)	ARCHIVE_DOMAIN = domainname | awk -F. '{printf "%s.%s", $$(NF-1), $$NF}'
+$(TARBALL_ARCHIVE_DEFAULT)	ARCHIVE_DOMAIN = domainname | awk -F. '{if (NF > 1) {printf "%s.%s", $$(NF-1), $$NF}}'
 $(TARBALL_ARCHIVE_DEFAULT)	TARBALL_ARCHIVE = $(TARBALL_ARCHIVE_$(ARCHIVE_DOMAIN:sh))
 ARCHIVE_URL=$(TARBALL_ARCHIVE)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
 
@@ -218,7 +216,10 @@
 	    fi ; \
 	fi
 
-check-checksums: $(SOURCE_TARBALL)
+CHECKSUM_TARGET = .checksum_done.$(MODULE_VERSION)
+check-checksums: $(CHECKSUM_TARGET)
+
+$(CHECKSUM_TARGET): $(SOURCE_TARBALL)
 	@case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
 	if [[ "$(MODULE_VERSION)" != "git" && \
 	      "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
@@ -235,6 +236,12 @@
 		exit 1; \
 	    fi ; \
 	fi
+	touch $(CHECKSUM_TARGET)
+
+clean: clean-checksums
+
+clean-checksums:
+	-rm -f .checksum_done.*
 
 
 # Submit a tarball to the archive
@@ -273,47 +280,58 @@
 
 ### Unpack source and apply patches
 
-FIX_PC_OPS= \
-	-e 's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
-	-e 's|Requires.private: .*$$||;' \
-	$(MODTYPE_FIX_PC_FLAGS) \
-	$(MODULE_FIX_PC_FLAGS)
-
-#	-e 's|(Requires: .*)\bx11\b|$$1|;' \
+# Step 1: Initialize source dir with upstream sources
+# - if there's a tarball, unpack it.
+# - if using a git master, copy it.
+SOURCE_INIT_TARGET_FILE=.source.init.done
+SOURCE_INIT_TARGET=$(SOURCE_DIR)/$(SOURCE_INIT_TARGET_FILE)
+init_source: $(SOURCE_INIT_TARGET)
 
-SUNTOUCH_MAN_FLAGS = \
-	-a '{Availability, $(SUN_PACKAGE)}' \
-	-a '{Interface Stability, $(MODULE_STABILITY)}' \
-	$(MODTYPE_SUNTOUCH_MAN_FLAGS) \
-	$(MODULE_SUNTOUCH_MAN_FLAGS)
-
-SOURCE_DEPS = $(SOURCE_TARBALL) $(MODTYPE_SOURCE_DEPS) $(MODULE_SOURCE_DEPS)
-
-default_source: $(UNPACK_TARGET)
-
-$(UNPACK_TARGET): $(SOURCE_DEPS)
+$(SOURCE_INIT_TARGET):
 	mkdir -p $(BUILD_DIR)
-	@ if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
+	@ if [[ "$(SOURCE_TARBALL_NAME)" == "NONE" ]] ; then \
+	  $(START_CMD_ECHO); mkdir -p $(SOURCE_DIR) ; \
+	else \
 	  if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
 	    SOURCE_CMD='gtar --exclude=.git* -cf - $(GIT_CLONE_DIR)' ; \
 	  else \
 	    UNCOMP_CMD="$(SOURCE_UNCOMPRESS)" ; \
 	    SOURCE_CMD="$${UNCOMP_CMD:-bzcat} $(SOURCE_TARBALL)" ; \
 	  fi ; \
-	  print "$${SOURCE_CMD} | (cd $(BUILD_DIR) ; gtar -xf - )" ; \
-	  $${SOURCE_CMD} | (cd $(BUILD_DIR) ; gtar -xf - ) ; \
-	else \
-	  print "mkdir -p $(SOURCE_DIR)" ; \
-	  mkdir -p $(SOURCE_DIR) ; \
-	fi ; \
-	if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
+	  $(START_CMD_ECHO) ; \
+	  $${SOURCE_CMD} | \
+		gtar --directory="$(BUILD_DIR)" $(ADD_TAR_FLAGS) -xf -  ; \
+	fi
+	touch $(SOURCE_INIT_TARGET)
+
+# Step 2: Add in any additional local sources from $(ADDITIONAL_SOURCE_DIR)
+# (done after init source to avoid races in directory/file creation)
+SOURCE_ADD_TARGET_FILE=.source.add.done
+SOURCE_ADD_TARGET=$(SOURCE_DIR)/$(SOURCE_ADD_TARGET_FILE)
+add_source: $(SOURCE_ADD_TARGET)
+
+$(SOURCE_ADD_TARGET): $(SOURCE_INIT_TARGET)
+	@if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
 	  if [[ ! -x $(LNDIR) ]] ; then \
 	    (cd $(TOP)/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
 	  fi ; \
-	  ($(START_CMD_ECHO) ; \
-	   cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR) ) ; \
-	fi ; \
-	if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
+	  $(START_CMD_ECHO) ; \
+	  cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR) ; \
+	fi
+	touch $(SOURCE_ADD_TARGET)
+
+# Step 3: Apply any local patches (may be done in parallel to add_source,
+# but must come after init_source is finished)
+#
+# SOURCE_PATCHES is a list in the format: filename[,flags]
+# $${p/*,} is ksh93 syntax to remove the comma and everything before it in $p
+# $${p%,*} is ksh93 syntax to remove the comma and everything after it in $p
+PATCHED_TARGET_FILE=.patches.done
+PATCHED_TARGET=$(SOURCE_DIR)/$(PATCHED_TARGET_FILE)
+patched_source: $(PATCHED_TARGET)
+
+$(PATCHED_TARGET): $(SOURCE_INIT_TARGET)
+	@ if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
 	    for p in $(SOURCE_PATCHES) x ; do \
 	        if [[ "$$p" != "x" ]] ; then \
 		    patch_file="$${p%,*}" ; \
@@ -326,19 +344,56 @@
 		     gpatch -d $(SOURCE_DIR) $${patch_flags} < "$${patch_file}" ) ; \
 		fi ; \
 	    done ; \
-	fi ; \
-	if [[ "$(SUNTOUCHED_MANPAGES)" != "" ]] ; then \
-	    ($(START_CMD_ECHO) ; \
-		cd $(SOURCE_DIR) && \
-		/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
-		$(SUNTOUCH_MAN_FLAGS) $(SUNTOUCHED_MANPAGES) ) ; \
-	fi ; \
-	if [[ "$(FIX_PC_FILES)" != "" ]] ; then \
-	    ($(START_CMD_ECHO) ; \
-		cd $(SOURCE_DIR) && \
-		/usr/perl5/bin/perl -i.orig -p \
-			$(FIX_PC_OPS) $(FIX_PC_FILES) ); \
+	fi
+	touch $(PATCHED_TARGET)
+
+# Step 4: Apply common Solaris changes to man pages in $(SUNTOUCHED_MANPAGES)
+FIXED_MAN_TARGET_FILE=.mantouch.done
+FIXED_MAN_TARGET=$(SOURCE_DIR)/$(FIXED_MAN_TARGET_FILE)
+fixed_man: $(FIXED_MAN_TARGET)
+
+COMMON_SUNTOUCH_MAN_FLAGS = \
+	-a '{Availability, $(SUN_PACKAGE)}' \
+	-a '{Interface Stability, $(MODULE_STABILITY)}'
+
+SUNTOUCH_MAN_FLAGS = \
+	$(COMMON_SUNTOUCH_MAN_FLAGS) \
+	$(MODTYPE_SUNTOUCH_MAN_FLAGS) \
+	$(MODULE_SUNTOUCH_MAN_FLAGS)
+
+$(FIXED_MAN_TARGET): $(PATCHED_TARGET)
+	@if [[ "$(SUNTOUCHED_MANPAGES)" != "" ]] ; then \
+	    $(START_CMD_ECHO) ; \
+	    $(PERL) $(TOP)/common/suntouch-manpages.pl $(SUNTOUCH_MAN_FLAGS) \
+		$(SUNTOUCHED_MANPAGES:%=$(SOURCE_DIR)/%) ; \
 	fi
+	touch $(FIXED_MAN_TARGET)
+
+# Step 5: Apply common Solaris changes to pkg-config *.pc files listed in
+# $(FIX_PC_FILES)
+SOURCE_PC_FILES = $(FIX_PC_FILES:%=$(SOURCE_DIR)/%)
+ORIG_PC_FILES = $(SOURCE_PC_FILES:%=%.orig)
+FIXED_PC_TARGET = $(ORIG_PC_FILES)
+fixed_pc: $(FIXED_PC_TARGET)
+
+FIX_PC_OPS= \
+	-e 's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
+	-e 's|Requires.private: .*$$||;' \
+	$(MODTYPE_FIX_PC_FLAGS) \
+	$(MODULE_FIX_PC_FLAGS)
+
+$(ORIG_PC_FILES): $(PATCHED_TARGET)
+	$(PERL) -i.orig -p $(FIX_PC_OPS) $(@:.orig=)
+
+# Tie them all together
+SOURCE_DEPS = $(SOURCE_TARBALL) $(MODTYPE_SOURCE_DEPS) $(MODULE_SOURCE_DEPS)
+
+UNPACK_TARGETS = $(SOURCE_INIT_TARGET) $(PATCHED_TARGET) \
+	$(SOURCE_ADD_TARGET) $(FIXED_MAN_TARGET) $(FIXED_PC_TARGET)
+
+default_source: $(UNPACK_TARGET)
+
+$(UNPACK_TARGET): $(SOURCE_DEPS) $(UNPACK_TARGETS)
 	touch $(UNPACK_TARGET)
 
 ### Run configure scripts
@@ -347,7 +402,7 @@
 # and use automake 1.10 instead of the older 1.9.
 # /opt/jdsbld/share/aclocal is needed to get the nls.m4 from CBEgettext
 # due to: 6785384 SUNWgnu-gettext does not include autoconf m4 files
-ACLOCAL_PATH=/usr/bin/aclocal-1.10 
+ACLOCAL_PATH=/usr/bin/aclocal-1.10
 ACLOCAL_INCLUDES = -I $(PROTODIR)$(X11_ACLOCAL_DIR) \
 	-I /usr/share/aclocal -I /usr/share/aclocal-1.10 \
 	-I /opt/jdsbld/share/aclocal
@@ -410,11 +465,6 @@
 default_configure: $(AUTOCONF_TARGET)
 
 
-### Remove libtool from build process when needed
-
-delibtoolize:
-	$(TOP)/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) $(SOURCE_DIR)
-
 ### Default rules for common build pattern
 
 LD_OPTIONS = -L$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR) \
@@ -467,7 +517,7 @@
 	print "MAKE='$(MODULE_MAKE)'" ; \
 	print "MAKE_FLAGS='$(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS)'"
 
-install-in-subdir: 
+install-in-subdir:
 	(cd $(subdir) ; \
 	 $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
 	 $(subdir_cmd))
@@ -489,7 +539,7 @@
 	    for pcin in $(FIX_PC_FILES:.in=) ; do \
 		pc=$${pcin%%+(.pc|.in)} ; \
 		($(START_CMD_ECHO) ; \
-		 /usr/perl5/bin/perl -p $(UNINSTALLED_PC_OPS) $$pc.pc > \
+		 $(PERL) -p $(UNINSTALLED_PC_OPS) $$pc.pc > \
 		    $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$$(basename $${pc})-uninstalled.pc ) ; \
 	    done ; \
 	fi
@@ -528,30 +578,24 @@
 $(XORG_DEFS_ENT):
 	cd $(TOP)/doc/xorg-sgml-doctools && $(MAKE) $(MAKEFLAGS) install
 
-# Almost everything depends on the headers in xproto
-$(XPROTO_DEP):
-	@print "$(XPROTO_DEP) not found..."
-	@print "Installing dependency proto/x11proto"
-	(cd $(TOP)/proto/x11proto ; $(MAKE) $(MAKEFLAGS) install)
-
 ### Useful rules for maintaining patch sets
 
 # regenerate patches against new baseline to reduce messages about hunks
 # having fuzz or offsets when applying patches - new patches will be in new/
 
-regen-patches: 
+regen-patches:
 	CUR_LIST=""
 	rm -rf tmp-regen
-	$(MAKE) SOURCE_PATCHES="$(CUR_LIST)" BUILD_DIR=tmp-regen SUNTOUCHED_MANPAGES="" source-gen
+	$(MAKE) SOURCE_PATCHES="$(CUR_LIST)" BUILD_DIR=tmp-regen patched_source
 	mkdir -p new
 	for f in $(SOURCE_PATCHES) ; do \
 	    p=$${f%,*} ; \
 	    print '=================' $$p ; \
 	    rm -rf prev ; \
 	    mv tmp-regen prev ; \
-	    $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" BUILD_DIR=tmp-regen SUNTOUCHED_MANPAGES="" source-gen ; \
-	    awk '/^--- /	{exit} \
-		 /^diff -u/	{exit} \
+	    $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" BUILD_DIR=tmp-regen patched_source ; \
+	    gawk '/^--- /	{exit} \
+		  /^diff -u/	{exit} \
 			 	{print}' $$p > new/$$p ; \
 	    gdiff -urp -x '*~' -x '*.orig' ./prev ./tmp-regen \
 		| sed -e 's% \./prev/$(SOURCE_DIRNAME)/% %' -e 's% \./tmp-regen/$(SOURCE_DIRNAME)/% %' \
@@ -565,7 +609,7 @@
 # Derive directory name relative to open-src
 THIS_MODULE:sh=echo ${PWD} | sed 's|.*/open-src/||'
 
-# Allows running "make list-patches" to get a list of all patches we 
+# Allows running "make list-patches" to get a list of all patches we
 # currently apply in our builds
 list-patches:
 	@if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
@@ -604,3 +648,12 @@
 	    rm -f $@ ; \
 	    cp -pf $${LICENSE_TO_COPY} $@ ; \
 	fi
+
+# For use in debugging or calling from scripts like the code review helper
+# Use such as: make print_make_vars VARS="MODTYPE MODULE_NAME"
+# or: make print_make_var BUILD_TYPE=32 VARS=SOURCE_DIR
+print_make_var-%:
+	@print -n ' $(@:print_make_var-%=%)="$($(@:print_make_var-%=%))"'
+
+print_make_vars: $(VARS:%=print_make_var-%)
+	@print '\n'
--- a/open-src/common/Makefile.init	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/common/Makefile.init	Wed Apr 07 15:57:52 2010 -0700
@@ -1,8 +1,7 @@
 # -*- Makefile -*- rules commonly shared among X consolidation open source dirs
 # Makefile.init has definitions that are needed before the module/modtype rules
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -208,9 +207,6 @@
 
 ## Commonly added options
 
-# No longer needed, since X.Org libXaw is now default
-XAW_LDFLAGS = 
-
 # Link with X server private libraries like libXfont & libfontenc
 X11_SERVERLIBS_LDFLAGS= -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 			-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
@@ -221,12 +217,6 @@
 # Proto directory to install into for packaging
 PROTODIR=$(TOP)/../proto-$(ARCH)-svr4
 
-# Common subdirs
-OW_DIR=/usr/openwin
-OW_X11LIB_DIR=$(OW_DIR)/lib/X11
-OW_FONT_DIR=$(OW_X11LIB_DIR)/fonts
-OW_TRUETYPE_DIR=$(OW_FONT_DIR)/TrueType
-
 X11_DIR=/usr
 X11_BIN_DIR=$(X11_DIR)/bin
 X11_LIB_DIR=$(X11_DIR)/lib
@@ -297,6 +287,9 @@
 # make output
 START_CMD_ECHO = PS4="" ; set -x
 
+# Other tools used during build
+PERL = /usr/perl5/bin/perl
+
 ### Sources, in-tree and upstream
 
 TARBALLDIR=$(TOP)/tarballs
@@ -314,9 +307,3 @@
 # Target created when sources are unpacked
 UNPACK_FILE = .unpack_done
 UNPACK_TARGET = $(SOURCE_DIR)/$(UNPACK_FILE) 
-
-### Dependencies
-# Need to define more dependencies to enable simpler builds of subtree portions
-
-# Almost everything depends on the headers in xproto
-XPROTO_DEP=$(PROTODIR)$(PKGCONFIG_DIR_SHARE)/xproto.pc
--- a/open-src/data/workspace-patterns/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/data/workspace-patterns/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 ###############################################################################
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1995, 2010, Oracle and/or its affiliates. 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"),
@@ -30,6 +29,9 @@
 SOURCE_TARBALL_NAME=NONE
 SOURCE_TARBALL_NAME_SET=yes
 
+SOURCE_TARGETS =
+SOURCE_TARGETS_SET=yes
+
 CONFIGURE_TARGETS =
 CONFIGURE_TARGETS_SET=yes
 
@@ -43,33 +45,36 @@
 include ../Makefile.inc
 
 DESTDIR=$(PROTODIR)
-INSTDIR=$(DESTDIR)/$(X11_DIR)/share/patterns/
+INSTDIR=$(DESTDIR)$(X11_DIR)/share/patterns/
+
+PATTERN_FILES = \
+	attributes      \
+	background.xbm  \
+	bricks.xbm      \
+	burl.xbm	\
+	corn.xbm	\
+	dmndpla.xbm     \
+	dolphin.xbm     \
+	dotwave2.xbm    \
+	dune.xbm	\
+	flowers.xbm     \
+	flyseye.xbm     \
+	foreground.xbm  \
+	fuji.xbm	\
+	geiger2.xbm     \
+	gray25.xbm      \
+	gray50.xbm      \
+	gray75.xbm      \
+	miniweave.xbm   \
+	sbump.xbm       \
+	sizmk2.xbm      \
+	southwest.xbm   \
+	squares.xbm     \
+	sunmulti.xbm    \
+	swirl2.xbm      \
+	wave1.xbm	\
+	wrnkle2.xbm
 
 install_patterns:
 	mkdir -p $(INSTDIR)
-	cp -pf attributes $(INSTDIR)
-	cp -pf background.xbm $(INSTDIR)
-	cp -pf bricks.xbm $(INSTDIR)
-	cp -pf burl.xbm $(INSTDIR)
-	cp -pf corn.xbm $(INSTDIR)
-	cp -pf dmndpla.xbm $(INSTDIR)
-	cp -pf dolphin.xbm $(INSTDIR)
-	cp -pf dotwave2.xbm $(INSTDIR)
-	cp -pf dune.xbm $(INSTDIR)
-	cp -pf flowers.xbm $(INSTDIR)
-	cp -pf flyseye.xbm $(INSTDIR)
-	cp -pf foreground.xbm $(INSTDIR)
-	cp -pf fuji.xbm $(INSTDIR)
-	cp -pf geiger2.xbm $(INSTDIR)
-	cp -pf gray25.xbm $(INSTDIR)
-	cp -pf gray50.xbm $(INSTDIR)
-	cp -pf gray75.xbm $(INSTDIR)
-	cp -pf miniweave.xbm $(INSTDIR)
-	cp -pf sbump.xbm $(INSTDIR)
-	cp -pf sizmk2.xbm $(INSTDIR)
-	cp -pf southwest.xbm $(INSTDIR)
-	cp -pf squares.xbm $(INSTDIR)
-	cp -pf sunmulti.xbm $(INSTDIR)
-	cp -pf swirl2.xbm $(INSTDIR)
-	cp -pf wave1.xbm $(INSTDIR)
-	cp -pf wrnkle2.xbm $(INSTDIR)
+	cp -pf $(PATTERN_FILES) $(INSTDIR)
--- a/open-src/doc/docbook-utils/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/doc/docbook-utils/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 ###############################################################################
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -69,7 +68,7 @@
 ### Include common rulesets
 include ../Makefile.inc
 
-$(CATALOG): catalog.in
+$(CATALOG): catalog.in $(SOURCE_TARGETS)
 	sed 's%__sgmldir__%$(PROTODIR)$(X11_DIR)/share/sgml%' < catalog.in > $@
 
 install_catalog: $(CATALOG)
--- a/open-src/doc/xorg-docs/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/doc/xorg-docs/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 ###############################################################################
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -45,7 +44,7 @@
 
 # Additional arguments to configure script
 MODULE_CONFIG_OPTS=--enable-txt --disable-pdf --disable-ps --disable-html \
-	--docdir='$(X11_DOC_DIR)' \
+	--docdir='$(X11_DOC_DIR)' --with-x11docdir='$(X11_DOC_DIR)' \
 	XORG_SGML_PATH=$(PROTODIR)$(X11_DIR)/share/sgml
 
 # Module dependencies
@@ -57,15 +56,8 @@
 ### Include common rulesets
 include ../Makefile.inc
 
-SGML_DIR=$(SOURCE_DIR)/sgml
-DOC_DIR=$(PROTODIR)$(X11_DOC_DIR)
 MAN_DIR=$(PROTODIR)$(X11_MAN_DIR)
 
-install_docs: $(INSTALL_DEPS)
-	mkdir -p $(DOC_DIR) $(MAN_DIR)/man5
-	cp -p $(SGML_DIR)/LICENSE.txt		$(DOC_DIR)/LICENSE
-	cp -p $(SGML_DIR)/RELNOTES.txt		$(DOC_DIR)/RELNOTES
-	cp -p $(SGML_DIR)/input/XKB-Config.txt	$(DOC_DIR)/README.XKB-Config
-	cp -p $(SGML_DIR)/input/XKB-Enhancing.txt $(DOC_DIR)/README.XKB-Enhancing
-	cp -p $(SGML_DIR)/fonts/fonts.txt	$(DOC_DIR)/README.fonts
-	cp -p X11.5                             $(MAN_DIR)/man5/X11.5
+install_docs:
+	mkdir -p $(MAN_DIR)/man5
+	cp -pf X11.5 $(MAN_DIR)/man5/X11.5
--- a/open-src/driver/xf86-input-vmmouse/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/driver/xf86-input-vmmouse/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # xf86-input-vmmouse Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -62,7 +61,13 @@
 
 include ../Makefile.inc
 
-source_mouse_drv_links: default_source
-	ln -s $(PROTODIR)$(X11_SERVERMODS_DIR)$(SERVERMOD_subdir)/input/mouse_drv.so $(SOURCE_DIR)/src/mouse_drv.so
-	ln -s $(PROTODIR)$(X11_SERVERMODS_DIR)$(SERVERMOD_subdir)/input/mouse_drv.so $(SOURCE_DIR)/tools/mouse_drv.so
+MOUSE_DRV_LINKS = \
+	$(SOURCE_DIR)/src/mouse_drv.so \
+	$(SOURCE_DIR)/tools/mouse_drv.so
 
+source_mouse_drv_links: $(MOUSE_DRV_LINKS)
+default_build: $(MOUSE_DRV_LINKS)
+
+$(MOUSE_DRV_LINKS): $(UNPACK_TARGET)
+	-rm -f $@
+	ln -s $(PROTODIR)$(X11_SERVERMODS_DIR)$(SERVERMOD_subdir)/input/mouse_drv.so $@
--- a/open-src/driver/xf86-video-radeonhd/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/driver/xf86-video-radeonhd/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # xf86-video-radeonhd Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -67,4 +66,4 @@
 # ATI's atombios code has ^M's at linefeeds which break Sun compilers
 clean_linefeeds: default_source
 	find $(BUILD_DIR) -type f -name '*.[ch]' | \
-		xargs perl -i -p -e 's{\r\n}{\n}g'
+		xargs $(PERL) -i -p -e 's{\r\n}{\n}g'
--- a/open-src/font/Makefile.ttf	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/font/Makefile.ttf	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org TrueType font modules
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. 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"),
@@ -28,8 +27,8 @@
 CONFIGURE_TARGETS=
 CONFIGURE_TARGETS_SET=yes
 
-# Nothing to build
-BUILD_TARGETS=
+# "Build" is just creating fonts.scale & fonts.dir metadata files
+BUILD_TARGETS=build_ttf_dir
 BUILD_TARGETS_SET=yes
 
 # What to install
@@ -48,12 +47,26 @@
 
 FONT_DEST_DIR=$(PROTODIR)/$(TTF_FONT_DIR)
 
-install_ttf: $(SOURCE_TARGETS)
+SOURCE_FONT_FILES=$(TTF_FONT_FILES:%=$(SOURCE_DIR)/%)
+
+FONT_DATA_FILES=fonts.dir fonts.scale
+SOURCE_DATA_DIR=$(SOURCE_DIR)/$(TTF_SOURCE_SUBDIR)
+
+SOURCE_FONT_DATA=$(FONT_DATA_FILES:%=$(SOURCE_DATA_DIR)%)
+
+$(SOURCE_FONT_FILES): $(SOURCE_TARGETS)
+
+$(SOURCE_DATA_DIR)fonts.scale: $(SOURCE_FONT_FILES)
+	LD_LIBRARY_PATH="$(FONT_LIBS_PATH)" $(MKFONTSCALE) $(SOURCE_DATA_DIR)
+
+$(SOURCE_DATA_DIR)fonts.dir: $(SOURCE_FONT_FILES) $(SOURCE_DATA_DIR)fonts.scale
+	LD_LIBRARY_PATH="$(FONT_LIBS_PATH)" $(MKFONTDIR) $(SOURCE_DATA_DIR)
+
+build_ttf_dir: $(SOURCE_DATA_DIR)fonts.dir
+
+install_ttf: $(BUILD_TARGETS)
 	-rm -rf $(FONT_DEST_DIR)
 	mkdir -p $(FONT_DEST_DIR)
-	cp $(TTF_FONT_FILES:%=$(SOURCE_DIR)/%) $(FONT_DEST_DIR)
-	LD_LIBRARY_PATH="$(FONT_LIBS_PATH)" $(MKFONTSCALE) $(FONT_DEST_DIR)
-	LD_LIBRARY_PATH="$(FONT_LIBS_PATH)" $(MKFONTDIR) $(FONT_DEST_DIR)
+	cp -pf $(SOURCE_FONT_FILES) $(FONT_DEST_DIR)
+	cp -pf $(SOURCE_FONT_DATA) $(FONT_DEST_DIR)
 
-
-
--- a/open-src/font/deja-vu/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/font/deja-vu/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # Deja Vu Fonts Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -60,6 +59,9 @@
 	$(LICENSE_FILE) \
 	ttf/*.ttf
 
+# Subdir of $(SOURCE_DIR) containing *.ttf files
+TTF_SOURCE_SUBDIR=ttf/
+
 ### Include common rulesets
 include ../Makefile.ttf
 
--- a/open-src/font/sun-aliases/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/font/sun-aliases/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -30,6 +29,9 @@
 SOURCE_TARBALL_NAME=NONE
 SOURCE_TARBALL_NAME_SET=yes
 
+SOURCE_TARGETS = 
+SOURCE_TARGETS_SET=yes
+
 CONFIGURE_TARGETS = 
 CONFIGURE_TARGETS_SET=yes
 
--- a/open-src/lib/fontconfig/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/lib/fontconfig/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # Fontconfig 2.x Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. 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"),
@@ -127,7 +126,7 @@
 	    -e 's/SUNWfontconfig/SUNWfontconfig-root/' 		\
 	  $(FC_MAN_DIR)/man5/fonts-conf.5 > $(FC_MAN_DIR)/man4/fonts.conf.4
 	-rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
-	perl -p -e 's/^$$/.LP/;' -e 's/.?\251/\\(co/;' 		\
+	$(PERL) -p -e 's/^$$/.LP/;' -e 's/.?\251/\\(co/;' 	\
 		libfontconfig.3lib $(SOURCE_DIR)/COPYING >> 	\
 		$(FC_MAN_DIR)/man3lib/libfontconfig.3lib
 	-rm -f $(FC_MAN_DIR)/man1/fc-cache.1
--- a/open-src/lib/libXmu/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/lib/libXmu/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # Xmu 1.x Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -60,7 +59,7 @@
 MODULE_CONFIG_OPTS = --with-lint --enable-lint-library
 
 # Work around libtool brokenness that adds -R `pwd` to libXmu build
-MODULE_BUILD_DEPS=delibtoolize
+DELIBTOOLIZE=yes
 
 # Regenerate Makefile.in's from Makefile.am's after patching them
 AUTORECONF=yes
--- a/open-src/lib/libXt/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/lib/libXt/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # Xt 1.x Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -43,7 +42,7 @@
 AUTORECONF=yes
 
 # Work around libtool's interference
-MODULE_BUILD_DEPS = delibtoolize
+DELIBTOOLIZE=yes
 
 # Library name (used for specfiles/mapfiles)
 LIBNAME=Xt
--- a/open-src/lib/libXtsol/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/lib/libXtsol/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # Xtsol 1.x Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -55,7 +54,9 @@
 
 include ../Makefile.inc
 
-source_auditwrite:
+source_auditwrite: $(SOURCE_DIR)/auditwrite.c $(SOURCE_DIR)/auditwrite.h
+
+$(SOURCE_DIR)/auditwrite.c + $(SOURCE_DIR)/auditwrite.h:
 	mkdir -p $(SOURCE_DIR)
 	(cd $(SOURCE_DIR) ; \
 	 ln -s ../../../../xserver/xorg/sun-src/tsol/auditwrite.[ch] . )
--- a/open-src/lib/libpciaccess/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/lib/libpciaccess/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # libpciaccess Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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"),
@@ -62,23 +61,30 @@
 
 # Additional targets for scanpci
 MODULE_ADD_SOURCE_TARGETS = source_scanpci_man
-MODULE_ADD_INSTALL_TARGETS = install_scanpci
+MODULE_ADD_INSTALL_TARGETS_32 = install_scanpci
+MODULE_ADD_INSTALL_TARGETS = $(MODULE_ADD_INSTALL_TARGETS_$(BUILD_TYPE))
 
 include ../Makefile.inc
 
 # Update scanpci.man with program man page flags instead of library ones
-source_scanpci_man: default_source
+SCANPCI_MAN_SRC = $(SOURCE_DIR)/src/scanpci.man
+SCANPCI_MAN_OUT = $(SOURCE_DIR)/src/scanpci.1
+
+source_scanpci_man: $(SCANPCI_MAN_OUT)
+
+$(SCANPCI_MAN_SRC): $(UNPACK_TARGET)
+
+$(SCANPCI_MAN_OUT): $(SCANPCI_MAN_SRC)
 	(cd $(SOURCE_DIR) && \
-	 /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
-	        -a '{Availability, $(SUN_PACKAGE)}' \
-		-a '{Interface Stability, $(MODULE_STABILITY)}' \
+	 $(PERL) $(TOP)/common/suntouch-manpages.pl \
+		$(COMMON_SUNTOUCH_MAN_FLAGS) \
 		-p $(MODULE_PREFIX)/bin/ \
 		src/scanpci.man && \
 	 sed -e 's/__xorgversion__/"$(MODULE_NAME) $(MODULE_VERSION)"/' \
 		src/scanpci.man > src/scanpci.1 )
 
 # We want to install scanpci, even though the upstream Makefile doesn't
-install_scanpci: default_install
+install_scanpci: default_install $(SCANPCI_MAN_OUT)
 	mkdir -p $(PROTODIR)$(MODULE_PREFIX)/bin$(ARCHLIBSUBDIR) \
 		 $(PROTODIR)$(MODULE_PREFIX)/share/man/man1
 	$(INSTALL_SCRIPT) -m 755 $(SOURCE_DIR)/src/scanpci \
--- a/open-src/proto/sun-ext-protos/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/proto/sun-ext-protos/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 ###############################################################################
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -26,6 +25,8 @@
 #
 # Definitions of Solaris-specific X Server extensions
 
+MODULE_NAME=sun-ext-protos
+
 # No upstream sources for these files, since they're Solaris-specific
 SOURCE_TARBALL_NAME=NONE
 SOURCE_TARBALL_NAME_SET=yes
--- a/open-src/xserver/xorg/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/xserver/xorg/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -2,8 +2,7 @@
 #
 # Xorg server Makefile
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. 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"),
@@ -141,15 +140,18 @@
 # builds
 install_pc_common: default_install
 	-rm -f $(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
+	mkdir -p $(PROTODIR)$(PKGCONFIG_DIR)
 	cp -pf $(SOURCE_DIR)/xorg-server.pc \
 		$(PROTODIR)$(PKGCONFIG_DIR)/xorg-server.pc
 
 # Install xorg-server.pc in 32-bit pkgconfig dir on SPARC too
 install_pc_copy: install_pc_common install_pkgconfig_uninstalled 
-	cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server.pc \
-		$(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc
-	cp -pf $(PROTODIR)$(PKGCONFIG_DIR_64)/xorg-server-uninstalled.pc \
+	-rm -f $(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server.pc \
 		$(PROTODIR)$(PKGCONFIG_DIR_32)/xorg-server-uninstalled.pc
+	mkdir -p $(PROTODIR)$(PKGCONFIG_DIR_32)
+	ln -s ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server.pc \
+	    ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
+		$(PROTODIR)$(PKGCONFIG_DIR_32)/
 
 $(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
 	-rm -f $@
--- a/open-src/xserver/xvnc/Makefile	Tue Apr 06 13:10:11 2010 -0700
+++ b/open-src/xserver/xvnc/Makefile	Wed Apr 07 15:57:52 2010 -0700
@@ -4,8 +4,7 @@
 # Based on Fedora's tigervnc.spec revision 1.20 from
 # http://cvs.fedoraproject.org/viewvc/rpms/tigervnc/devel/tigervnc.spec
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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"),
@@ -108,38 +107,37 @@
 # Merge in additional sources from Xorg tarball & sun-src directory
 # This step has to be done before default_source, so that patches applied
 # in that step work correctly.
-Xvnc_source_init: $(LNDIR)
+XORG_SOURCE_INIT_TARGET = $(XORG_BUILD_DIR)/$(SOURCE_INIT_TARGET_FILE)
+XORG_PATCHED_TARGET = $(XORG_BUILD_DIR)/$(PATCHED_TARGET_FILE)
+Xvnc_source_init: $(XORG_PATCHED_TARGET)
+
+$(XORG_TARBALL):
+	(cd ../xorg && $(MAKE) $(MAKEFLAGS) download)
+
+$(XORG_SOURCE_INIT_TARGET): $(XORG_TARBALL)
 	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_file="$${p%,*}" ; \
-		    if [[ "$$p" =~ "," ]] ; then \
-			patch_flags="$${p/*,}" ; \
-		    else \
-			patch_flags="-p0" ; \
-		    fi ; \
-		    ($(START_CMD_ECHO) ; \
-		     gpatch -d $(XORG_SOURCE_DIR) $${patch_flags} < "../xorg/$${patch_file}" ) ; \
-		fi ; \
-	    done ; \
-	fi
+	$(MAKE) $(MAKEFLAGS) init_source \
+		SOURCE_TARBALL="$(XORG_TARBALL)" \
+		SOURCE_UNCOMPRESS="bzcat" \
+		SOURCE_DIR="$(XORG_SOURCE_DIR)"	
 	mv $(XORG_SOURCE_DIR) $(XORG_BUILD_DIR)
 	(cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
 
+$(XORG_PATCHED_TARGET): $(XORG_SOURCE_INIT_TARGET)
+	$(MAKE) $(MAKEFLAGS) patched_source \
+		SOURCE_PATCHES="$(XORG_SOURCE_PATCHES:%=../xorg/%)" \
+		SOURCE_DIR="$(XORG_BUILD_DIR)"
+
 # Apply specific sets of Solaris attributes to various man pages
 # This step has to be done after default_source, since it depends
 # on files created in that stage
-Xvnc_source_fini: default_source
-	(cd $(SOURCE_DIR) && \
-		/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
-		-a '{Availability, SUNWvncviewer} {Interface Stability, Volatile}' \
-		-p /usr/bin/ unix/vncviewer/vncviewer.man )
-	(cd $(SOURCE_DIR) && \
-		/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
-		-a '{Availability, SUNWxvnc} {Interface Stability, Volatile}' \
-		-p $(X11_DIR)/bin/ unix/xserver/hw/vnc/Xvnc.man )
+Xvnc_source_fini: $(UNPACK_TARGET)
+	$(PERL) $(TOP)/common/suntouch-manpages.pl \
+	  -a '{Availability, SUNWvncviewer} {Interface Stability, Volatile}' \
+	  -p /usr/bin/ $(SOURCE_DIR)/unix/vncviewer/vncviewer.man
+	$(PERL) $(TOP)/common/suntouch-manpages.pl \
+	  -a '{Availability, SUNWxvnc} {Interface Stability, Volatile}' \
+	  -p $(X11_DIR)/bin/ $(SOURCE_DIR)/unix/xserver/hw/vnc/Xvnc.man
 
 # Command line options to GNU autoconf configure script for vnc clients
 VNC_CONFIG_OPTS= --with-installed-zlib --prefix=/usr \
--- a/packages/SUNWxorg-server/prototype_com	Tue Apr 06 13:10:11 2010 -0700
+++ b/packages/SUNWxorg-server/prototype_com	Wed Apr 07 15:57:52 2010 -0700
@@ -1,7 +1,6 @@
 ###########################################################################
 #
-# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. 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"),
@@ -95,13 +94,19 @@
 !search $HOME/share/doc/X11
 d none share/doc						0755 root other
 d none share/doc/X11						0755 root bin
-f none share/doc/X11/LICENSE					0444 root bin
+f none share/doc/X11/LICENSE.txt				0444 root bin
 f none share/doc/X11/README.DRI					0444 root bin
-f none share/doc/X11/README.XKB-Config				0444 root bin
-f none share/doc/X11/README.XKB-Enhancing			0444 root bin
-f none share/doc/X11/README.fonts				0444 root bin
 f none share/doc/X11/README.mouse				0444 root bin
-f none share/doc/X11/RELNOTES					0444 root bin
+f none share/doc/X11/RELNOTES.txt				0444 root bin
+
+!search $HOME/share/doc/X11/fonts
+d none share/doc/X11/fonts					0755 root bin
+f none share/doc/X11/fonts/fonts.txt				0444 root bin
+
+!search $HOME/share/doc/X11/input
+d none share/doc/X11/input					0755 root bin
+f none share/doc/X11/input/XKB-Config.txt			0444 root bin
+f none share/doc/X11/input/XKB-Enhancing.txt			0444 root bin
 
 d none share/man						0755 root bin