6928500 Race conditions in parallel make break X nightly builds
authorAlan Coopersmith <Alan.Coopersmith@Sun.COM>
Mon, 22 Feb 2010 16:19:24 -0800
changeset 910 0a08683bf637
parent 909 23e167c89da8
child 911 a3e7e197651c
6928500 Race conditions in parallel make break X nightly builds
open-src/app/accessx/Makefile
open-src/app/bdftopcf/Makefile
open-src/app/cmap_alloc/Makefile
open-src/app/cmap_compact/Makefile
open-src/app/dispswitch/Makefile
open-src/app/kbd_mode/Makefile
open-src/app/mesa-demos/Makefile
open-src/app/mkcookie/Makefile
open-src/app/synergy/Makefile
open-src/app/xfd/Makefile
open-src/app/xpm/Makefile
open-src/common/Makefile.inc
open-src/common/Makefile.init
open-src/data/rasterfile/Makefile
open-src/data/smf-rbac/Makefile
open-src/data/workspace-patterns/Makefile
open-src/doc/xorg-docs/Makefile
open-src/driver/xf86-input-hotkey/Makefile
open-src/driver/xf86-input-mouse/Makefile
open-src/driver/xf86-input-vmmouse/Makefile
open-src/driver/xf86-video-apm/Makefile
open-src/driver/xf86-video-chips/Makefile
open-src/driver/xf86-video-i128/Makefile
open-src/driver/xf86-video-i740/Makefile
open-src/driver/xf86-video-intel/Makefile
open-src/driver/xf86-video-mach64/Makefile
open-src/driver/xf86-video-r128/Makefile
open-src/driver/xf86-video-rendition/Makefile
open-src/driver/xf86-video-s3virge/Makefile
open-src/driver/xf86-video-sis/Makefile
open-src/font/Makefile.bdf
open-src/font/Makefile.ttf
open-src/lib/Makefile.inc
open-src/lib/freetype/Makefile
open-src/lib/libX11/Makefile
open-src/lib/libXaw/Makefile
open-src/lib/libXmu/Makefile
open-src/lib/libXmu/sun-src/CmapEquiv.c
open-src/lib/libXmu/sun-src/VisGamma.c
open-src/lib/libXmu/sun-src/XmuSolaris.h
open-src/lib/libXmu/sun-src/include/X11/Xmu/XmuSolaris.h
open-src/lib/libXmu/sun-src/src/CmapEquiv.c
open-src/lib/libXmu/sun-src/src/VisGamma.c
open-src/lib/libXtsol/Makefile
open-src/lib/liblbxutil/Makefile
open-src/lib/libpciaccess/Makefile
open-src/proto/sun-ext-protos/Makefile
open-src/util/util-macros/Makefile
open-src/xserver/xorg/Makefile
--- a/open-src/app/accessx/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/accessx/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # accessx 1.x module Makefile
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -55,5 +55,3 @@
 MODULE_INSTALL_MAKEFLAGS=$(CONFIG_ENV) PREFIX=$(MODULE_PREFIX)
 
 include ../Makefile.inc
-
-source_gen:: $(LNDIR)
--- a/open-src/app/bdftopcf/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/bdftopcf/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # bdftopcf Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -53,4 +53,4 @@
 include ../Makefile.inc
 
 # Clean up old 64-bit builds from before we stopped building them
-clean:: clean_64
+clean: clean_64
--- a/open-src/app/cmap_alloc/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/cmap_alloc/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # cmap_alloc 1.x module Makefile
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -55,5 +55,3 @@
 MODULE_INSTALL_MAKEFLAGS=$(CONFIG_ENV) PREFIX=$(MODULE_PREFIX)
 
 include ../Makefile.inc
-
-source_gen:: $(LNDIR)
--- a/open-src/app/cmap_compact/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/cmap_compact/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # cmap_compact 1.x module Makefile
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -55,5 +55,3 @@
 MODULE_INSTALL_MAKEFLAGS=$(CONFIG_ENV) PREFIX=$(MODULE_PREFIX)
 
 include ../Makefile.inc
-
-source_gen:: $(LNDIR)
--- a/open-src/app/dispswitch/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/dispswitch/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # dispswitch module Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -55,5 +55,3 @@
 MODULE_INSTALL_MAKEFLAGS=$(CONFIG_ENV) PREFIX=$(MODULE_PREFIX)
 
 include ../Makefile.inc
-
-source_gen:: $(LNDIR)
--- a/open-src/app/kbd_mode/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/kbd_mode/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # kbd_mode module Makefile
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -56,4 +56,3 @@
 
 include ../Makefile.inc
 
-source_gen:: $(LNDIR)
--- a/open-src/app/mesa-demos/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/mesa-demos/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -106,8 +106,6 @@
 all-xdemos:
 	$(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) all-xdemos_gen
 
-install_gen:: $(INSTALL_TARGETS)
-
 DESTDIR=$(PROTODIR)
 
 install_glxgears: $(GLXGEARS_BIN)
--- a/open-src/app/mkcookie/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/mkcookie/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # mkcookie 1.x module Makefile
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -55,5 +55,3 @@
 MODULE_INSTALL_MAKEFLAGS=$(CONFIG_ENV) PREFIX=$(MODULE_PREFIX)
 
 include ../Makefile.inc
-
-source_gen:: $(LNDIR)
--- a/open-src/app/synergy/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/synergy/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # synergy 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -126,8 +126,6 @@
 
 include ../Makefile.inc
 
-install_gen:: $(INSTALL_TARGETS)
-
 DESTDIR=$(PROTODIR)
 
 install_synergys: $(SYNERGYS_BIN)
--- a/open-src/app/xfd/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/xfd/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xfd 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -41,15 +41,16 @@
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = xfd.patch
 
-
 # Man pages to apply Sun footer to & attributes to list
 SUNTOUCHED_MANPAGES=*.man
 SUN_PACKAGE=SUNWxwplt
 MODULE_STABILITY=Committed
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_po
+
 include ../Makefile.inc
 
-install_gen:: install_po
 install_po:
 	mkdir -p $(PROTODIR)$(X11_LC_MESSAGES_DIR)
 	cp -f xfd.po $(PROTODIR)$(X11_LC_MESSAGES_DIR)
--- a/open-src/app/xpm/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/app/xpm/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # Xpm apps Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -60,7 +60,7 @@
 
 include ../Makefile.inc
 
-install_xpm_apps:: $(BUILD_TARGETS)
+install_xpm_apps: $(BUILD_TARGETS)
 	(cd $(SOURCE_DIR)/cxpm ; $(MAKE) $(MAKEFLAGS) -e DESTDIR=$(PROTODIR) install)
 	(cd $(SOURCE_DIR)/sxpm ; $(MAKE) $(MAKEFLAGS) -e DESTDIR=$(PROTODIR) install)
 	mkdir -p $(PROTODIR)$(X11_LC_MESSAGES_DIR)
--- a/open-src/common/Makefile.inc	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/common/Makefile.inc	Mon Feb 22 16:19:24 2010 -0800
@@ -126,12 +126,12 @@
 all_32: source_32 configure_32 build_32
 all_64: source_64 configure_64 build_64
 
-clean:: $(BUILD_TYPES:%=clean_%)
+clean: $(BUILD_TYPES:%=clean_%) 
 
-clean_32::
+clean_32:
 	-rm -rf $(BUILD_DIR_32)
 
-clean_64::
+clean_64:
 	-rm -rf $(BUILD_DIR_64)
 
 # Tell dmake not to remove and create source in parallel
@@ -140,7 +140,7 @@
 
 source: $(BUILD_TYPES:%=source_%)
 
-source_gen:: $(SOURCE_TARGETS)
+source_gen: $(SOURCE_TARGETS)
 
 source_32: $(SOURCE_DIR_32)/$(UNPACK_FILE)
 $(SOURCE_DIR_32)/$(UNPACK_FILE):
@@ -154,30 +154,30 @@
 
 configure_gen: $(CONFIGURE_TARGETS)
 
-configure_32:: source_32
+configure_32: source_32
 	$(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) configure_gen
 
-configure_64:: source_64
+configure_64: source_64
 	$(MAKE) $(MAKEFLAGS) $(BUILD_64_FLAGS) configure_gen
 
 build: $(BUILD_TYPES:%=build_%)
 
 build_gen: $(BUILD_TARGETS)
 
-build_32:: configure_32
+build_32: configure_32
 	$(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) build_gen
 
-build_64:: configure_64
+build_64: configure_64
 	$(MAKE) $(MAKEFLAGS) $(BUILD_64_FLAGS) build_gen
 
 install: $(BUILD_TYPES:%=install_%)
 
-install_gen:: $(INSTALL_TARGETS) install_license install_pkgconfig_uninstalled
+install_gen: $(INSTALL_TARGETS) install_license install_pkgconfig_uninstalled
 
-install_32:: build_32
+install_32: build_32
 	$(MAKE) $(MAKEFLAGS) $(BUILD_32_FLAGS) install_gen
 
