6963229 build race conditions and other makefile issues
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Tue, 22 Jun 2010 13:56:05 -0700
changeset 967 efbd0ee6805d
parent 966 f9a3c33706b9
child 968 e128a41c4cea
6963229 build race conditions and other makefile issues
buildit
open-src/Makefile
open-src/app/Makefile
open-src/app/Makefile.inc
open-src/app/xdm/Makefile
open-src/common/Makefile.inc
open-src/common/Makefile.init
open-src/common/Makefile.subdirs
open-src/data/Makefile
open-src/data/Makefile.inc
open-src/doc/Makefile
open-src/doc/Makefile.inc
open-src/driver/Makefile
open-src/driver/Makefile.inc
open-src/font/Makefile
open-src/font/Makefile.bdf
open-src/font/Makefile.inc
open-src/font/Makefile.ttf
open-src/lib/DPS/sun-src/Makefile
open-src/lib/Makefile
open-src/lib/Makefile.inc
open-src/lib/fontconfig/Makefile
open-src/lib/freetype/Makefile
open-src/lib/libpciaccess/Makefile
open-src/lib/mesa/Makefile
open-src/proto/Makefile
open-src/proto/Makefile.inc
open-src/util/Makefile
open-src/util/Makefile.inc
open-src/util/build-tools/xmake
open-src/xserver/Makefile
open-src/xserver/Makefile.inc
--- a/buildit	Mon Jun 21 13:12:49 2010 -0700
+++ b/buildit	Tue Jun 22 13:56:05 2010 -0700
@@ -30,26 +30,28 @@
 #
 #
 
-MAKE_PKGS=0
+# Add /usr/bin to front of path in case user has /usr/gnu/bin default
+# Add /usr/sbin to path for dtrace (to build probes in X servers)
+
+PATH=/usr/bin:${PATH}:/usr/sbin
+export PATH
 
-set -- $(getopt p $*)
+MAKE_PKGS=0
+VERBOSE_FLAGS=""	# verbosity flags passed to xmake
+
+set -- $(getopt pv $*)
 if [ $? != 0 ] ; then
-    print -u2 USAGE: $0 [-p]
+    print -u2 USAGE: $0 [-p] [-v]
     exit 2
 fi
 
 for i in $* ; do 
     case $i in
 	-p)     MAKE_PKGS=1; shift;;
+	-v)     VERBOSE_FLAGS="-v"; shift;;
     esac
 done
 
-# Add /usr/bin to front of path in case user has /usr/gnu/bin default
-# Add /usr/sbin to path for dtrace (to build probes in X servers)
-
-PATH=/usr/bin:${PATH}:/usr/sbin
-export PATH
-
 [ -d log ] || mkdir log
 
 # Send all further output & errors to the log file
@@ -87,13 +89,13 @@
     /bin/rm -rf proto-sun4-svr4
 fi
 
-XMAKE="$(pwd)/open-src/util/build-tools/xmake"
+XMAKE="$(pwd)/open-src/util/build-tools/xmake -k ${VERBOSE_FLAGS}"
 
 cd open-src
 # Run as two steps to avoid race between cleaning & rebuilding when
 # using parallel make
-${XMAKE} -v -k clean 
-${XMAKE} -v -k install
+${XMAKE} clean
+${XMAKE} install
 cd ..
 
 print "\nFinished building the X Window System Consolidation for OpenSolaris.\n"
--- a/open-src/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source bits
 #
-# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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,8 +43,9 @@
 # - font depends on utils like mkfontdir from app
 
 # High level dependencies
-proto: util/util-macros
-lib: proto
+proto: util/util-macros util/lndir
+lib: proto util
+util: proto
 app: lib data/xbitmaps
 xserver/xorg xserver/xvnc: proto doc lib
 driver: xserver/xorg
@@ -56,6 +57,7 @@
 
 OS_SUBDIRS_common = \
 	util/util-macros \
+	util/lndir \
 	proto \
 	data/xbitmaps \
 	util \
@@ -74,9 +76,9 @@
 OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
 
 PWD:sh=pwd
-TOP=$(PWD)
+TOP=$(PWD)/..
 
 ### Include common definitions
 DIRNAME=""
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
 