-install_64:: build_64
+install_64: build_64
 	$(MAKE) $(MAKEFLAGS) $(BUILD_64_FLAGS) install_gen
 
 DEBUG_BUILD_FLAGS = BUILD_DEBUG=yes
@@ -378,7 +378,7 @@
 	    $(TOP)/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
 	fi
 
-default_configure:: $(AUTOCONF_TARGET)
+default_configure: $(AUTOCONF_TARGET)
 
 
 ### Remove libtool from build process when needed
@@ -422,7 +422,7 @@
 DEFAULT_BUILD_MAKEFLAGS=$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
 	$(MODTYPE_BUILD_MAKEFLAGS) $(MODULE_BUILD_MAKEFLAGS)
 
-default_build:: $(UNPACK_TARGET) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE)
+default_build: $(UNPACK_TARGET) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS) $(MODULE_MAKE)
 	(cd $(SOURCE_DIR) ; \
 	 $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS))
 
@@ -444,7 +444,7 @@
 # Dependencies for make install step
 INSTALL_DEPS = $(BUILD_TARGETS) $(MODTYPE_INSTALL_DEPS) $(MODULE_INSTALL_DEPS)
 
-default_install:: $(INSTALL_DEPS)
+default_install: $(INSTALL_DEPS)
 	(cd $(SOURCE_DIR) ; \
 	 $(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS) \
 	 install)
@@ -467,7 +467,10 @@
 	-e 's|$$protodir\$${sdkdir}|\$${sdkdir}|g;' \
 	$(MODTYPE_ADD_UNINSTALLED_PC_OPS) $(MODULE_ADD_UNINSTALLED_PC_OPS)
 
-install_pkgconfig_uninstalled: $(INSTALL_TARGETS)
+INSTALL_PCU_DEPS_DEFAULT	= $(INSTALL_PCU_DEPS_SET:yes=$(POUND_SIGN))
+$(INSTALL_PCU_DEPS_DEFAULT)	INSTALL_PCU_DEPS = $(INSTALL_TARGETS)
+
+install_pkgconfig_uninstalled: $(INSTALL_PCU_DEPS)
 	@ if [[ ! -z "$(FIX_PC_FILES)" ]] ; then \
 	    cd $(SOURCE_DIR) ; \
 	    for pcin in $(FIX_PC_FILES:.in=) ; do \
--- a/open-src/common/Makefile.init	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/common/Makefile.init	Mon Feb 22 16:19:24 2010 -0800
@@ -1,7 +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 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -47,7 +47,7 @@
 POUND_SIGN=				$(PRE_POUND:pre\%=%)
 
 # Set default build target to all
-default:: all
+default: all
 
 # The infrastructure in the main tree requires Solaris make
 $(error You must use Solaris make, not GNU make in this build - make sure /usr/ccs/bin or /usr/bin is ahead of /usr/gnu/bin in $$PATH)
--- a/open-src/data/rasterfile/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/data/rasterfile/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -42,7 +42,7 @@
 BUILD_TARGETS =
 BUILD_TARGETS_SET=yes
 
-INSTALL_TARGETS =
+INSTALL_TARGETS = install_files
 INSTALL_TARGETS_SET=yes
 
 ### Include common rulesets
@@ -52,7 +52,7 @@
 INCDIR=$(DESTDIR)/usr/include/pixrect
 MANDIR=$(DESTDIR)/usr/share/man/man4
 
-install_gen::
+install_files:
 	mkdir -p $(INCDIR) $(MANDIR)
 	cp -pf rasterfile.h $(INCDIR)
 	cp -pf rasterfile.4 $(MANDIR)
--- a/open-src/data/smf-rbac/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/data/smf-rbac/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -70,7 +70,7 @@
 x11-server.xml: x11-server.xml.in
 	sed -e 's|@DEFAULT_XSERVER@|$(DEFAULT_XSERVER)|' < x11-server.xml.in > $@
 
-check:: x11-server.xml ogl-select.xml
+check: x11-server.xml ogl-select.xml
 	/usr/sbin/svccfg validate x11-server.xml
 	/usr/sbin/svccfg validate ogl-select.xml
 
--- a/open-src/data/workspace-patterns/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/data/workspace-patterns/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -42,7 +42,7 @@
 BUILD_TARGETS =
 BUILD_TARGETS_SET=yes
 
-INSTALL_TARGETS =
+INSTALL_TARGETS = install_patterns
 INSTALL_TARGETS_SET=yes
 
 ### Include common rulesets
@@ -51,7 +51,7 @@
 DESTDIR=$(PROTODIR)
 INSTDIR=$(DESTDIR)/$(X11_DIR)/share/patterns/
 
-install_gen::
+install_patterns:
 	mkdir -p $(INSTDIR)
 	cp -pf attributes $(INSTDIR)
 	cp -pf background.xbm $(INSTDIR)
--- a/open-src/doc/xorg-docs/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/doc/xorg-docs/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -53,6 +53,9 @@
 # Module dependencies
 MODULE_CONFIGURE_DEPS=$(DOCBOOK2TEXT) $(XORG_DEFS_ENT)
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 ### Include common rulesets
 include ../Makefile.inc
 
@@ -60,7 +63,7 @@
 DOC_DIR=$(PROTODIR)$(X11_DOC_DIR)
 MAN_DIR=$(PROTODIR)$(X11_MAN_DIR)
 
-install_gen::
+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
--- a/open-src/driver/xf86-input-hotkey/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-input-hotkey/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-input-keyboard 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -53,5 +53,4 @@
 
 include ../Makefile.inc
 
-source_gen:: $(LNDIR)
 
--- a/open-src/driver/xf86-input-mouse/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-input-mouse/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -52,8 +52,11 @@
 # Libraries/modules to link with
 MODULE_LD_OPTIONS= -lm
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.mouse
--- a/open-src/driver/xf86-input-vmmouse/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-input-vmmouse/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -60,10 +60,11 @@
 
 # Libraries/modules to link with
 MODULE_LD_OPTIONS= mouse_drv.so
+MODULE_ADD_SOURCE_TARGETS= source_mouse_drv_links
 
 include ../Makefile.inc
 
-source_gen::
+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
 
--- a/open-src/driver/xf86-video-apm/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-apm/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-apm 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -54,8 +54,11 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lfb -lint10 -lpciaccess -lshadowfb -lvbe -lvgahw -lxaa
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.apm
--- a/open-src/driver/xf86-video-chips/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-chips/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-chips 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -55,9 +55,11 @@
 	-lfb -lint10 -lpciaccess  -lshadowfb -lvbe -lvgahw -lxaa \
 	-lxf8_16bpp
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.chips
--- a/open-src/driver/xf86-video-i128/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-i128/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-i128 Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -54,8 +54,11 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lexa -lfb -lvgahw -lxaa -lpciaccess
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.I128
--- a/open-src/driver/xf86-video-i740/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-i740/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-i740 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -52,9 +52,11 @@
 	-R$(X11_SERVERMODS_DIR)$(SERVERMOD_subdir) \
 	-lfb -lint10 -lpciaccess -lvbe -lvgahw -lxaa -lm
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.i740
--- a/open-src/driver/xf86-video-intel/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-intel/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-intel Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -73,8 +73,11 @@
 # configure.ac & Makefile.am's in libraries.patch & build-dri.patch
 AUTORECONF=yes
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.intel
--- a/open-src/driver/xf86-video-mach64/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-mach64/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-mach64 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -58,8 +58,11 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lexa -lint10 -lpciaccess -lfb -lshadowfb -lvbe -lxaa
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README.ati $(PROTODIR)$(X11_DOC_DIR)/
--- a/open-src/driver/xf86-video-r128/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-r128/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-r128 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -62,8 +62,11 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lint10 -lpciaccess -lfb -lvbe -lxaa -lfbdevhw -lvgahw
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README.r128 $(PROTODIR)$(X11_DOC_DIR)/
--- a/open-src/driver/xf86-video-rendition/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-rendition/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-rendition Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -54,8 +54,11 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lfb -lint10 -lpciaccess -lshadowfb -lvbe -lvgahw -lxaa
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.rendition
--- a/open-src/driver/xf86-video-s3virge/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-s3virge/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-s3virge 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -54,8 +54,11 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lfb -lint10 -lpciaccess -lshadowfb -lvbe -lvgahw -lxaa
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.s3virge
--- a/open-src/driver/xf86-video-sis/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/driver/xf86-video-sis/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # xf86-video-sis Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -57,9 +57,12 @@
 	-R$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR) \
 	-lexa -lfb -lint10 -lpciaccess -lshadowfb -lvbe -lvgahw -lxaa -lm 
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_docs
+
 include ../Makefile.inc
 
-install_gen::
+install_docs: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
 	cp -p $(SOURCE_DIR)/README $(PROTODIR)$(X11_DOC_DIR)/README.SiS
 