--- a/open-src/app/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/app/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source Application modules
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -136,8 +136,8 @@
 	rss-glx
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="app/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
--- a/open-src/app/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/app/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=app
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Changes to apply to man pages
 MODTYPE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
@@ -43,5 +43,5 @@
 MODTYPE_ADD_BUILD_TARGETS=set-elf-comments
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
--- a/open-src/app/xdm/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/app/xdm/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -113,11 +113,11 @@
 $(XCF_USR_FILES): $(PROTODIR)/$(XDM_USR_CONFIGDIR) $(XCF_USR_SRCFILES)
 	-rm -f $@
 	mkdir -p $(PROTODIR)/$(XDM_USR_CONFIGDIR)
-	@ $(START_CMD_ECHO) ; cp -p $(XCF_USR_SRCDIR)/$$(basename $@) $@
+	cp -p $(XCF_USR_SRCDIR)/$(@F) $@
 
 $(XCF_USR_SRCFILES): $(XCF_USR_SRCDIR) $(XCF_ETC_SRCFILES)
 	-rm -f $@
-	FILENAME=$$(basename $@) ; \
+	FILENAME=$(@F) ; \
 	COMMENT_CHAR=$$(head -n 1 $(XCF_ETC_SRCDIR)/$${FILENAME}) ; \
 	printf '$(XCF_HEADER)' $${COMMENT_CHAR} $${FILENAME} > $@ ; \
 	cat $(XCF_ETC_SRCDIR)/$${FILENAME} >> $@
--- a/open-src/common/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/common/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -319,7 +319,7 @@
 $(SOURCE_ADD_TARGET): $(SOURCE_INIT_TARGET)
 	@if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
 	  if [[ ! -x $(LNDIR) ]] ; then \
-	    (cd $(TOP)/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
+	    (cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
 	  fi ; \
 	  $(START_CMD_ECHO) ; \
 	  cd $(SOURCE_DIR) && $(LNDIR) ../../$(ADDITIONAL_SOURCE_DIR) ; \
@@ -371,7 +371,7 @@
 $(SUNTOUCH_MAN_FLAGS_DEFAULT)	SUNTOUCH_MAN_FLAGS = $(DEFAULT_SUNTOUCH_MAN_FLAGS)
 
 $(FIXED_MAN_TARGET): $(PATCHED_TARGET) $(SOURCE_ADD_TARGET)
-	$(PERL) $(TOP)/common/suntouch-manpages.pl $(SUNTOUCH_MAN_FLAGS) \
+	$(PERL) $(TOP)/open-src/common/suntouch-manpages.pl $(SUNTOUCH_MAN_FLAGS) \
 		$(@:%.$(FIXED_MAN_SUFFIX)=%)
 	touch $@
 
@@ -435,7 +435,7 @@
 	-L$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR) \
 	-L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)
 
-DEFAULT_PKG_CONFIG_PATH=$(TOP)/common/pc-files/$(BUILD_DIR):$(PROTODIR)$(PKGCONFIG_DIR):$(PROTODIR)$(PKGCONFIG_DIR_SHARE):$(PKGCONFIG_DIR):$(PKGCONFIG_DIR_SHARE)
+DEFAULT_PKG_CONFIG_PATH=$(TOP)/open-src/common/pc-files/$(BUILD_DIR):$(PROTODIR)$(PKGCONFIG_DIR):$(PROTODIR)$(PKGCONFIG_DIR_SHARE):$(PKGCONFIG_DIR):$(PKGCONFIG_DIR_SHARE)
 
 # Set USE_DEFAULT_CONFIG_ENV=no in a Makefile to not use this default
 # autoconfig environment
@@ -465,7 +465,7 @@
 	chmod a+x configure ; \
 	$(CONFIG_ENV) $(SHELL) ./configure $(CONFIG_OPTS) ; \
 	if [[ "$(DELIBTOOLIZE)" = "yes" ]] ; then \
-	    $(TOP)/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
+	    $(TOP)/open-src/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
 	fi
 
 default_configure: $(AUTOCONF_TARGET)