--- a/open-src/font/Makefile.bdf	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/font/Makefile.bdf	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org bdf/pcf font modules
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -124,7 +124,7 @@
 	-rm -rf $(@:clean_%=build_%)
 
 # Clean up old directories when we switch to the new rules
-clean:: clean_32
+clean: clean_32
 
 .PARALLEL: $(CLEAN_RULES) clean_32
 
--- a/open-src/font/Makefile.ttf	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/font/Makefile.ttf	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org TrueType font modules
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -54,7 +54,7 @@
 
 FONT_DEST_DIR=$(PROTODIR)/$(TTF_FONT_DIR)
 
-install_ttf:: $(SOURCE_TARGETS)
+install_ttf: $(SOURCE_TARGETS)
 	-rm -rf $(FONT_DEST_DIR)
 	mkdir -p $(FONT_DEST_DIR)
 	cp $(TTF_FONT_FILES:%=$(SOURCE_DIR)/%) $(FONT_DEST_DIR)
--- a/open-src/lib/Makefile.inc	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/Makefile.inc	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org library modules
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -80,7 +80,7 @@
 
 LIB_INST_DIR=$(PROTODIR)$(MODULE_PREFIX)/lib$(MODULE_ADD_LIB_SUBDIR)
 
-install_64:: $(LIB_INST_DIR)/64
+install_64: $(LIB_INST_DIR)/64
 
 $(LIB_INST_DIR)/64:
 	mkdir -p $(LIB_INST_DIR)
--- a/open-src/lib/freetype/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/freetype/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # Freetype 2.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -124,7 +124,7 @@
 
 # Have to override default_install since the -e causes our BUILD_DIR to
 # clash with the one in freetype's Makefiles