@@ -561,10 +561,12 @@
 	@ if [[ ! -z "$(FIX_PC_FILES)" ]] ; then \
 	    cd $(SOURCE_DIR) ; \
 	    for pcin in $(FIX_PC_FILES:.in=) ; do \
-		pc=$${pcin%%+(.pc|.in)} ; \
+		pc="$${pcin%%+(.pc|.in)}" ; \
+		pcu="$${pc##*/}-uninstalled.pc" ; \
 		($(START_CMD_ECHO) ; \
+		 rm -f $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ; \
 		 $(PERL) -p $(UNINSTALLED_PC_OPS) $$pc.pc > \
-		    $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$$(basename $${pc})-uninstalled.pc ) ; \
+		    $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ) ; \
 	    done ; \
 	fi
 
@@ -577,7 +579,7 @@
 ELF_COMMENTS += $(DEBUG_ELF_COMMENTS)
 
 set-elf-comments: $(BUILD_TARGETS:set-elf-comments=)
-	$(TOP)/common/set-elf-comments.pl -B 'hg id' \
+	$(TOP)/open-src/common/set-elf-comments.pl -B 'hg id' \
 	 -M '$(ELF_COMMENTS)' $(SOURCE_DIR)
 
 
@@ -593,14 +595,14 @@
 
 # Some modules use lndir to merge in sources from Sun specific directories
 $(LNDIR):
-	(cd $(TOP)/util/lndir && $(MAKE) $(MAKEFLAGS) install)
+	(cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install)
 
 # Some modules use these tools to convert DocBook docs to text or html
 $(DOCBOOK2HTML) + $(DOCBOOK2TEXT):
-	cd $(TOP)/doc/docbook-utils && $(MAKE) $(MAKEFLAGS) install
+	cd $(TOP)/open-src/doc/docbook-utils && $(MAKE) $(MAKEFLAGS) install
 
 $(XORG_DEFS_ENT):
-	cd $(TOP)/doc/xorg-sgml-doctools && $(MAKE) $(MAKEFLAGS) install
+	cd $(TOP)/open-src/doc/xorg-sgml-doctools && $(MAKE) $(MAKEFLAGS) install
 
 ### Useful rules for maintaining patch sets
 
--- a/open-src/common/Makefile.init	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/common/Makefile.init	Tue Jun 22 13:56:05 2010 -0700
@@ -219,7 +219,7 @@
 ### Directory paths
 
 # Proto directory to install into for packaging
-PROTODIR=$(TOP)/../proto-$(ARCH)-svr4
+PROTODIR=$(TOP)/proto-$(ARCH)-svr4
 
 X11_DIR=/usr
 X11_BIN_DIR=$(X11_DIR)/bin
@@ -269,7 +269,7 @@
 ### Other tools needed to build
 
 # Script used to install files in proto area
-INSTALL_SCRIPT=$(TOP)/common/install-sh -c
+INSTALL_SCRIPT=$(TOP)/open-src/common/install-sh -c
 
 # Some modules (such as FreeType 2) require GNU make
 GNUMAKE = gmake
@@ -298,7 +298,7 @@
 
 ### Sources, in-tree and upstream
 
-TARBALLDIR=$(TOP)/tarballs
+TARBALLDIR=$(TOP)/open-src/tarballs
 WGET=/usr/sfw/bin/wget --no-check-certificate
 GIT=git
 
--- a/open-src/common/Makefile.subdirs	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/common/Makefile.subdirs	Tue Jun 22 13:56:05 2010 -0700
@@ -25,19 +25,22 @@
 #
 
 # Need to set $MACH
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 OS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
 
+# Variables to always pass down to subdirs
+PASSDOWN_VARS = V="$(V)" TOP="$(TOP)" CDEBUGFLAGS="$(CDEBUGFLAGS)" 
+
 .DEFAULT:
-	$(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=$@
+	$(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) subdirs OS_TARGET=$@
 
 World: clean all
 
 clean: clean-subdirs clean-obsolete-subdirs
 
 clean-subdirs:
-	$(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean
+	$(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) subdirs OS_TARGET=clean
 
 subdirs: $(OS_SUBDIRS)
 
@@ -45,7 +48,7 @@
 	@case '${MAKEFLAGS}' in *[ik]*) set +e;; esac; \
 	cd $@ ; \
 	print "## making" $(OS_TARGET) "in open-src/$(DIRNAME)$@..."; \
-        $(MAKE) $(MAKEFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" $(OS_TARGET)
+        $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(OS_TARGET)
 
 clean-obsolete-subdirs:
 	@ set +e; \
--- a/open-src/data/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/data/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source data modules
 #
-# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -34,8 +34,8 @@
 OS_SUBDIRS_i386  = $(OS_SUBDIRS_common)
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="data/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
--- a/open-src/data/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/data/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org data modules
 #
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=data
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Most data modules have no man pages
 MODTYPE_SUNTOUCH_MAN_FLAGS= 
@@ -43,5 +43,5 @@
 MODTYPE_LD_OPTIONS=
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
--- a/open-src/doc/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/doc/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -41,10 +41,10 @@
 docbook-utils: xorg-sgml-doctools
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="doc/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
 
 
--- a/open-src/doc/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/doc/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=doc
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # No common man flags to add
 MODTYPE_SUNTOUCH_MAN_FLAGS= 
@@ -53,7 +53,7 @@
 	LD_LIBRARY_PATH="$(PROTODIR)$(X11_SERVERLIBS_DIR)"
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
 
 
--- a/open-src/driver/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/driver/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source Xorg driver modules
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -94,11 +94,11 @@
 	xf86-video-via
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="driver/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
 
 # Dependencies between modules
 xf86-input-vmmouse: xf86-input-mouse
--- a/open-src/driver/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/driver/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=driver
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Determine from MODULE_NAME if this is a video or input driver
 DRIVER_CLASS_V=$(MODULE_NAME:xf86-video-%=video)
@@ -90,17 +90,18 @@
 MODTYPE_LDFLAGS=$(LDFLAGS) -Wl,-B,direct -R/lib$(ARCHLIBSUBDIR)
 
 MODTYPE_LD_OPTIONS=-z defs $(X11_SERVERLIBS_LDFLAGS) \
-	-M $(TOP)/xserver/xorg/$(BUILD_DIR)/mapfile-Xorg-externs -lc
+	-M $(TOP)/open-src/xserver/xorg/$(BUILD_DIR)/mapfile-Xorg-externs -lc
 
 # Need to fix libtool interference with our linker flags
 DELIBTOOLIZE=yes
 
 ### Include common rules
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
 # Clean up old 64-bit builds from before we stopped building them
-# for some drivers
+# for some drivers - depends on $(CLEAN_RULES) to avoid errors from
+# rm -r when two rules try to remove the same directory at once
 clean: clean_old64
 
-clean_old64:
+clean_old64: $(CLEAN_RULES)
 	-rm -rf $(BUILD_DIR_64)
--- a/open-src/font/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/font/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source font modules
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -85,9 +85,9 @@
 OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="font/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
 
--- a/open-src/font/Makefile.bdf	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/font/Makefile.bdf	Tue Jun 22 13:56:05 2010 -0700
@@ -26,12 +26,12 @@
 ### Makefile settings/rules common to most bdf/pcf X.Org font modules
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=font
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 
 # All the encodings defined in font-util/fontutil.m4.in
--- a/open-src/font/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/font/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -26,12 +26,12 @@
 ### Makefile settings/rules common to all X.Org font modules
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=font
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Most font modules have no man pages
 MODTYPE_SUNTOUCH_MAN_FLAGS= 
@@ -67,7 +67,7 @@
 MODTYPE_ADD_INSTALL_TARGETS = install_fontpath_links
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
 # Can't use Makefile substitutions or dependencies on the links themselves
 #  due to the : characters & shell math expansion in the link names
--- a/open-src/font/Makefile.ttf	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/font/Makefile.ttf	Tue Jun 22 13:56:05 2010 -0700
@@ -25,11 +25,11 @@
 
 ### Include common definitions
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=font
 
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # No configure script to run
 CONFIGURE_TARGETS=
--- a/open-src/lib/DPS/sun-src/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/DPS/sun-src/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for DPS sub-modules
 #
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -42,9 +42,9 @@
 OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
 
 PWD:sh=pwd
-TOP=$(PWD)/../../../..
+TOP=$(PWD)/../../../../..
 
 ### Include common definitions
 DIRNAME="lib/DPS/build_32/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
 
--- a/open-src/lib/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source Library modules
 #
-# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -145,9 +145,9 @@
 	libXprintAppUtil
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="lib/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
 
--- a/open-src/lib/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=lib
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Set default to build both 32-bit & 64-bit if not set in module makefile
 BUILD_TYPES_DEFAULT     = $(BUILD_TYPES_SET:yes=$(POUND_SIGN))
@@ -72,4 +72,4 @@
 # Need to fix libtool interference with our linker flags
 DELIBTOOLIZE=yes
 
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
--- a/open-src/lib/fontconfig/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/fontconfig/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -103,6 +103,9 @@
 # Need to rebuild autoconf/automake files
 AUTORECONF=yes
 
+# Include common rulesets
+include ../Makefile.inc
+
 # Path to install fc-cache manifest & method script
 FONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
 FONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
@@ -114,13 +117,13 @@
 SUN_CONFFILES = 20-indic.conf 49-sun-preuser.conf 90-sun-prefer-bitmap.conf
 FONTCONFIG_SUN_CONFFILES = $(SUN_CONFFILES:%=$(FONTCONFIG_CONFDIR)/%)
 
-# Additional targets to install beyond the default_install
-MODULE_ADD_INSTALL_TARGETS = fontconfig-sunman-install \
+# Additional targets to install beyond the default_install,
+# run just once, not per bitwidth
+FONTCONFIG_INSTALL_RULES = fontconfig-sunman-install \
 	$(FONTCONFIG_SMF_MANIFEST) $(FONTCONFIG_SMF_METHOD) \
 	$(FONTCONFIG_SUN_CONFFILES)
 
-# Include common rulesets
-include ../Makefile.inc
+install: $(FONTCONFIG_INSTALL_RULES)
 
 $(FONTCONFIG_SMF_MANIFEST): fc-cache.xml
 	/usr/sbin/svccfg validate fc-cache.xml
@@ -133,24 +136,20 @@
 
 $(FONTCONFIG_SUN_CONFFILES): $(SUN_CONFFILES)
 	mkdir -p $(PROTODIR)/etc/fonts/conf.d $(PROTODIR)/etc/fonts/conf.avail
-	@f=`basename $@` ; $(START_CMD_ECHO) ; \
-	cp -fp $$f $@ ; \
-	rm -f $(PROTODIR)/etc/fonts/conf.d/$$f ; \
-	ln -sf ../conf.avail/$$f $(PROTODIR)/etc/fonts/conf.d/$$f
+	cp -fp $(@F) $@
+	rm -f $(PROTODIR)/etc/fonts/conf.d/$(@F)
+	ln -sf ../conf.avail/$(@F) $(PROTODIR)/etc/fonts/conf.d/$(@F)
 
 FC_MAN_DIR=$(PROTODIR)/usr/share/man
 
-fontconfig-sunman-install: default_install
+fontconfig-sunman-install: $(INSTALL_RULES)
 	mkdir -p $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
 	sed -e 's/.TH "FONTS-CONF" "5"/.TH "fonts.conf" "4"/' 	\
 	    -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/;' 	\
-		libfontconfig.3lib $(SOURCE_DIR)/COPYING >> 	\
-		$(FC_MAN_DIR)/man3lib/libfontconfig.3lib
-	-rm -f $(FC_MAN_DIR)/man1/fc-cache.1
-	cat $(SOURCE_DIR)/fc-cache/fc-cache.1 sunman-notes-fc-cache >> \
-		$(FC_MAN_DIR)/man1/fc-cache.1
+	    libfontconfig.3lib > $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
+	cat sunman-notes-fc-cache >> $(FC_MAN_DIR)/man1/fc-cache.1
+	-rm -f $(PROTODIR)/etc/fonts/fonts.conf.bak
 
-
--- a/open-src/lib/freetype/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/freetype/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -26,7 +26,7 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 # Package name used in tarballs
 MODULE_NAME=freetype
--- a/open-src/lib/libpciaccess/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/libpciaccess/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -76,7 +76,7 @@
 
 $(SCANPCI_MAN_OUT): $(SCANPCI_MAN_SRC)
 	(cd $(SOURCE_DIR) && \
-	 $(PERL) $(TOP)/common/suntouch-manpages.pl \
+	 $(PERL) $(TOP)/open-src/common/suntouch-manpages.pl \
 		$(COMMON_SUNTOUCH_MAN_FLAGS) \
 		-p $(MODULE_PREFIX)/bin/ \
 		src/scanpci.man && \
--- a/open-src/lib/mesa/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/lib/mesa/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -59,6 +59,7 @@
 AUTOCONF_TARGET=$(SOURCE_DIR)/configs/autoconf
 AUTOCONF_TARGET_SET=yes
 MODULE_ADD_CONFIGURE_TARGETS=set_pc_dir
+MODULE_INSTALL_DEPS=set_pc_dir
 
 DRI_DRIVER_LIST_sparc=
 DRI_DRIVER_LIST_i386=i915 i965 r200 r300 radeon
--- a/open-src/proto/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/proto/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source Protocol modules
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -68,8 +68,8 @@
 default_target: install
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="proto/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
--- a/open-src/proto/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/proto/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org protocol modules
 #
-# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=proto
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Most proto modules have no man pages
 MODTYPE_SUNTOUCH_MAN_FLAGS= 
@@ -51,6 +51,6 @@
 MODTYPE_PKGCONFIG_DIR_SET=yes
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
 
--- a/open-src/util/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/util/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -40,8 +40,8 @@
 OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="util/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
--- a/open-src/util/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/util/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org utility modules
 #
-# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=util
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Most util modules have no man pages, but show path in those that do
 MODTYPE_SUNTOUCH_MAN_FLAGS= -p $(MODULE_PREFIX)/bin/
@@ -46,7 +46,7 @@
 MODTYPE_ADD_BUILD_TARGETS=set-elf-comments
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
 
 
--- a/open-src/util/build-tools/xmake	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/util/build-tools/xmake	Tue Jun 22 13:56:05 2010 -0700
@@ -1,7 +1,7 @@
 #! /usr/perl5/bin/perl -w
 
 #
-# Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -162,6 +162,10 @@
   mkpath($dmake_odir);
 }
 
+# Set some make variables that our makefiles recognize
+my $topdir = File::Spec->catdir( @dirtree[0..($osdepth-1)] );
+push @makeargs, "TOP=$topdir", "V=$verbose";
+
 # if in top two levels, just run make
 if ($osdepth >= ($#dirtree - 2)) {
   print join(' ', $make_cmd, @makeargs, @ARGV), "\n";
--- a/open-src/xserver/Makefile	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/xserver/Makefile	Tue Jun 22 13:56:05 2010 -0700
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source xserver modules
 #
-# Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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"),
@@ -29,8 +29,8 @@
 OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
 
 PWD:sh=pwd
-TOP=$(PWD)/..
+TOP=$(PWD)/../..
 
 ### Include common definitions
 DIRNAME="xserver/"
-include $(TOP)/common/Makefile.subdirs
+include $(TOP)/open-src/common/Makefile.subdirs
--- a/open-src/xserver/Makefile.inc	Mon Jun 21 13:12:49 2010 -0700
+++ b/open-src/xserver/Makefile.inc	Tue Jun 22 13:56:05 2010 -0700
@@ -24,12 +24,12 @@
 #
 
 PWD:sh=pwd
-TOP=$(PWD)/../..
+TOP=$(PWD)/../../..
 
 MODTYPE=xserver
 
 ### Include common definitions
-include $(TOP)/common/Makefile.init
+include $(TOP)/open-src/common/Makefile.init
 
 # Xorg server source tarball to use sources from
 XORGSERVER_VERS=1.7.7
@@ -118,7 +118,7 @@
 MODTYPE_ADD_CONFIGURE_TARGETS = fix-moduledirs
 
 ### Include common rulesets
-include $(TOP)/common/Makefile.inc
+include $(TOP)/open-src/common/Makefile.inc
 
 ## mdb module rules
 # Build & install mdb modules & scripts that aren't integrated to