-install_freetype:: $(BUILD_TARGETS)
+install_freetype: $(BUILD_TARGETS)
 	mkdir -p $(PROTODIR)/usr/bin$(ARCHLIBSUBDIR)
 	( cd $(SOURCE_DIR)/builds/unix ; \
 	    ./config.status --file ftconfig ; \
@@ -138,7 +138,9 @@
 
 # $(PROTODIR)/usr/sfw is made so that the RUNPATH in mkfontscale picks up
 # libfreetype from the $(PROTODIR) when running in the build
-install_32::
+install_32: $(PROTODIR)/usr/sfw
+
+$(PROTODIR)/usr/sfw:
 	-/bin/rm -f $(PROTODIR)/usr/sfw
 	ln -s . $(PROTODIR)/usr/sfw
 
@@ -146,7 +148,9 @@
 
 BIN_INST_DIR=$(PROTODIR)$(MODULE_PREFIX)/bin
 
-install_64::
+install_64: $(BIN_INST_DIR)/64
+
+$(BIN_INST_DIR)/64:
 	-/bin/rm -f $(BIN_INST_DIR)/64
 	mkdir -p $(BIN_INST_DIR)
 	ln -s $(SUBDIR64) $(BIN_INST_DIR)/64
--- a/open-src/lib/libX11/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/libX11/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # X11 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -153,7 +153,9 @@
 
 # Install additional headers we need in other parts of the build or ship in
 # packages, but which X.Org doesn't
-install_32:: build_32
+install_32: install_extra_headers
+
+install_extra_headers: build_32
 	mkdir -p $(PROTODIR)$(X11_INCLUDES_DIR)/X11/extensions
 	cp -pf sun-src/include/X11/Xvarargs.h \
 		$(PROTODIR)$(X11_INCLUDES_DIR)/X11/
--- a/open-src/lib/libXaw/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/libXaw/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # Xaw Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -65,5 +65,7 @@
 include ../Makefile.inc
 
 # Remove existing Xaw headers from proto area before build to avoid conflicts
-clean::
+clean: clean_old_headers
+
+clean_old_headers:
 	rm -rf $(PROTODIR)$(X11_INCLUDES_DIR)/X11/Xaw
--- a/open-src/lib/libXmu/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/libXmu/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # Xmu 1.x Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -52,7 +52,8 @@
 MODULE_STABILITY=Committed
 LIB_MAN_SUFFIX=3Xmu
 
-
+# Merge in additional sources from sun-src directory
+ADDITIONAL_SOURCE_DIR=sun-src
 
 # pkg-config files that need to have -R added
 FIX_PC_FILES=xmu.pc.in xmuu.pc.in
@@ -66,26 +67,19 @@
 # Regenerate Makefile.in's from Makefile.am's after patching them
 AUTORECONF=yes
 
-include ../Makefile.inc
+# Additional rules beyond what upstream provides
+MODULE_ADD_INSTALL_TARGETS=install_solaris_exts 
 
-# Add-in Sun-added source files
-source_gen::
-	mkdir -p $(SOURCE_DIR)/src $(SOURCE_DIR)/include/X11/Xmu/
-	(cd $(SOURCE_DIR)/src ; ln -s ../../../sun-src/*.c .)
-	(cd $(SOURCE_DIR)/include/X11/Xmu ; ln -s ../../../../../sun-src/*.h .)
+include ../Makefile.inc
 
 # Additional files we need to install
 CP = cp -pf
 MANDIR = $(PROTODIR)$(X11_MAN_DIR)/man3Xmu
 
-install_gen::
+install_solaris_exts: $(INSTALL_DEPS)
 	mkdir -p $(PROTODIR)$(X11_INCLUDES_DIR)/X11/Xmu $(MANDIR) \
 		 $(PROTODIR)$(X11_LIB_DIR)$(ARCHLIBSUBDIR)
 	$(CP) $(SOURCE_DIR)/include/X11/Xmu/XmuSolaris.h \
 	       $(SOURCE_DIR)/include/X11/Xmu/WhitePoint.h \
 		$(PROTODIR)$(X11_INCLUDES_DIR)/X11/Xmu
-	$(CP) sun-src/*.3Xmu $(MANDIR)
-	rm -f $(PROTODIR)$(X11_LIB_DIR)$(ARCHLIBSUBDIR)/libXmu.so \
-		$(PROTODIR)$(X11_LIB_DIR)$(ARCHLIBSUBDIR)/libXmuu.so
-	ln -s libXmu.so.4 $(PROTODIR)$(X11_LIB_DIR)$(ARCHLIBSUBDIR)/libXmu.so
-	ln -s libXmuu.so.1 $(PROTODIR)$(X11_LIB_DIR)$(ARCHLIBSUBDIR)/libXmuu.so
+	$(CP) $(ADDITIONAL_SOURCE_DIR)/*.3Xmu $(MANDIR)
--- a/open-src/lib/libXmu/sun-src/CmapEquiv.c	Sat Feb 20 21:16:06 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/*
- * Copyright 1996 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.
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/Xmu/XmuSolaris.h>
-
-#if defined(DEBUG)
-#include <stdio.h>
-#endif
-
-#define INIT_LIST_SIZE 100
-
-/*
- * Get's next pair of integers from a string
- */
-static VisualID
-getNextEntry(char **pp)
-{
-    char  *newP;
-    VisualID	  entry;
-
-    entry = strtoul(*pp, &newP, 0);
-    if (newP == *pp) {
-	return 0;
-    }
-    *pp = newP;
-
-    return entry;
-}
-
-/*
- * Build a list of VisualIds that are equivalant to vidIn
- *
- * The format of the property string is a sequence of lists of
- * integers separated by a newline.
- * The first entry in each is the number of elements in the list.
- * The list of ids follows.
- */
-static VisualID *
-buildList(char *string, VisualID vidIn, VisualID *pOriginalList)
-{
-    VisualID  	*pList;
-    char 	*p = string;
-    int	 	num;
-
-#ifdef DEBUG
-    (void) memset(pOriginalList, 0, sizeof(VisualID)*INIT_LIST_SIZE);
-#endif
-
-    while (num = strtoul(p, &p, 0)) {
-	int foundIt = 0;
-	int i;
-	if ((num + 1) > INIT_LIST_SIZE) {
-	    pList = (VisualID *) malloc((num + 1) * sizeof(VisualID));
-	    if (pList == NULL)
-		return NULL;
-	} else {
-	    pList = pOriginalList;
-	}
-	for (i=0; i < num; i++) {
-	    /* Build the list of VisualIDs equivalent to v */
-	    VisualID vid;
-	    if (vid = getNextEntry(&p)) {
-		pList[i] = vid;
-		if (vid == vidIn)
-		    foundIt = 1;
-	    } else {
-	        /* string is formatted wrong */
-#ifdef DEBUG
-		fprintf(stderr, "property string is formatted wrong: %s\n",
-			string);
-#endif
-	        break;
-	    }
-	}
-#ifdef DEBUG
-	if (*p != '\n')
-	    fprintf(stderr, "property string is missing a newline: %s\n",
-			string);
-#endif
-	if (foundIt) {
-	    /* terminate the list */
-	    pList[num] = 0;
-	    break;
-	}
-	if (pList != pOriginalList)
-	    free(pList);
-	pList = NULL;
-    }
-
-    return pList;
-}
-
-
-static int
-searchList(VisualID *pList, VisualID v)
-{
-	int i;
-	for (i=0; pList[i] != 0; i++) {
-	    if (pList[i] == v)
-		return 1;
-	}
-	return 0;
-}
-
-static Bool
-areEquiv(char *pPropString, VisualID v1, VisualID v2)
-{
-	VisualID list[INIT_LIST_SIZE];
-	VisualID *pList;
-	Bool foundMatch = False;
-
-	/*
-	 * Build a list of VisualIDS which are equivalent to v1
-	 * using the array list if it fits.
-	 */
-	pList = buildList(pPropString, v1, list);
-	if (pList == NULL)
-	    return False;
-
-	/* now see if v2 is in the list */
-	if (searchList(pList, v2)) {
-	    foundMatch  = True;
-	}
-
-	if (pList != list)
-	    free(pList);
-
-	return foundMatch;
-}
-
-#define SUN_CMAP_EQUIV_ATOM_NAME "_SUN_CMAP_EQUIV"
-
-Bool
-XSolarisCheckColormapEquivalence(Display *dpy,  int screen_number, 
-				Visual *pVis1, Visual* pVis2)
-{
-	Atom theAtom;
-	Atom actualType;
-	int  actualFormat;
-	unsigned long  nitems;
-	unsigned long  bytesAfter;
-	char  *prop;
-
-	theAtom = XInternAtom(dpy, SUN_CMAP_EQUIV_ATOM_NAME, True);
-	if (theAtom == None)
-	    return False;
-
-	if (!XGetWindowProperty(dpy, XRootWindow(dpy, screen_number), theAtom,
-			    0, 8192, False, XA_STRING, &actualType,
-			    &actualFormat, &nitems, &bytesAfter, 
-			    (unsigned char **)&prop)) {
-	     if (prop != NULL) {
-		 Bool ret = areEquiv(prop, pVis1->visualid, pVis2->visualid);
-		 XFree(prop);
-		 return ret;
-	     }
-	}
-	
-	return False;
-}
--- a/open-src/lib/libXmu/sun-src/VisGamma.c	Sat Feb 20 21:16:06 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,599 +0,0 @@
-/*
- * Copyright 1999 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.
- */
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/Xcms.h>
-#include <X11/Xmu/XmuSolaris.h>
-
-/* from X11/Xcmsint.h */
-#define XDCCC_CORRECT_ATOM_NAME            "XDCCC_LINEAR_RGB_CORRECTION"
-
-#define XSOLARIS_STD_GAMMA	2.22
-
-#define MAX_SAMPLES            	16
-
-
-/*
-** The following two routines are taken from libX11/XcmsProp.c.
-*/
-
-/*
- *	NAME
- *		getElement -- get an element value from the property passed
- *
- *	SYNOPSIS
- */
-static unsigned long
-getElement (int format, char **pValue, unsigned long *pCount) 
-/*
- *	DESCRIPTION
- *	    Get the next element from the property and return it.
- *	    Also increment the pointer the amount needed.
- *
- *	Returns
- *	    unsigned long
- */
-{
-    unsigned long value;
-
-    switch (format) {
-      case 32:
-	value = *((unsigned long *)(*pValue));
-	*pValue += 4;
-	*pCount -= 1;
-	break;
-      case 16:
-	value = *((unsigned short *)(*pValue));
-	*pValue += 2;
-	*pCount -= 1;
-	break;
-      case 8:
-	value = *((unsigned char *) (*pValue));
-	*pValue += 1;
-	*pCount -= 1;
-	break;
-      default:
-	value = 0;
-	break;
-    }
-    return(value);
-}
-
-
-/*
- *	NAME
- *		getProperty -- Determine the existance of a property
- *
- *	SYNOPSIS
- */
-static int
-getProperty (Display *pDpy, Window w, Atom property, int *pFormat, unsigned long *pNItems, 
-	     unsigned long *pNBytes, char **pValue) 
-/*
- *	DESCRIPTION
- *
- *	Returns
- *	    0 if property does not exist.
- *	    1 if property exists.
- */
-{
-    char *prop_ret;
-    int format_ret;
-    long len = 6516;
-    unsigned long nitems_ret, after_ret;
-    Atom atom_ret;
-    
-    while (XGetWindowProperty (pDpy, w, property, 0, len, False, 
-			       XA_INTEGER, &atom_ret, &format_ret, 
-			       &nitems_ret, &after_ret, 
-			       (unsigned char **)&prop_ret)) {
-	if (after_ret > 0) {
-	    len += nitems_ret * (format_ret >> 3);
-	    XFree (prop_ret);
-	} else {
-	    break;
-	}
-    }
-    if (format_ret == 0 || nitems_ret == 0) { 
-	/* the property does not exist or is of an unexpected type */
-	return(XcmsFailure);
-    }
-
-    *pFormat = format_ret;
-    *pNItems = nitems_ret;
-    *pNBytes = nitems_ret * (format_ret >> 3);
-    *pValue = prop_ret;
-    return(XcmsSuccess);
-}
-
-/*
-** The following three routines are derived from code in bin/xcmsdb/xcmsdb.c.
-*/
-
-static int
-QueryTableType0 (unsigned int maxcolor, int format, char **pChar, unsigned long *pCount, 
-		 unsigned int *nelem, unsigned short **pph, unsigned int **ppf)
-{
-    unsigned int nElements;
-    unsigned short *ph = NULL;
-    unsigned int   *pf = NULL;
-
-    nElements = getElement(format, pChar, pCount) + 1;
-    *nelem = nElements;
-    if (!(ph = (unsigned short *) malloc(nElements * sizeof(unsigned short))) ||
-        !(pf = (unsigned int *) malloc(nElements * sizeof(unsigned int)))) {
-	goto Bad;
-    }
-    *ppf = pf;
-    *pph = ph;
-
-    switch (format) {
-
-      case 8:
-	while (nElements--) {
-	    /* 0xFFFF/0xFF = 0x101 */
-	    *ph++ = getElement (format, pChar, pCount) * 0x101;
-	    *pf++ = (getElement (format, pChar, pCount)
-		    / (XcmsFloat)255.0) * maxcolor;
-	}
-	break;
-
-      case 16:
-	while (nElements--) {
-	    *ph++ = (unsigned short)getElement (format, pChar, pCount);
-	    *pf++ = (getElement (format, pChar, pCount)
-		    / (XcmsFloat)65535.0) * maxcolor;
-	}
-	break;
-
-      case 32:
-	while (nElements--) {
-	    *ph++ = (unsigned short)getElement (format, pChar, pCount);
-	    *pf++ = (getElement (format, pChar, pCount)
-	            / (XcmsFloat)4294967295.0) * maxcolor;
-	}
-	break;
-
-      default:
-	goto Bad;
-    }
-
-    return (1);
-
-Bad:
-    if (ph) { 
-	free(ph);
-    }
-    if (pf) {
-	free(pf);
-    }
-    *pph = NULL;
-    *ppf = NULL;
-    return (0);
-}
-
-static int
-QueryTableType1 (unsigned int maxcolor, int format, char **pChar, unsigned long *pCount, 
-		 unsigned int *nelem, unsigned short **pph, unsigned int **ppf)
-{
-    int count;
-    unsigned int max_index;
-    unsigned int nElements;
-    unsigned short *ph = NULL;
-    unsigned int   *pf = NULL;
-
-    max_index = getElement(format, pChar, pCount);
-    nElements = max_index + 1;
-    *nelem = nElements;
-
-    if (!(ph = (unsigned short *) malloc(nElements * sizeof(unsigned short))) ||
-        !(pf = (unsigned int *) malloc(nElements * sizeof(unsigned int)))) {
-	goto Bad;
-    }
-    *ppf = pf;
-    *pph = ph;
-
-    switch (format) {
-
-      case 8:
-	for (count = 0; count < nElements; count++) {
-	    *ph++ = count;
-	    *pf++ = ((XcmsFloat) getElement(format, pChar, pCount) / (XcmsFloat)255.0) * 
-		     (XcmsFloat)maxcolor;
-	}
-	break;
-
-      case 16:
-	for (count = 0; count < nElements; count++) {
-	    *ph++ = count;
-	    *pf++ = ((XcmsFloat) getElement(format, pChar, pCount) / (XcmsFloat)65535.0) * 
-	            (XcmsFloat)maxcolor;
-	}
-	break;
-
-      case 32:
-	for (count = 0; count < nElements; count++) {
-	    *ph++ = count;
-	    *pf++ = ((XcmsFloat) getElement (format, pChar, pCount) / (XcmsFloat)4294967295.0) 
-	            * (XcmsFloat)maxcolor;
-	}
-	break;
-
-      default:
-	goto Bad;
-    }
-
-    return (1);
-
-Bad:
-    if (ph) { 
-	free(ph);
-    }
-    if (pf) {
-	free(pf);
-    }
-    *pph = NULL;
-    *ppf = NULL;
-    return (0);
-}
-
-
-/*
-** If the given n pairs (hi, fi) approximate a power function with the
-** relation h = f**exp, the exponent exp is returned.
-*/
-
-static double
-exponentOfPowerFunc (unsigned int maxh, unsigned int maxf, int n, unsigned short *ph, 
-		     unsigned int *pf)
-{
-    unsigned short h;
-    unsigned int   f;
-    double logh, logf;
-    int    i, nsamples, incr;
-    double sum, logmaxh, logmaxf, denom;
-
-    incr = n / MAX_SAMPLES;
-    if (incr < 1) {
-	incr = 1;
-    }
-    logmaxh = log((double)maxh);
-    logmaxf = log((double)maxf);
-    sum = 0;
-    nsamples = 0;
-    
-    for (i = (incr>>1); i < n; i += incr) {
-	h = ph[i];
-	f = pf[i];
-	if (h == 0 || f == 0) {
-	    continue;
-	}
-	logh = log((double) h);
-	logf = log((double) f);
-	denom = logh - logmaxh;
-	if (denom) {
-	    sum += (logf - logmaxf) / denom;
-	    nsamples++;
-	}
-    }
-
-    if (nsamples == 0) {
-	/* Note: as good as anything else */
-	return(XSOLARIS_STD_GAMMA);
-    } else {
-	return(sum/nsamples);
-    }
-}
-
-
-/* 
-** Updates the current prop element pointer to point beyond the current channel.
-** Upon entry, pChar should point to the length element of the channel.
-**
-** Returns 0 if the property contents are invalid, 1 otherwise.
-*/
-
-static int
-skipChannel (int cType, int format, char **pChar, unsigned long *pCount)
-{
-    unsigned int nElements, length;
-
-    if ((long)*pCount <= 0) {
-	return (0);
-    }
-    length = getElement(format, pChar, pCount) + 1;
-    
-    nElements = ((cType == 0) ? 2 : 1) * length;
-    if ((long)nElements > *pCount) {
-	return (0);
-    }
-
-    while (nElements--) {
-	(void) getElement (format, pChar, pCount);
-    }
-
-    return (1);
-}
-
-/* 
-** Updates the current prop element pointer to point beyond the current visual.
-** Upon entry, pChar should point to the type element immediately following
-** the visualID elemnt.
-**
-** Returns 0 if the property contents are invalid, 1 otherwise.
-*/
-
-static int
-skipVisual (int format, char **pChar, unsigned long *pCount)
-{
-    int cType, nTables;
-
-    /* Get table type */
-    if ((long)*pCount <= 0) {
-	return (0);
-    }
-    cType = (int)getElement(format, pChar, pCount);
-    if (cType != 0 && cType != 1) {
-	return (0);
-    }
-
-    /* Get number of channels */
-    if ((long)*pCount <= 0) {
-	return (0);
-    }
-    nTables = (int)getElement(format, pChar, pCount);
-    if (nTables != 1 && nTables != 3) {
-	return (0);
-    }
-
-    /* Skip red channel */
-    if (!skipChannel(cType, format, pChar, pCount)) {
-	return (0);
-    }
-
-    if (nTables > 1) {
-
-	/* Skip green channel */
-	if (!skipChannel(cType, format, pChar, pCount)) {
-	    return (0);
-	}
-
-	/* Skip blue channel */
-	if (!skipChannel(cType, format, pChar, pCount)) {
-	    return (0);
-	}
-    }
-
-    return (1);
-}
-
-
-static int XSolarisGetVisualGammaCalledFlag = 0;
-
-int
-XSolarisGetVisualGammaCalled ()
-{
-    return (XSolarisGetVisualGammaCalledFlag);
-}
-
-/*
-** Note: this function ignores the green and blue intensity correction
-** data; it assumes that these are the same as the red channel.
-*/
-
-Status
-XSolarisGetVisualGamma (Display *dpy, int screen_number, Visual *visual,
-			double *gamma)
-{
-    char *property_return = NULL, *pChar;
-    int  count, format, cType, nTables;
-    unsigned long nitems = 0;
-    unsigned long nbytes_return;
-    Atom CorrectAtom;
-    VisualID visualID;
-    unsigned int maxcolor, nelem;
-    unsigned short *ph;
-    unsigned int   *pf;
-
-    XSolarisGetVisualGammaCalledFlag = 1;
-
-    /*
-     * Get Intensity Tables
-     */
-    CorrectAtom = XInternAtom (dpy, XDCCC_CORRECT_ATOM_NAME, False);
-    if (CorrectAtom != None) {
-	if (getProperty (dpy, XRootWindow(dpy, screen_number), CorrectAtom, 
-			      &format, &nitems, &nbytes_return, 
-			      &property_return) == XcmsFailure) {
-
-	    *gamma = XSOLARIS_STD_GAMMA;
-	    return (Success);
-
-	} else if ((long)nitems <= 0) {
-
-	    /* use standard gamma */
-	    if (property_return) {
-		XFree (property_return);
-	    }
-
-	    *gamma = XSOLARIS_STD_GAMMA;
-	    return (Success);
-	}
-    }
-
-    pChar = property_return;
-
-    /* Note: nitems is decremented as a side-effect of calling getElement */
-    while (nitems) {
-	
-	switch (format) {
-
-	case 8:
-
-	    /*
-	     * Must have at least:
-	     *		VisualID0
-	     *		VisualID1
-	     *		VisualID2
-	     *		VisualID3
-	     *		type
-	     *		count
-	     *		length
-	     *		intensity1
-	     *		intensity2
-	     */
-	    if (nitems < 9) {
-		XFree (property_return);
-		return (BadMatch);
-	    }
-	    count = 3;
-	    break;
-
-	      case 16:
-	    /*
-	     * Must have at least:
-	     *		VisualID0
-	     *		VisualID3
-	     *		type
-	     *		count
-	     *		length
-	     *		intensity1
-	     *		intensity2
-	     */
-	    if (nitems < 7) {
-		XFree (property_return);
-		return (BadMatch);
-	    }
-	    count = 1;
-	    break;
-
-	case 32:
-	    /*
-	     * Must have at least:
-	     *		VisualID0
-	     *		type
-	     *		count
-	     *		length
-	     *		intensity1
-	     *		intensity2
-	     */
-	    if (nitems < 6) {
-		XFree (property_return);
-		return (BadMatch);
-	    }
-	    count = 0;
-	    break;
-	    
-	default:
-	    XFree (property_return);
-	    return (BadMatch);
-	}
-	
-	/* Get VisualID */
-	visualID = getElement(format, &pChar, &nitems);
-	while (count--) {
-	    visualID = visualID << format;
-	    visualID |= getElement(format, &pChar, &nitems);
-	}
-	if (visual->visualid != visualID) {
-	    if (!skipVisual(format, &pChar, &nitems)) {
-		XFree (property_return);
-		return (BadMatch);
-	    }
-	    continue;
-	}
-
-	/* Found the visual */
-	maxcolor = 0xffff;
-
-	/* Get table type and number of channels */
-	cType = (int)getElement(format, &pChar, &nitems);
-	nTables = (int)getElement(format, &pChar, &nitems);
-
-	/* 
-	** Note: it is assumed that the per-channel maps in the table all have
-	** the same length.  This is a safe bet for most hardware, as it depends
-	** not on the visual masks but on the visual bits_per_rgb.  Thus, we
-	** extract the information from the red channel map and ignore the rest.
-	*/
-
-	switch (cType) {
-
-	case 0:
-	    if (!QueryTableType0(maxcolor, format, &pChar, &nitems, &nelem, &ph, &pf)) {
-		XFree (property_return);
-		return (BadMatch);
-	    }
-            if (nelem == 2 && 
-		*ph == 0 && *pf == 0 &&
-		*(ph+1) == maxcolor && *(pf+1) == maxcolor) {
-		/* exactly linear */
-		*gamma = 1.0;
-	    } else {
-		*gamma = exponentOfPowerFunc(maxcolor, maxcolor, (int)nelem, ph, pf);
-	    }
-	    break;
-
-	case 1:
-	    if (!QueryTableType1(maxcolor, format, &pChar, &nitems, &nelem, &ph, &pf)) {
-		XFree (property_return);
-		return (BadMatch);
-	    }
-	    *gamma = exponentOfPowerFunc((1<<visual->bits_per_rgb)-1, maxcolor, (int)nelem, ph, pf);
-	    break;
-
-	default:
-	    XFree (property_return);
-	    return (BadMatch);
-	}
-
-	XFree (property_return);
-
-	/* These were allocated in the QueryTableType<n> routines and 
-	   must be freed now */
-	if (ph) {
-	    free(ph);
-	}
-	if (pf) {
-	    free(pf);
-	}
-
-	return (Success);
-    }    
-    /* bug fix for 4248958: OPENGL program shows mem leak in libdga*/
-    if(property_return) XFree (property_return);
-
-    *gamma = XSOLARIS_STD_GAMMA;
-    return (Success);
-}
-
--- a/open-src/lib/libXmu/sun-src/XmuSolaris.h	Sat Feb 20 21:16:06 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/* Copyright 1996 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.
- */
-
-#ifndef __XMUSOLARIS_H__
-#define __XMUSOLARIS_H__
-
-#include <X11/Xlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-Status XSolarisGetVisualGamma (Display *dpy, int screen_number, Visual *visual,
-			double *gamma);
-
-Bool XSolarisCheckColormapEquivalence(Display *dpy,  int screen_number,
-				Visual *pVis1, Visual* pVis2);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XMUSOLARIS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/libXmu/sun-src/include/X11/Xmu/XmuSolaris.h	Mon Feb 22 16:19:24 2010 -0800
@@ -0,0 +1,48 @@
+/* Copyright 1996 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.
+ */
+
+#ifndef __XMUSOLARIS_H__
+#define __XMUSOLARIS_H__
+
+#include <X11/Xlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+Status XSolarisGetVisualGamma (Display *dpy, int screen_number, Visual *visual,
+			double *gamma);
+
+Bool XSolarisCheckColormapEquivalence(Display *dpy,  int screen_number,
+				Visual *pVis1, Visual* pVis2);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XMUSOLARIS_H__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/libXmu/sun-src/src/CmapEquiv.c	Mon Feb 22 16:19:24 2010 -0800
@@ -0,0 +1,192 @@
+/*
+ * Copyright 1996 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.
+ */
+
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xmu/XmuSolaris.h>
+
+#if defined(DEBUG)
+#include <stdio.h>
+#endif
+
+#define INIT_LIST_SIZE 100
+
+/*
+ * Get's next pair of integers from a string
+ */
+static VisualID
+getNextEntry(char **pp)
+{
+    char  *newP;
+    VisualID	  entry;
+
+    entry = strtoul(*pp, &newP, 0);
+    if (newP == *pp) {
+	return 0;
+    }
+    *pp = newP;
+
+    return entry;
+}
+
+/*
+ * Build a list of VisualIds that are equivalant to vidIn
+ *
+ * The format of the property string is a sequence of lists of
+ * integers separated by a newline.
+ * The first entry in each is the number of elements in the list.
+ * The list of ids follows.
+ */
+static VisualID *
+buildList(char *string, VisualID vidIn, VisualID *pOriginalList)
+{
+    VisualID  	*pList;
+    char 	*p = string;
+    int	 	num;
+
+#ifdef DEBUG
+    (void) memset(pOriginalList, 0, sizeof(VisualID)*INIT_LIST_SIZE);
+#endif
+
+    while (num = strtoul(p, &p, 0)) {
+	int foundIt = 0;
+	int i;
+	if ((num + 1) > INIT_LIST_SIZE) {
+	    pList = (VisualID *) malloc((num + 1) * sizeof(VisualID));
+	    if (pList == NULL)
+		return NULL;
+	} else {
+	    pList = pOriginalList;
+	}
+	for (i=0; i < num; i++) {
+	    /* Build the list of VisualIDs equivalent to v */
+	    VisualID vid;
+	    if (vid = getNextEntry(&p)) {
+		pList[i] = vid;
+		if (vid == vidIn)
+		    foundIt = 1;
+	    } else {
+	        /* string is formatted wrong */
+#ifdef DEBUG
+		fprintf(stderr, "property string is formatted wrong: %s\n",
+			string);
+#endif
+	        break;
+	    }
+	}
+#ifdef DEBUG
+	if (*p != '\n')
+	    fprintf(stderr, "property string is missing a newline: %s\n",
+			string);
+#endif
+	if (foundIt) {
+	    /* terminate the list */
+	    pList[num] = 0;
+	    break;
+	}
+	if (pList != pOriginalList)
+	    free(pList);
+	pList = NULL;
+    }
+
+    return pList;
+}
+
+
+static int
+searchList(VisualID *pList, VisualID v)
+{
+	int i;
+	for (i=0; pList[i] != 0; i++) {
+	    if (pList[i] == v)
+		return 1;
+	}
+	return 0;
+}
+
+static Bool
+areEquiv(char *pPropString, VisualID v1, VisualID v2)
+{
+	VisualID list[INIT_LIST_SIZE];
+	VisualID *pList;
+	Bool foundMatch = False;
+
+	/*
+	 * Build a list of VisualIDS which are equivalent to v1
+	 * using the array list if it fits.
+	 */
+	pList = buildList(pPropString, v1, list);
+	if (pList == NULL)
+	    return False;
+
+	/* now see if v2 is in the list */
+	if (searchList(pList, v2)) {
+	    foundMatch  = True;
+	}
+
+	if (pList != list)
+	    free(pList);
+
+	return foundMatch;
+}
+
+#define SUN_CMAP_EQUIV_ATOM_NAME "_SUN_CMAP_EQUIV"
+
+Bool
+XSolarisCheckColormapEquivalence(Display *dpy,  int screen_number, 
+				Visual *pVis1, Visual* pVis2)
+{
+	Atom theAtom;
+	Atom actualType;
+	int  actualFormat;
+	unsigned long  nitems;
+	unsigned long  bytesAfter;
+	char  *prop;
+
+	theAtom = XInternAtom(dpy, SUN_CMAP_EQUIV_ATOM_NAME, True);
+	if (theAtom == None)
+	    return False;
+
+	if (!XGetWindowProperty(dpy, XRootWindow(dpy, screen_number), theAtom,
+			    0, 8192, False, XA_STRING, &actualType,
+			    &actualFormat, &nitems, &bytesAfter, 
+			    (unsigned char **)&prop)) {
+	     if (prop != NULL) {
+		 Bool ret = areEquiv(prop, pVis1->visualid, pVis2->visualid);
+		 XFree(prop);
+		 return ret;
+	     }
+	}
+	
+	return False;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/libXmu/sun-src/src/VisGamma.c	Mon Feb 22 16:19:24 2010 -0800
@@ -0,0 +1,599 @@
+/*
+ * Copyright 1999 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.
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xcms.h>
+#include <X11/Xmu/XmuSolaris.h>
+
+/* from X11/Xcmsint.h */
+#define XDCCC_CORRECT_ATOM_NAME            "XDCCC_LINEAR_RGB_CORRECTION"
+
+#define XSOLARIS_STD_GAMMA	2.22
+
+#define MAX_SAMPLES            	16
+
+
+/*
+** The following two routines are taken from libX11/XcmsProp.c.
+*/
+
+/*
+ *	NAME
+ *		getElement -- get an element value from the property passed
+ *
+ *	SYNOPSIS
+ */
+static unsigned long
+getElement (int format, char **pValue, unsigned long *pCount) 
+/*
+ *	DESCRIPTION
+ *	    Get the next element from the property and return it.
+ *	    Also increment the pointer the amount needed.
+ *
+ *	Returns
+ *	    unsigned long
+ */
+{
+    unsigned long value;
+
+    switch (format) {
+      case 32:
+	value = *((unsigned long *)(*pValue));
+	*pValue += 4;
+	*pCount -= 1;
+	break;
+      case 16:
+	value = *((unsigned short *)(*pValue));
+	*pValue += 2;
+	*pCount -= 1;
+	break;
+      case 8:
+	value = *((unsigned char *) (*pValue));
+	*pValue += 1;
+	*pCount -= 1;
+	break;
+      default:
+	value = 0;
+	break;
+    }
+    return(value);
+}
+
+
+/*
+ *	NAME
+ *		getProperty -- Determine the existance of a property
+ *
+ *	SYNOPSIS
+ */
+static int
+getProperty (Display *pDpy, Window w, Atom property, int *pFormat, unsigned long *pNItems, 
+	     unsigned long *pNBytes, char **pValue) 
+/*
+ *	DESCRIPTION
+ *
+ *	Returns
+ *	    0 if property does not exist.
+ *	    1 if property exists.
+ */
+{
+    char *prop_ret;
+    int format_ret;
+    long len = 6516;
+    unsigned long nitems_ret, after_ret;
+    Atom atom_ret;
+    
+    while (XGetWindowProperty (pDpy, w, property, 0, len, False, 
+			       XA_INTEGER, &atom_ret, &format_ret, 
+			       &nitems_ret, &after_ret, 
+			       (unsigned char **)&prop_ret)) {
+	if (after_ret > 0) {
+	    len += nitems_ret * (format_ret >> 3);
+	    XFree (prop_ret);
+	} else {
+	    break;
+	}
+    }
+    if (format_ret == 0 || nitems_ret == 0) { 
+	/* the property does not exist or is of an unexpected type */
+	return(XcmsFailure);
+    }
+
+    *pFormat = format_ret;
+    *pNItems = nitems_ret;
+    *pNBytes = nitems_ret * (format_ret >> 3);
+    *pValue = prop_ret;
+    return(XcmsSuccess);
+}
+
+/*
+** The following three routines are derived from code in bin/xcmsdb/xcmsdb.c.
+*/
+
+static int
+QueryTableType0 (unsigned int maxcolor, int format, char **pChar, unsigned long *pCount, 
+		 unsigned int *nelem, unsigned short **pph, unsigned int **ppf)
+{
+    unsigned int nElements;
+    unsigned short *ph = NULL;
+    unsigned int   *pf = NULL;
+
+    nElements = getElement(format, pChar, pCount) + 1;
+    *nelem = nElements;
+    if (!(ph = (unsigned short *) malloc(nElements * sizeof(unsigned short))) ||
+        !(pf = (unsigned int *) malloc(nElements * sizeof(unsigned int)))) {
+	goto Bad;
+    }
+    *ppf = pf;
+    *pph = ph;
+
+    switch (format) {
+
+      case 8:
+	while (nElements--) {
+	    /* 0xFFFF/0xFF = 0x101 */
+	    *ph++ = getElement (format, pChar, pCount) * 0x101;
+	    *pf++ = (getElement (format, pChar, pCount)
+		    / (XcmsFloat)255.0) * maxcolor;
+	}
+	break;
+
+      case 16:
+	while (nElements--) {
+	    *ph++ = (unsigned short)getElement (format, pChar, pCount);
+	    *pf++ = (getElement (format, pChar, pCount)
+		    / (XcmsFloat)65535.0) * maxcolor;
+	}
+	break;
+
+      case 32:
+	while (nElements--) {
+	    *ph++ = (unsigned short)getElement (format, pChar, pCount);
+	    *pf++ = (getElement (format, pChar, pCount)
+	            / (XcmsFloat)4294967295.0) * maxcolor;
+	}
+	break;
+
+      default:
+	goto Bad;
+    }
+
+    return (1);
+
+Bad:
+    if (ph) { 
+	free(ph);
+    }
+    if (pf) {
+	free(pf);
+    }
+    *pph = NULL;
+    *ppf = NULL;
+    return (0);
+}
+
+static int
+QueryTableType1 (unsigned int maxcolor, int format, char **pChar, unsigned long *pCount, 
+		 unsigned int *nelem, unsigned short **pph, unsigned int **ppf)
+{
+    int count;
+    unsigned int max_index;
+    unsigned int nElements;
+    unsigned short *ph = NULL;
+    unsigned int   *pf = NULL;
+
+    max_index = getElement(format, pChar, pCount);
+    nElements = max_index + 1;
+    *nelem = nElements;
+
+    if (!(ph = (unsigned short *) malloc(nElements * sizeof(unsigned short))) ||
+        !(pf = (unsigned int *) malloc(nElements * sizeof(unsigned int)))) {
+	goto Bad;
+    }
+    *ppf = pf;
+    *pph = ph;
+
+    switch (format) {
+
+      case 8:
+	for (count = 0; count < nElements; count++) {
+	    *ph++ = count;
+	    *pf++ = ((XcmsFloat) getElement(format, pChar, pCount) / (XcmsFloat)255.0) * 
+		     (XcmsFloat)maxcolor;
+	}
+	break;
+
+      case 16:
+	for (count = 0; count < nElements; count++) {
+	    *ph++ = count;
+	    *pf++ = ((XcmsFloat) getElement(format, pChar, pCount) / (XcmsFloat)65535.0) * 
+	            (XcmsFloat)maxcolor;
+	}
+	break;
+
+      case 32:
+	for (count = 0; count < nElements; count++) {
+	    *ph++ = count;
+	    *pf++ = ((XcmsFloat) getElement (format, pChar, pCount) / (XcmsFloat)4294967295.0) 
+	            * (XcmsFloat)maxcolor;
+	}
+	break;
+
+      default:
+	goto Bad;
+    }
+
+    return (1);
+
+Bad:
+    if (ph) { 
+	free(ph);
+    }
+    if (pf) {
+	free(pf);
+    }
+    *pph = NULL;
+    *ppf = NULL;
+    return (0);
+}
+
+
+/*
+** If the given n pairs (hi, fi) approximate a power function with the
+** relation h = f**exp, the exponent exp is returned.
+*/
+
+static double
+exponentOfPowerFunc (unsigned int maxh, unsigned int maxf, int n, unsigned short *ph, 
+		     unsigned int *pf)
+{
+    unsigned short h;
+    unsigned int   f;
+    double logh, logf;
+    int    i, nsamples, incr;
+    double sum, logmaxh, logmaxf, denom;
+
+    incr = n / MAX_SAMPLES;
+    if (incr < 1) {
+	incr = 1;
+    }
+    logmaxh = log((double)maxh);
+    logmaxf = log((double)maxf);
+    sum = 0;
+    nsamples = 0;
+    
+    for (i = (incr>>1); i < n; i += incr) {
+	h = ph[i];
+	f = pf[i];
+	if (h == 0 || f == 0) {
+	    continue;
+	}
+	logh = log((double) h);
+	logf = log((double) f);
+	denom = logh - logmaxh;
+	if (denom) {
+	    sum += (logf - logmaxf) / denom;
+	    nsamples++;
+	}
+    }
+
+    if (nsamples == 0) {
+	/* Note: as good as anything else */
+	return(XSOLARIS_STD_GAMMA);
+    } else {
+	return(sum/nsamples);
+    }
+}
+
+
+/* 
+** Updates the current prop element pointer to point beyond the current channel.
+** Upon entry, pChar should point to the length element of the channel.
+**
+** Returns 0 if the property contents are invalid, 1 otherwise.
+*/
+
+static int
+skipChannel (int cType, int format, char **pChar, unsigned long *pCount)
+{
+    unsigned int nElements, length;
+
+    if ((long)*pCount <= 0) {
+	return (0);
+    }
+    length = getElement(format, pChar, pCount) + 1;
+    
+    nElements = ((cType == 0) ? 2 : 1) * length;
+    if ((long)nElements > *pCount) {
+	return (0);
+    }
+
+    while (nElements--) {
+	(void) getElement (format, pChar, pCount);
+    }
+
+    return (1);
+}
+
+/* 
+** Updates the current prop element pointer to point beyond the current visual.
+** Upon entry, pChar should point to the type element immediately following
+** the visualID elemnt.
+**
+** Returns 0 if the property contents are invalid, 1 otherwise.
+*/
+
+static int
+skipVisual (int format, char **pChar, unsigned long *pCount)
+{
+    int cType, nTables;
+
+    /* Get table type */
+    if ((long)*pCount <= 0) {
+	return (0);
+    }
+    cType = (int)getElement(format, pChar, pCount);
+    if (cType != 0 && cType != 1) {
+	return (0);
+    }
+
+    /* Get number of channels */
+    if ((long)*pCount <= 0) {
+	return (0);
+    }
+    nTables = (int)getElement(format, pChar, pCount);
+    if (nTables != 1 && nTables != 3) {
+	return (0);
+    }
+
+    /* Skip red channel */
+    if (!skipChannel(cType, format, pChar, pCount)) {
+	return (0);
+    }
+
+    if (nTables > 1) {
+
+	/* Skip green channel */
+	if (!skipChannel(cType, format, pChar, pCount)) {
+	    return (0);
+	}
+
+	/* Skip blue channel */
+	if (!skipChannel(cType, format, pChar, pCount)) {
+	    return (0);
+	}
+    }
+
+    return (1);
+}
+
+
+static int XSolarisGetVisualGammaCalledFlag = 0;
+
+int
+XSolarisGetVisualGammaCalled ()
+{
+    return (XSolarisGetVisualGammaCalledFlag);
+}
+
+/*
+** Note: this function ignores the green and blue intensity correction
+** data; it assumes that these are the same as the red channel.
+*/
+
+Status
+XSolarisGetVisualGamma (Display *dpy, int screen_number, Visual *visual,
+			double *gamma)
+{
+    char *property_return = NULL, *pChar;
+    int  count, format, cType, nTables;
+    unsigned long nitems = 0;
+    unsigned long nbytes_return;
+    Atom CorrectAtom;
+    VisualID visualID;
+    unsigned int maxcolor, nelem;
+    unsigned short *ph;
+    unsigned int   *pf;
+
+    XSolarisGetVisualGammaCalledFlag = 1;
+
+    /*
+     * Get Intensity Tables
+     */
+    CorrectAtom = XInternAtom (dpy, XDCCC_CORRECT_ATOM_NAME, False);
+    if (CorrectAtom != None) {
+	if (getProperty (dpy, XRootWindow(dpy, screen_number), CorrectAtom, 
+			      &format, &nitems, &nbytes_return, 
+			      &property_return) == XcmsFailure) {
+
+	    *gamma = XSOLARIS_STD_GAMMA;
+	    return (Success);
+
+	} else if ((long)nitems <= 0) {
+
+	    /* use standard gamma */
+	    if (property_return) {
+		XFree (property_return);
+	    }
+
+	    *gamma = XSOLARIS_STD_GAMMA;
+	    return (Success);
+	}
+    }
+
+    pChar = property_return;
+
+    /* Note: nitems is decremented as a side-effect of calling getElement */
+    while (nitems) {
+	
+	switch (format) {
+
+	case 8:
+
+	    /*
+	     * Must have at least:
+	     *		VisualID0
+	     *		VisualID1
+	     *		VisualID2
+	     *		VisualID3
+	     *		type
+	     *		count
+	     *		length
+	     *		intensity1
+	     *		intensity2
+	     */
+	    if (nitems < 9) {
+		XFree (property_return);
+		return (BadMatch);
+	    }
+	    count = 3;
+	    break;
+
+	      case 16:
+	    /*
+	     * Must have at least:
+	     *		VisualID0
+	     *		VisualID3
+	     *		type
+	     *		count
+	     *		length
+	     *		intensity1
+	     *		intensity2
+	     */
+	    if (nitems < 7) {
+		XFree (property_return);
+		return (BadMatch);
+	    }
+	    count = 1;
+	    break;
+
+	case 32:
+	    /*
+	     * Must have at least:
+	     *		VisualID0
+	     *		type
+	     *		count
+	     *		length
+	     *		intensity1
+	     *		intensity2
+	     */
+	    if (nitems < 6) {
+		XFree (property_return);
+		return (BadMatch);
+	    }
+	    count = 0;
+	    break;
+	    
+	default:
+	    XFree (property_return);
+	    return (BadMatch);
+	}
+	
+	/* Get VisualID */
+	visualID = getElement(format, &pChar, &nitems);
+	while (count--) {
+	    visualID = visualID << format;
+	    visualID |= getElement(format, &pChar, &nitems);
+	}
+	if (visual->visualid != visualID) {
+	    if (!skipVisual(format, &pChar, &nitems)) {
+		XFree (property_return);
+		return (BadMatch);
+	    }
+	    continue;
+	}
+
+	/* Found the visual */
+	maxcolor = 0xffff;
+
+	/* Get table type and number of channels */
+	cType = (int)getElement(format, &pChar, &nitems);
+	nTables = (int)getElement(format, &pChar, &nitems);
+
+	/* 
+	** Note: it is assumed that the per-channel maps in the table all have
+	** the same length.  This is a safe bet for most hardware, as it depends
+	** not on the visual masks but on the visual bits_per_rgb.  Thus, we
+	** extract the information from the red channel map and ignore the rest.
+	*/
+
+	switch (cType) {
+
+	case 0:
+	    if (!QueryTableType0(maxcolor, format, &pChar, &nitems, &nelem, &ph, &pf)) {
+		XFree (property_return);
+		return (BadMatch);
+	    }
+            if (nelem == 2 && 
+		*ph == 0 && *pf == 0 &&
+		*(ph+1) == maxcolor && *(pf+1) == maxcolor) {
+		/* exactly linear */
+		*gamma = 1.0;
+	    } else {
+		*gamma = exponentOfPowerFunc(maxcolor, maxcolor, (int)nelem, ph, pf);
+	    }
+	    break;
+
+	case 1:
+	    if (!QueryTableType1(maxcolor, format, &pChar, &nitems, &nelem, &ph, &pf)) {
+		XFree (property_return);
+		return (BadMatch);
+	    }
+	    *gamma = exponentOfPowerFunc((1<<visual->bits_per_rgb)-1, maxcolor, (int)nelem, ph, pf);
+	    break;
+
+	default:
+	    XFree (property_return);
+	    return (BadMatch);
+	}
+
+	XFree (property_return);
+
+	/* These were allocated in the QueryTableType<n> routines and 
+	   must be freed now */
+	if (ph) {
+	    free(ph);
+	}
+	if (pf) {
+	    free(pf);
+	}
+
+	return (Success);
+    }    
+    /* bug fix for 4248958: OPENGL program shows mem leak in libdga*/
+    if(property_return) XFree (property_return);
+
+    *gamma = XSOLARIS_STD_GAMMA;
+    return (Success);
+}
+
--- a/open-src/lib/libXtsol/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/libXtsol/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,8 +2,8 @@
 #
 # Xtsol 1.x Makefile
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use subject to license terms.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+# Use is 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
@@ -40,6 +40,7 @@
 SOURCE_TARBALL_NAME=NONE
 SOURCE_TARBALL_NAME_SET=yes
 ADDITIONAL_SOURCE_DIR=sun-src
+MODULE_ADD_SOURCE_TARGETS=source_auditwrite
 
 # Library name (used for specfiles/mapfiles)
 LIBNAME=Xtsol
@@ -60,7 +61,7 @@
 
 include ../Makefile.inc
 
-source_gen:: $(LNDIR)
+source_auditwrite:
 	mkdir -p $(SOURCE_DIR)
 	(cd $(SOURCE_DIR) ; \
 	 ln -s ../../../../xserver/xorg/sun-src/tsol/auditwrite.[ch] . )
--- a/open-src/lib/liblbxutil/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/liblbxutil/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -64,4 +64,4 @@
 include ../Makefile.inc
 
 # Clean up old 64-bit builds from before we stopped building them
-clean:: clean_64
+clean: clean_64
--- a/open-src/lib/libpciaccess/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/lib/libpciaccess/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -2,7 +2,7 @@
 #
 # libpciaccess Makefile
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -69,7 +69,7 @@
 include ../Makefile.inc
 
 # Update scanpci.man with program man page flags instead of library ones
-source_scanpci_man:: default_source
+source_scanpci_man: default_source
 	(cd $(SOURCE_DIR) && \
 	 /usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
 	        -a '{Availability, $(SUN_PACKAGE)}' \
@@ -80,7 +80,7 @@
 		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
 	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	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/proto/sun-ext-protos/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -41,7 +41,7 @@
 CONFIGURE_TARGETS_SET=yes
 BUILD_TARGETS=
 BUILD_TARGETS_SET=yes
-INSTALL_TARGETS=
+INSTALL_TARGETS=install_sun_headers
 INSTALL_TARGETS_SET=yes
 FIX_PC_FILES=
 FIX_PC_FILES_SET=yes
@@ -52,6 +52,6 @@
 DESTDIR=$(PROTODIR)
 INSTDIR=$(DESTDIR)$(X11_INCLUDES_DIR)/X11/extensions
 
-install_gen::
+install_sun_headers:
 	mkdir -p $(INSTDIR)
 	cp -pf include/*h $(INSTDIR)/
--- a/open-src/util/util-macros/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/util/util-macros/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -1,6 +1,6 @@
 ###############################################################################
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -39,13 +39,16 @@
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES=	
 
+# Additional install rules beyond what upstream installs
+MODULE_ADD_INSTALL_TARGETS=install_libtool_fix
+
 ### Include common rulesets
 include ../Makefile.inc
 
 # Libtool versions before 2.2.2 fail to work with LD=cc in 64 bit builds, 
 # so install fixed libtool m4 macros here as well, so that modules that
 # run autoreconf get the fixed sources
-install_gen::
+install_libtool_fix:
 	mkdir -p $(PROTODIR)$(X11_ACLOCAL_DIR)/
 	-rm -f $(PROTODIR)$(X11_ACLOCAL_DIR)/libtool.m4
 	SYSTEM_ACLOCAL_DIR=$$($(ACLOCAL_PATH) --print-ac-dir) ; \
--- a/open-src/xserver/xorg/Makefile	Sat Feb 20 21:16:06 2010 -0800
+++ b/open-src/xserver/xorg/Makefile	Mon Feb 22 16:19:24 2010 -0800
@@ -92,19 +92,21 @@
 MODULE_MAKE=$(GNUMAKE)
 MODULE_MAKE_SET=yes
 
-include ../Makefile.inc
-
 # Additional install targets beyond the defaults
-# - install_pc can't be in INSTALL_TARGETS or MODULE_ADD_INSTALL_TARGETS
-#   without causing a dependency loop that breaks dmake
+MODULE_ADD_INSTALL_TARGETS=install_extras install_mdb install_pc_common
 EXTRA_INSTALL_sparc=install_pc_copy
 EXTRA_INSTALL_i386=
-install_gen:: install_extras install_pc_common $(EXTRA_INSTALL_$(MACH))
-install_gen:: install_mdb
+MODULE_ADD_INSTALL_TARGETS += $(EXTRA_INSTALL_$(MACH))
+
+# Have to avoid dependency loop between install_pc_copy and 
+# install_pkgconfig_uninstalled
+INSTALL_PCU_DEPS = $(INSTALL_TARGETS:install_pc_copy=)
+INSTALL_PCU_DEPS_SET=yes
 
 # Merge in additional sources from sun-src directory
-source_gen:: $(LNDIR)
-	(cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
+ADDITIONAL_SOURCE_DIR=sun-src
+
+include ../Makefile.inc
 
 $(XORGSERVER_BIN): default_build