6551329 X open-src makefiles spawn too many shell commands
authorAlan Coopersmith <Alan.Coopersmith@Sun.COM>
Tue, 15 May 2007 16:55:45 -0700
changeset 156 1dec9ce4addc
parent 155 590ece734ed7
child 157 31c83a089945
6551329 X open-src makefiles spawn too many shell commands
open-src/app/Makefile
open-src/app/Makefile.inc
open-src/app/mesa-demos/Makefile
open-src/app/xpm/Makefile
open-src/app/xscreensaver/Makefile
open-src/common/Makefile.inc
open-src/data/Makefile.inc
open-src/doc/Makefile.inc
open-src/doc/docbook-utils/Makefile
open-src/driver/Makefile
open-src/driver/Makefile.inc
open-src/font/Makefile.inc
open-src/font/bitstream-vera/Makefile
open-src/lib/Makefile
open-src/lib/Makefile.inc
open-src/lib/Xft/Makefile
open-src/lib/fontconfig/Makefile
open-src/lib/freetype/Makefile
open-src/lib/libdrm/Makefile
open-src/lib/libxtrans/Makefile
open-src/lib/mesa/Makefile
open-src/proto/Makefile
open-src/proto/Makefile.inc
open-src/util/lndir/Makefile
open-src/xserver/xorg/Makefile
packages/SUNWfontconfig-docs/prototype
packages/SUNWxwxft/prototype
--- a/open-src/app/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/app/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.5	07/03/20
+# @(#)Makefile	1.6	07/05/15
 #
 ###############################################################################
 
@@ -48,7 +48,8 @@
 OS_SUBDIRS_i386 = $(OS_SUBDIRS_common) \
 	mesa-demos
 
-OS_SUBDIRS:sh=uname -p | sed 's/^\(.*\)$/\$\(OS_SUBDIRS_\1\)/'
+MACH:sh=uname -p
+OS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
 
 all: 
 	$(MAKE) $(MFLAGS) subdirs OS_TARGET=all
--- a/open-src/app/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/app/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -28,18 +28,15 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.4	07/01/31
+# @(#)Makefile.inc	1.5	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
-BUILD_TYPES=32
 
 # Source tarball
 SOURCE_TARBALL_NAME=$(APP_NAME)-$(APP_VERS).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/app/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=app
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(APP_NAME)-$(APP_VERS)
--- a/open-src/app/mesa-demos/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/app/mesa-demos/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,15 +28,12 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.4	07/01/31
+# @(#)Makefile	1.5	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Build 32-bit, 64-bit, or both?
-BUILD_TYPES=32
-
 # Version number (used in path names)
 MESA_VERS=6.5.2
 
@@ -44,7 +41,8 @@
 SOURCE_TARBALL_NAME=MesaDemos-$(MESA_VERS).tar.bz2
 
 # Download site for source
-SOURCE_URL=http://easynews.dl.sourceforge.net/sourceforge/mesa3d/$(SOURCE_TARBALL_NAME)
+SOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES= \
@@ -79,13 +77,13 @@
 DEMOS_DIR=$(SOURCE_DIR)/progs/xdemos
 
 # Mesa config file names
-MESA_CFG_32_sun4=sunos5-v8
-MESA_CFG_64_sun4=sunos5-v9
-MESA_CFG_32_i86pc=solaris-x86-cc-dri
-MESA_CFG_64_i86pc=solaris-x64-cc-dri
+MESA_CFG_32_sparc=sunos5-v8
+MESA_CFG_64_sparc=sunos5-v9
+MESA_CFG_32_i386=solaris-x86-cc-dri
+MESA_CFG_64_i386=solaris-x64-cc-dri
 
-MESA_CFG_32:sh=arch | sed 's/^\(.*\)$/\$\(MESA_CFG_32_\1\)/'
-MESA_CFG_64:sh=arch | sed 's/^\(.*\)$/\$\(MESA_CFG_64_\1\)/'
+MESA_CFG_32= $(MESA_CFG_32_$(MACH))
+MESA_CFG_64= $(MESA_CFG_64_$(MACH))
 
 BUILD_32_FLAGS= MESA_CFG=$(MESA_CFG_32)
 BUILD_64_FLAGS= MESA_CFG=$(MESA_CFG_64)
--- a/open-src/app/xpm/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/app/xpm/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -2,7 +2,7 @@
 #
 # Xpm Makefile
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -30,12 +30,11 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.4	07/01/04
+# @(#)Makefile	1.5	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
-BUILD_TYPES=32
 
 # Package name used in tarballs
 MODULE_NAME=libXpm
@@ -51,6 +50,7 @@
 
 # Download site for source
 SOURCE_URL=$(XORG_RELEASES_URL)/lib/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(MODULE_VERS)
--- a/open-src/app/xscreensaver/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/app/xscreensaver/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -30,12 +30,11 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.74	07/02/27
+# @(#)Makefile	1.75	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
-BUILD_TYPES=32
 
 # Version number (used in path names)
 XSCREENSAVER_VERS=5.01
@@ -45,6 +44,7 @@
 
 # Download site for source
 SOURCE_URL=http://www.jwz.org/xscreensaver/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 SOURCE_UNCOMPRESS=gzcat
 
 # Patches to apply to source after unpacking, in order
@@ -88,9 +88,9 @@
 	fi
 
 # Where to find OpenGL headers/libraries
-OPENGL_DIR_sun4=/usr/openwin
-OPENGL_DIR_i86pc=/usr/X11
-OPENGL_DIR:sh=arch | sed 's/^\(.*\)$/\$\(OPENGL_DIR_\1\)/'
+OPENGL_DIR_sparc=/usr/openwin
+OPENGL_DIR_i386=/usr/X11
+OPENGL_DIR=$(OPENGL_DIR_$(MACH))
 
 # Command line options to GNU autoconf configure script
 XS_CFG= --prefix=/usr/X11 --enable-maintainer-mode \
@@ -122,8 +122,9 @@
 # Additional optimization flags, to make the hacks show off the hardware
 # better and we can get away with optimizations not allowed in the core X code
 XS_CFLAGS=$(CFLAGS) -fsimple=2 -nofstore -xprefetch $(XS_ARCH_FLAGS) -xstrconst
-XS_ARCH_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(XS_\1_ARCH_FLAGS\)/'
-XS_sun4_ARCH_FLAGS=-xtarget=ultra2
+XS_ARCH_FLAGS=$(XS_ARCH_FLAGS_$(MACH))
+XS_ARCH_FLAGS_sparc=-xtarget=ultra2
+XS_ARCH_FLAGS_i386=
 
 # Configure/Make variables to override
 # Set PERL to /usr/perl5/bin so it uses that path to perl for scripts
--- a/open-src/common/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/common/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -28,11 +28,37 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.75	07/01/31
+# @(#)Makefile.inc	1.76	07/05/15
 #
 
-BUILD_DATE:sh=date +'%e-%B-%Y'
-BUILD_ID = X11 for Solaris Nevada, built $(BUILD_DATE)
+# Borrowed from Solaris OS/Net makefile.master:
+# The declaration POUND_SIGN is always '#'. This is needed to get around the
+# make feature that '#' is always a comment delimiter, even when escaped or
+# quoted.  The only way of generating this is the :sh macro mechanism.  Note
+# however that in general :sh macros should be avoided in makefiles that are
+# widely included into other makefiles, as the resulting shell executions can
+# cause a noticable slowdown in build times.
+#
+POUND_SIGN:sh= echo \\043
+
+# BUILD_DATE:sh=date +'%e-%B-%Y'
+# BUILD_ID = X11 for Solaris Nevada, built $(BUILD_DATE)
+
+###  Machine architecture macros
+
+# MACH will be either "sparc" or "i386"
+MACH:sh=uname -p
+
+# ARCH will be either "sun4" or "i386" - mainly used in $(PROTODIR)
+ARCH=$(MACH:sparc=sun4)
+
+MACH32_sparc	= sparc
+MACH64_sparc 	= sparcv9
+MACH32_i386	= i386
+MACH64_i386 	= amd64
+
+MACH32= $(MACH32_$(MACH))
+MACH64= $(MACH64_$(MACH))
 
 ### Default compiler & options
 CC     			= cc
@@ -62,38 +88,37 @@
 # we can only make .bss, not all of .data no-exec on SPARC
 MAPFILE_DIR 		= $(TOP)/common/mapfiles/
 MAPFILE_NOEXBSS		= $(MAPFILE_DIR)/map.noexbss
-MAPFILE_NOEXDATA_sun4	= $(MAPFILE_NOEXBSS)
-MAPFILE_NOEXDATA_i86pc	= /usr/lib/ld/map.noexdata
-MAPFILE_NOEXDATA:sh=arch | sed 's/^\(.*\)$/\$\(MAPFILE_NOEXDATA_\1\)/'
+MAPFILE_NOEXDATA_sparc	= $(MAPFILE_NOEXBSS)
+MAPFILE_NOEXDATA_i386	= /usr/lib/ld/map.noexdata
+MAPFILE_NOEXDATA	= $(MAPFILE_NOEXDATA_$(MACH))
 
 MAPFILES_FOR_ALL   = -M /usr/lib/ld/map.pagealign -M $(MAPFILE_NOEXDATA)
 MAPFILES_FOR_PROGS = -M /usr/lib/ld/map.bssalign -M /usr/lib/ld/map.noexstk \
 			-M $(MAPFILE_NOEXBSS)
 
 ### Architecture specific flags
-DEFAULT_sun4_ARCH32_FLAGS 	= -xarch=v8plus
-DEFAULT_sun4_ARCH64_FLAGS 	= -xarch=v9
-DEFAULT_sun4_ARCH_LIB_FLAGS 	= -xregs=no%appl
+DEFAULT_ARCH32_FLAGS_sparc 	= -xarch=v8plus
+DEFAULT_ARCH64_FLAGS_sparc	= -xarch=v9
+DEFAULT_ARCH_LIB_FLAGS_sparc 	= -xregs=no%appl
 
 # -xregs=no%frameptr is required on x86 when compiling at -xO4 or higher to 
 # avoid losing stack frame pointers so you can't get stack traces or debug
-DEFAULT_i86pc_ARCH32_FLAGS 	= -xpentium -xregs=no%frameptr
-DEFAULT_i86pc_ARCH64_FLAGS 	= -xarch=generic64 -xregs=no%frameptr
-DEFAULT_i86pc_ARCH_LIB_FLAGS 	=  
+DEFAULT_ARCH32_FLAGS_i386 	= -xpentium -xregs=no%frameptr
+DEFAULT_ARCH64_FLAGS_i386 	= -xarch=generic64 -xregs=no%frameptr
+DEFAULT_ARCH_LIB_FLAGS_i386 	=  
 
-ARCH:sh=arch | sed s/i86pc/i386/
-ARCH32_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(DEFAULT_\1_ARCH32_FLAGS\)/'
-ARCH64_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(DEFAULT_\1_ARCH64_FLAGS\)/'
-ARCH_LIB_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(DEFAULT_\1_ARCH_LIB_FLAGS\)/'
+ARCH32_FLAGS = $(DEFAULT_ARCH32_FLAGS_$(MACH))
+ARCH64_FLAGS = $(DEFAULT_ARCH64_FLAGS_$(MACH))
+ARCH_LIB_FLAGS = $(DEFAULT_ARCH_LIB_FLAGS_$(MACH))
 
 ### Flags for gcc
 DEFAULT_GCC_CFLAGS		= -O3 -fno-omit-frame-pointer -Wall
-DEFAULT_sun4_ARCH32_GCC_FLAGS 	= -mcpu=ultrasparc -m32
-DEFAULT_sun4_ARCH64_GCC_FLAGS 	= -mcpu=ultrasparc -m64
-DEFAULT_i86pc_ARCH32_GCC_FLAGS 	= -march=i686 -m32
-DEFAULT_i86pc_ARCH64_GCC_FLAGS 	= -march=opteron -m64
-ARCH32_GCC_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(DEFAULT_\1_ARCH32_GCC_FLAGS\)/'
-ARCH64_GCC_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(DEFAULT_\1_ARCH64_GCC_FLAGS\)/'
+DEFAULT_ARCH32_GCC_FLAGS_sparc 	= -mcpu=ultrasparc -m32
+DEFAULT_ARCH64_GCC_FLAGS_sparc 	= -mcpu=ultrasparc -m64
+DEFAULT_ARCH32_GCC_FLAGS_i386 	= -march=i686 -m32
+DEFAULT_ARCH64_GCC_FLAGS_i386 	= -march=opteron -m64
+ARCH32_GCC_FLAGS=$(DEFAULT_ARCH32_GCC_FLAGS_$(MACH))
+ARCH64_GCC_FLAGS=$(DEFAULT_ARCH64_GCC_FLAGS_$(MACH))
 
 # Need to use -Wl,.. to pass linker flags through gcc
 GCC_LDFLAGS_CMD=echo $(LDFLAGS) | \
@@ -107,23 +132,13 @@
 GCC_PROG_LDFLAGS=$(GCC_PROG_LDFLAGS_CMD:sh)
 
 
-SUBDIR32_sun4	= sparcv8
-SUBDIR32_i86pc	= i386
-SUBDIR64_sun4 	= sparcv9
-SUBDIR64_i86pc 	= amd64
-SUBDIR32:sh=arch | sed 's/^\(.*\)$/\$\(SUBDIR32_\1\)/'
-SUBDIR64:sh=arch | sed 's/^\(.*\)$/\$\(SUBDIR64_\1\)/'
+SUBDIR32_sparc	= sparcv8
+SUBDIR32_i386	= i386
+SUBDIR64_sparc 	= sparcv9
+SUBDIR64_i386 	= amd64
+SUBDIR32 = $(SUBDIR32_$(MACH))
+SUBDIR64 = $(SUBDIR64_$(MACH))
 
-ARCH_MAPFILE:sh=uname -p | sed 's/^\(.*\)$/mapfile_pga_\1/'
-MAPFILE_FLAGS = -M $(TOP)/common/mapfiles/$(ARCH_MAPFILE)
-
-MACH32_sun4	= sparc
-MACH32_i86pc	= i386
-MACH64_sun4 	= sparcv9
-MACH64_i86pc 	= amd64
-
-MACH32:sh=arch | sed 's/^\(.*\)$/\$\(MACH32_\1\)/'
-MACH64:sh=arch | sed 's/^\(.*\)$/\$\(MACH64_\1\)/'
 
 ### Proto directory to install into for packaging
 PROTODIR=$(TOP)/../proto-$(ARCH)-svr4
@@ -148,9 +163,9 @@
 X11_SERVERMODS_SUBDIR=/modules
 X11_SERVERMODS_DIR=$(X11_DIR)/lib$(X11_SERVERMODS_SUBDIR)
 
-MODULE_subdir_sun4=
-MODULE_subdir_i86pc=$(ARCHLIBSUBDIR)
-MODULE_subdir:sh=arch | sed 's/^\(.*\)$/\$\(MODULE_subdir_\1\)/'
+MODULE_subdir_sparc=
+MODULE_subdir_i386=$(ARCHLIBSUBDIR)
+MODULE_subdir=$(MODULE_subdir_$(MACH))
 
 # Directory used for installing tools used during build but not
 # delivered in packages
@@ -161,6 +176,10 @@
 BUILD_DIR_32 = build_32
 BUILD_DIR_64 = build_64
 
+# Set default build type to 32-bit if not set in module makefile
+BUILD_TYPES_DEFAULT	= $(BUILD_TYPES_SET:yes=$(POUND_SIGN))
+$(BUILD_TYPES_DEFAULT)	BUILD_TYPES=32
+
 all: $(BUILD_TYPES:%=source_%) $(BUILD_TYPES:%=build_%)
 install: $(BUILD_TYPES:%=install_%)
 
@@ -253,6 +272,11 @@
 SOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME)
 
 XORG_RELEASES_URL=http://xorg.freedesktop.org/releases/individual
+SF_DOWNLOADS_URL=http://easynews.dl.sourceforge.net/sourceforge
+
+# Set default download location if not set in module makefile
+SOURCE_URL_DEFAULT	= $(SOURCE_URL_SET:yes=$(POUND_SIGN))
+$(SOURCE_URL_DEFAULT)	SOURCE_URL=$(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
 
 download:
 	if [ ! -f $(SOURCE_TARBALL) ] ; then \
--- a/open-src/data/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/data/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -36,14 +36,9 @@
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Not really 32 or 64-bit, but we call it 32-bit to avoid subdirs
-BUILD_TYPES=32 
-
 # Source tarball
 SOURCE_TARBALL_NAME=$(MODULE_NAME)-$(VERSION).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/data/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=data
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(MODULE_NAME)-$(VERSION)
--- a/open-src/doc/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/doc/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.2	07/01/31
+# @(#)Makefile.inc	1.3	07/05/15
 #
 
 ### Makefile settings/rules common to all X.Org protocol modules
@@ -36,14 +36,9 @@
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Not really 32 or 64-bit, but we call it 32-bit to avoid subdirs
-BUILD_TYPES=32 
-
 # Source tarball
 SOURCE_TARBALL_NAME=$(DOC_NAME)-$(VERSION).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/doc/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=doc
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(DOC_NAME)-$(VERSION)
--- a/open-src/doc/docbook-utils/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/doc/docbook-utils/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,15 +28,12 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.1	07/01/30
+# @(#)Makefile	1.2	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Build 32-bit, 64-bit, or both?
-BUILD_TYPES=32
-
 # Version number (used in path names)
 DOCBOOK_TOOLS_VERS=0.6.14
 
@@ -46,6 +43,7 @@
 
 # Download site for source
 SOURCE_URL=ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES= solaris-port.patch
--- a/open-src/driver/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/driver/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,20 +28,20 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.4	07/01/31
+# @(#)Makefile	1.5	07/05/15
 #
 ###############################################################################
 
-COMMON_SUBDIRS= \
+OS_SUBDIRS_common = \
 	xf86-input-keyboard		\
 	xf86-input-mouse		\
 	xf86-input-void			\
 	xf86-video-dummy		
 
-sparc_SUBDIRS = $(COMMON_SUBDIRS)	\
+OS_SUBDIRS_sparc = $(OS_SUBDIRS_common)	\
 	xf86-video-wsfb
 
-i386_SUBDIRS  = $(COMMON_SUBDIRS)	\
+OS_SUBDIRS_i386  = $(OS_SUBDIRS_common)	\
 	xf86-input-acecad		\
 	xf86-input-calcomp		\
 	xf86-input-citron		\
@@ -91,8 +91,8 @@
 	xf86-video-vmware
 
 
-OS_SUBDIRS:sh=uname -p | sed 's/^\(.*\)$/\$\(\1_SUBDIRS\)/'
-
+MACH:sh=uname -p
+OS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
 
 all: install
 
--- a/open-src/driver/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/driver/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -28,21 +28,20 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.9	07/01/31
+# @(#)Makefile.inc	1.10	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-BUILD_TYPES_sun4=64
-BUILD_TYPES_i86pc=32 64
-BUILD_TYPES:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_TYPES_\1\)/'
+BUILD_TYPES_SET=yes
+BUILD_TYPES_sparc=64
+BUILD_TYPES_i386=32 64
+BUILD_TYPES=$(BUILD_TYPES_$(MACH))
 
 # Source tarball
 SOURCE_TARBALL_NAME=$(DRIVER_NAME)-$(DRIVER_VERS).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/driver/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=driver
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(DRIVER_NAME)-$(DRIVER_VERS)
@@ -83,9 +82,9 @@
 CONFIG_ENV_gcc = CC=$(GCC) CFLAGS="$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS)" \
 	LD="$(GCC) $(DRIVER_LDFLAGS_gcc)" LDFLAGS="$(DRIVER_LDFLAGS_gcc)"
 
-CONFIG_ENV_sun4= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
-CONFIG_ENV_i86pc= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
-CONFIG_ENV:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_ENV_\1\)/'
+CONFIG_ENV_sparc= $(CONFIG_ENV_cc)
+CONFIG_ENV_i386= $(CONFIG_ENV_gcc)
+CONFIG_ENV=$(CONFIG_ENV_$(MACH)) $(CONFIG_ENV_common)
 
 
 # Run configure script
--- a/open-src/font/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/font/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -28,22 +28,17 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.2	07/01/31
+# @(#)Makefile.inc	1.3	07/05/15
 #
 
-### Makefile settings/rules common to all X.Org protocol modules
+### Makefile settings/rules common to all X.Org font modules
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Not really 32 or 64-bit, but we call it 32-bit to avoid subdirs
-BUILD_TYPES=32 
-
 # Source tarball
 SOURCE_TARBALL_NAME=$(FONT_NAME)-$(VERSION).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/font/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=font
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(FONT_NAME)-$(VERSION)
--- a/open-src/font/bitstream-vera/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/font/bitstream-vera/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -30,15 +30,12 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.1	05/09/02
+# @(#)Makefile	1.2	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Not really 32 or 64-bit, but we call it 32-bit to avoid subdirs
-BUILD_TYPES=32 
-
 # Version number (used in path names)
 VERSION=1.10
 
@@ -47,6 +44,7 @@
 
 # Download site for source
 SOURCE_URL=http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/$(VERSION)/ttf-bitstream-vera-$(VERSION).tar.bz2
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES=		# None
--- a/open-src/lib/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.6	07/05/05
+# @(#)Makefile	1.7	07/05/15
 #
 ###############################################################################
 
@@ -64,7 +64,8 @@
 	libdrm \
 	mesa
 
-OS_SUBDIRS:sh=uname -p | sed 's/^\(.*\)$/\$\(OS_SUBDIRS_\1\)/'
+MACH:sh=uname -p
+OS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
 
 all: 
 	$(MAKE) $(MFLAGS) subdirs OS_TARGET=all
--- a/open-src/lib/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org library modules
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,18 +28,14 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.4	06/12/13
+# @(#)Makefile.inc	1.5	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
+
 BUILD_TYPES=32 64
-
-# Source tarball
-SOURCE_TARBALL_NAME=$(LIB_MODULE)-$(LIB_VERS).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/lib/$(SOURCE_TARBALL_NAME)
+BUILD_TYPES_SET=yes
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(LIB_MODULE)-$(LIB_VERS)
@@ -49,12 +45,18 @@
 
 include $(TOP)/common/Makefile.inc
 
-# Where to install files
-LIB_prefix=$(X11_DIR)
+# Source tarball
+SOURCE_TARBALL_DEFAULT	= $(SOURCE_TARBALL_SET:yes=$(POUND_SIGN))
+$(SOURCE_TARBALL_DEFAULT) SOURCE_TARBALL_NAME=$(LIB_MODULE)-$(LIB_VERS).tar.bz2
+SOURCE_TARBALL_DIR=lib
+
+# Where to install files - default is /usr/X11
+LIB_PREFIX_DEFAULT	= $(LIB_PREFIX_SET:yes=$(POUND_SIGN))
+$(LIB_PREFIX_DEFAULT)	LIB_PREFIX=$(X11_DIR)
 
 # Command line options to GNU autoconf configure script
 CONFIG_OPTS = --enable-shared=yes --enable-static=no \
-	--prefix=$(LIB_prefix) 	--mandir='$${prefix}/share/man' \
+	--prefix=$(LIB_PREFIX) 	--mandir='$${prefix}/share/man' \
 	--libdir='$${exec_prefix}/lib$(LIB_ADD_SUBDIR)$(LIBSUBDIR)' \
 	$(LIB_ADD_CONFIG_OPTS)
 
@@ -66,7 +68,7 @@
 	LDFLAGS="$(LIB_LDFLAGS) -L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)" \
 	PKG_CONFIG_PATH=$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR):/usr/lib$(ARCHLIBSUBDIR)/pkgconfig \
 	INSTALL="$(TOP)/common/install-sh -c" CPPROG="cp -p" \
-	LIB_MAN_SUFFIX=$(LIB_MAN_SUFFIX)
+	LIB_MAN_SUFFIX=$(LIB_MAN_SUFFIX) $(LIB_ADD_CONFIG_ENV)
 
 # Run configure script
 $(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(XPROTO_DEP)
@@ -76,8 +78,8 @@
 build_gen: $(LIB_BUILT)
 
 $(LIB_BUILT): $(SOURCE_DIR)/Makefile $(LIB_ADD_BUILD_DEPS)
-	(cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS) $(LIB_ADD_LD_OPTIONS)" $(MAKE) $(MFLAGS) $(LIB_ADD_MAKEFLAGS) )
+	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS) $(LIB_ADD_LD_OPTIONS)" $(MAKE) $(MFLAGS) $(LIB_ADD_MAKEFLAGS) )
 
 
-install_gen: $(LIB_BUILT)
-	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS) $(LIB_ADD_LD_OPTIONS)" $(MAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) libdir=$(LIB_prefix)/lib$(LIB_ADD_SUBDIR)$(ARCHLIBSUBDIR) install pkgconfigdir=/usr/lib$(ARCHLIBSUBDIR)/pkgconfig $(LIB_ADD_MAKEFLAGS))
+install_gen:: $(LIB_BUILT)
+	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS) $(LIB_ADD_LD_OPTIONS)" $(MAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) libdir=$(LIB_PREFIX)/lib$(LIB_ADD_SUBDIR)$(ARCHLIBSUBDIR) install pkgconfigdir=/usr/lib$(ARCHLIBSUBDIR)/pkgconfig $(LIB_ADD_MAKEFLAGS))
--- a/open-src/lib/Xft/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/Xft/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -30,21 +30,21 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.6	06/11/02
+# @(#)Makefile	1.7	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
-BUILD_TYPES=32 64
+
+# Package name used in tarballs
+LIB_MODULE=libXft
 
 # Version number (used in path names)
-XFT_VERS=2.1.6
-
-# Source tarball
-SOURCE_TARBALL_NAME=libXft-$(XFT_VERS).tar.bz2
+LIB_VERS=2.1.6
 
 # Download site for source
 SOURCE_URL=http://xlibs.freedesktop.org/release/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = \
@@ -53,44 +53,39 @@
 	cjk-embolden.patch \
 	xft.hint.patch
 
-# Directory created by unpacking source
-SOURCE_DIR=$(BUILD_DIR)/libXft-$(XFT_VERS)
+# Library name (used for specfiles/mapfiles)
+LIBNAME=Xft
 
 # Man pages to apply Sun footer to & attributes to list
 SUNTOUCHED_MANPAGES=Xft.3.in Xft.3
-SUNTOUCH_MAN_FLAGS= -l Xft \
- -a '{Availability, SUNWxwxft} {Interface Stability, Volatile} {MT-Level, See XInitThreads(3X11)}'
-
-include $(TOP)/common/Makefile.inc
+SUN_PACKAGE=SUNWxwxft
+LIB_STABILITY=Volatile
+LIB_MAN_SUFFIX=3
 
 # Where to install files
-XFT_prefix=$(OW_DIR)
+LIB_PREFIX=$(OW_DIR)
+LIB_PREFIX_SET=yes
 
 # Command line options to GNU autoconf configure script
-CONFIG_OPTS = --enable-shared=yes --enable-static=no --prefix=$(XFT_prefix) --x-libraries="/usr/openwin/lib$(LIBSUBDIR) -L/usr/openwin/sfw/lib$(LIBSUBDIR) -R/usr/openwin/lib$(LIBSUBDIR) -R/usr/openwin/sfw/lib$(LIBSUBDIR)" --libdir='$${exec_prefix}/lib$(LIBSUBDIR)' --mandir=$(X11_DIR)/share/man
+LIB_ADD_CONFIG_OPTS = --mandir=$(X11_DIR)/share/man
 
 # Paths to find libraries at build time (LD_LIBRARY_PATH) 
 # and run time (LD_RUN_PATH) and freetype-config binary at build time (PATH)
 LIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/sfw/lib$(LIBSUBDIR):$(PROTODIR)/usr/openwin/lib$(LIBSUBDIR):/usr/sfw/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/sfw/lib$(LIBSUBDIR) PATH=$(PROTODIR)/usr/sfw/bin$(LIBSUBDIR):$(PATH)
+LIB_ADD_MAKEFLAGS = bindir=$(XFT_prefix)/bin$(ARCHLIBSUBDIR)
 
 # Include Paths - need headers for fontconfig & freetype from build area
-INCLUDES = -I$(PROTODIR)/usr/include -I$(PROTODIR)/usr/sfw/include
+LIB_ADD_CFLAGS = -I$(PROTODIR)/usr/include -I$(PROTODIR)/usr/sfw/include
 
 # Library built in tree
-XFT_LIB=$(BUILD_DIR)/.libs/libXft.so.2
+LIB_BUILT=$(BUILD_DIR)/.libs/libXft.so.2
 
 # Mapfile used to control which symbols are exported
 XFT_MAPFILE=$(PWD)/mapfile.scope
-
-build_gen: $(XFT_LIB)
-
-$(XFT_LIB): $(SOURCE_DIR)/Makefile $(XFT_MAPFILE)
-	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS) -M$(XFT_MAPFILE)" $(MAKE) $(MFLAGS))
+LIB_ADD_LD_OPTIONS=-M$(XFT_MAPFILE)
 
-# Run configure script
-$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET)
-	(cd $(SOURCE_DIR) ; chmod a+x configure ; \
-	 CC=$(CC) CFLAGS="$(LIB_CFLAGS) $(INCLUDES)" LD="$(CC) $(LIB_CFLAGS) $(LDFLAGS)"  LDFLAGS="$(LIB_LDFLAGS)" $(LIBPATHS) ./configure $(CONFIG_OPTS) )
+# pkg-config files that need to have -R added
+# FIX_PC_FILES=xft.pc.in - already has -R
 
-install_gen: $(XFT_LIB)
-	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS)" $(MAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) libdir=$(XFT_prefix)/lib$(ARCHLIBSUBDIR) bindir=$(XFT_prefix)/bin$(ARCHLIBSUBDIR) install)
+include ../Makefile.inc
+
--- a/open-src/lib/fontconfig/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/fontconfig/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -2,7 +2,7 @@
 #
 # Fontconfig 2.x Makefile
 #
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -30,41 +30,51 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.62	06/08/29
+# @(#)Makefile	1.64	07/05/17
 #
 
-PWD:sh=pwd
-TOP=$(PWD)/../..
-BUILD_TYPES=32 64
+# Package name used in tarballs
+LIB_MODULE=fontconfig
 
 # Version number (used in path names)
-FONTCONFIG_VERS=2.3.2
+LIB_VERS=2.3.2
 
 # Source tarball
-SOURCE_TARBALL_NAME=fontconfig-$(FONTCONFIG_VERS).tar.gz
+SOURCE_TARBALL_NAME=fontconfig-$(LIB_VERS).tar.gz
+SOURCE_TARBALL_SET=yes
+SOURCE_UNCOMPRESS=gzcat
 
 # Download site for source
-SOURCE_URL=http://fontconfig.org/release/fontconfig-2.3.2.tar.gz
-
-SOURCE_UNCOMPRESS=gzcat
+SOURCE_URL=http://fontconfig.org/release/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
-SOURCE_PATCHES=fontconfig-$(FONTCONFIG_VERS).patch \
-	       fontconfig-$(FONTCONFIG_VERS).patch.hide
+SOURCE_PATCHES=fontconfig-$(LIB_VERS).patch \
+	       fontconfig-$(LIB_VERS).patch.hide
 
-include $(TOP)/common/Makefile.inc
-
-# Directory created by unpacking source
-SOURCE_DIR=$(BUILD_DIR)/fontconfig-$(FONTCONFIG_VERS)
+# Library name (used for specfiles/mapfiles)
+LIBNAME=fontconfig
 
 # Special version of freetype config to force certain arguments
 FONTCONFIG_FT2CFG=$(BUILD_DIR)/freetype-config
 
+# Install to /usr, not /usr/X11
+LIB_PREFIX=/usr
+LIB_PREFIX_SET=yes
+
+# Path needed to find docbook2man, etc.
+# DOC_PATH= PATH="$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)$(TOOLS_DIR)/bin:$$PATH"
+
 # Command line options to GNU autoconf configure script
-FONTCONFIG_CFG=--enable-shared=yes --enable-static=no --with-expat-includes=/usr/sfw/include --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) --prefix=/usr --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' --with-freetype-config=../freetype-config --libdir='$${exec_prefix}/lib$(LIBSUBDIR)'
+LIB_ADD_CONFIG_OPTS = --with-expat-includes=/usr/sfw/include \
+    --with-expat-lib=/usr/sfw/lib$(LIBSUBDIR) \
+    --with-confdir=/etc/fonts --with-default-fonts='--font-dirs-go-here--' \
+    --with-freetype-config=../freetype-config
+
+LIB_ADD_CONFIG_ENV = $(LIBPATHS)
 
 # Library built in tree
-FONTCONFIG_LIB=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.0.4
+LIB_BUILT=$(SOURCE_DIR)/src/.libs/libfontconfig.so.1.0.4
 
 # Where to install most files
 FONTCONFIG_prefix=$(PROTODIR)
@@ -73,14 +83,14 @@
 FONTCONFIG_libdir=$(FONTCONFIG_prefix)/usr/lib
 
 # Paths to find libraries
-FONTCONFIG_libpaths= LD_LIBRARY_PATH=$(PROTODIR)/usr/sfw/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/sfw/lib$(LIBSUBDIR)
+LIBPATHS = LD_LIBRARY_PATH=$(PROTODIR)/usr/sfw/lib$(LIBSUBDIR) LD_RUN_PATH=/usr/sfw/lib$(LIBSUBDIR) $(DOC_PATH)
+
+include ../Makefile.inc
 
 # Path to install fc-cache manifest
 FONTCONFIG_SMF_MANIFEST_dir=$(PROTODIR)/var/svc/manifest/application/font
 FONTCONFIG_SMF_MANIFEST=$(FONTCONFIG_SMF_MANIFEST_dir)/fc-cache.xml
 
-build_gen: $(FONTCONFIG_LIB)
-
 $(FONTCONFIG_FT2CFG): $(PROTODIR)/usr/sfw/bin$(LIBSUBDIR)/freetype-config
 	-if [ -f $@ ] ; then rm $@ ; fi
 	sed -e 's|-L$$libdir|-L$(PROTODIR)$${exec_prefix}/lib$(LIBSUBDIR) -L$$libdir|' -e 's|^includedir=$${prefix}|includedir=$(PROTODIR)$${prefix}|' $(PROTODIR)/usr/sfw/bin$(LIBSUBDIR)/freetype-config > $@
@@ -88,27 +98,18 @@
 
 # Run configure script
 $(SOURCE_DIR)/Makefile:= OPT_CFLAGS=$(FC_OPTFLAGS)
-FC_OPTFLAGS:sh=arch | sed 's/^\(.*\)$/\$\(FC_\1_OPT_FLAGS\)/'
-FC_i386_OPT_FLAGS = ""
-FC_sun4_OPT_FLAGS = $(DEFAULT_OPT_CFLAGS)
+FC_OPTFLAGS_i386 = 
+FC_OPTFLAGS_sparc = $(DEFAULT_OPT_CFLAGS)
+FC_OPTFLAGS=$(FC_OPTFLAGS_$(MACH))
 
-$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(FONTCONFIG_FT2CFG)
-	(cd $(SOURCE_DIR) ; \
-	 chmod a+x configure ; \
-	 CC=$(CC) CFLAGS="$(LIB_CFLAGS)" LD="$(CC) $(LIB_CFLAGS) $(LDFLAGS)" LDFLAGS="$(LIB_LDFLAGS)" $(FONTCONFIG_libpaths) ./configure $(FONTCONFIG_CFG) )
-	if [ -f $(SOURCE_DIR)/src/Makefile.bak ] ; then 	\
-		rm -f $(SOURCE_DIR)/src/Makefile.bak ; 	\
-	fi
+$(SOURCE_DIR)/Makefile: $(FONTCONFIG_FT2CFG)
 
 $(SOURCE_DIR)/fonts.conf-SUNW: $(SOURCE_DIR)/fonts.conf fonts.conf.append fonts.conf.preuser fix-fonts.conf.pl
 	perl fix-fonts.conf.pl < $(SOURCE_DIR)/fonts.conf > $(SOURCE_DIR)/fonts.conf-SUNW
 
-# Build Fontconfig 
-$(FONTCONFIG_LIB): $(SOURCE_DIR)/Makefile $(SOURCE_DIR)/fonts.conf-SUNW
-	(cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_LDFLAGS)" $(FONTCONFIG_libpaths) $(MAKE) $(MFLAGS) )
+$(LIB_BUILT): $(SOURCE_DIR)/fonts.conf-SUNW
 
-install_gen: $(FONTCONFIG_LIB) $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST)
-	(cd $(SOURCE_DIR) ; $(FONTCONFIG_libpaths) $(MAKE) -e DESTDIR=$(FONTCONFIG_prefix) libdir=/usr/lib$(ARCHLIBSUBDIR) bindir=/usr/bin$(ARCHLIBSUBDIR) install )
+install_gen:: $(SOURCE_DIR)/fonts.conf-SUNW $(FONTCONFIG_SMF_MANIFEST)
 	rm $(PROTODIR)/etc/fonts/fonts.conf
 	cp $(SOURCE_DIR)/fonts.conf-SUNW $(PROTODIR)/etc/fonts/fonts.conf
 	$(MAKE) $(MFLAGS) fontconfig-sunman-install
@@ -133,16 +134,18 @@
 	print \
    }'
 
-fontconfig-sunman-install: $(PROTODIR)/usr/man/man5/fonts-conf.5
-	mkdir -p $(PROTODIR)/usr/man/man1 $(PROTODIR)/usr/man/man4 $(PROTODIR)/usr/man/man3lib
-	$(FC_MAN_FIX) $(PROTODIR)/usr/man/man5/fonts-conf.5 sunman-notes-fonts.conf $(TOP)/common/sunman-stability | sed -e 's/.TH "FONTS-CONF" "5"/.TH "fonts.conf" "4"/' -e 's/SUNWfontconfig/SUNWfontconfig-root/' > $(PROTODIR)/usr/man/man4/fonts.conf.4
-	-if [ -f $(PROTODIR)/usr/man/man3lib/libfontconfig.3lib ] ; then \
-		rm -f $(PROTODIR)/usr/man/man3lib/libfontconfig.3lib ; \
+FC_MAN_DIR=$(PROTODIR)/usr/share/man
+
+fontconfig-sunman-install:
+	mkdir -p $(FC_MAN_DIR)/man1 $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
+	$(FC_MAN_FIX) $(FC_MAN_DIR)/man5/fonts-conf.5 sunman-notes-fonts.conf $(TOP)/common/sunman-stability | sed -e 's/.TH "FONTS-CONF" "5"/.TH "fonts.conf" "4"/' -e 's/SUNWfontconfig/SUNWfontconfig-root/' > $(FC_MAN_DIR)/man4/fonts.conf.4
+	-if [ -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ] ; then \
+		rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib ; \
 	fi
-	perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(PROTODIR)/usr/man/man3lib/libfontconfig.3lib
+	perl -p -e 's/^$$/.LP/;' -e 's/\251/\\(co/;' libfontconfig.3lib $(SOURCE_DIR)/COPYING >> $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
 	for i in fc-cache fc-list ; do 			\
-	    if [ -f $(PROTODIR)/usr/man/man1/$$i.1 ] ; then 	\
-		rm -f $(PROTODIR)/usr/man/man1/$$i.1 ; 		\
+	    if [ -f $(FC_MAN_DIR)/man1/$$i.1 ] ; then 	\
+		rm -f $(FC_MAN_DIR)/man1/$$i.1 ; 		\
 	    fi ;						\
 	    if [ -f sunman-notes-$$i ] ; then			\
 		APPEND="sunman-notes-$$i $(TOP)/common/sunman-stability" ;	\
@@ -150,7 +153,7 @@
 		APPEND=$(TOP)/common/sunman-stability ;		\
 	    fi ;						\
 	    $(FC_MAN_FIX) $(SOURCE_DIR)/$$i/$$i.man $$APPEND > \
-		$(PROTODIR)/usr/man/man1/$$i.1 ;		\
+		$(FC_MAN_DIR)/man1/$$i.1 ;		\
 	done
 
 install_64::
--- a/open-src/lib/freetype/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/freetype/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -30,7 +30,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.65	07/04/19
+# @(#)Makefile	1.66	07/05/15
 #
 
 PWD:sh=pwd
@@ -38,6 +38,7 @@
 
 # Build 32-bit, 64-bit, or both?
 BUILD_TYPES=32 64
+BUILD_TYPES_SET=yes
 
 # Version number (used in path names)
 FT_VERS=2.1.10
@@ -47,6 +48,7 @@
 
 # Download site for source
 SOURCE_URL=http://savannah.nongnu.org/download/freetype/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES=freetype-$(FT_VERS).patch 6425531.patch 6542352.patch freetype-$(FT_VERS).hint.patch 6539893.patch,-p1
--- a/open-src/lib/libdrm/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/libdrm/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -27,12 +27,14 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.5	07/01/31
+# @(#)Makefile	1.6	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
+
 BUILD_TYPES=32 64
+BUILD_TYPES_SET=yes
 
 # Package name used in tarballs
 LIB_MODULE=libdrm
@@ -62,6 +64,7 @@
 
 # Download site for source
 SOURCE_URL=http://dri.freedesktop.org/libdrm/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(LIB_MODULE)-$(LIB_VERS)
--- a/open-src/lib/libxtrans/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/libxtrans/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -30,69 +30,30 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.3	07/01/31
+# @(#)Makefile	1.4	07/05/15
 #
 
 # IMPORTANT NOTE:  xtrans is not really a library, but shared source code
 # compiled into other modules at build time.
 
-PWD:sh=pwd
-TOP=$(PWD)/../..
-BUILD_TYPES=32 
+# Package name used in tarballs
+LIB_MODULE=xtrans
 
 # Version number (used in path names)
-XTRANS_VERS=1.0.3
-
-# Source tarball
-SOURCE_TARBALL_NAME=xtrans-$(XTRANS_VERS).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/lib/$(SOURCE_TARBALL_NAME)
+LIB_VERS=1.0.3
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = inetv6.patch socket-perm.patch
 
-# Directory created by unpacking source
-SOURCE_DIR=$(BUILD_DIR)/xtrans-$(XTRANS_VERS)
-
 # Library name (used for specfiles/mapfiles)
 LIBNAME=xtrans
 
 # Man pages to apply Sun footer to & attributes to list
 # - Xtrans has none
 
-include $(TOP)/common/Makefile.inc
-
-# Where to install files
-XTRANS_prefix=$(X11_DIR)
-
-# Command line options to GNU autoconf configure script
-CONFIG_OPTS = --enable-shared=yes --enable-static=no \
-	--prefix=$(XTRANS_prefix) --libdir='$${exec_prefix}/lib$(LIBSUBDIR)' \
-	--enable-xthreads --with-lint --enable-lint-library
-
-# Environment variable options to GNU autoconf configure script
-CONFIG_ENV = CC=$(CC) CFLAGS="$(LIB_CFLAGS)" \
-	LD="$(LD) $(LDFLAGS)"  LDFLAGS="$(LIB_LDFLAGS)" \
-	PKG_CONFIG_PATH=$(PROTODIR)/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig \
-	LIB_MAN_SUFFIX=3xtrans
-
-# Run configure script
-$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET) $(XPROTO_DEP)
-	(cd $(SOURCE_DIR) ; chmod a+x configure ; \
-	 $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )
-
 # Library built in tree
 # - Xtrans doesn't build a library, so we use the pkgconfig file it builds instead
-XTRANS_LIB = xtrans.pc
-
-build_gen: $(XTRANS_LIB)
+LIB_BUILT = xtrans.pc
 
-$(XTRANS_LIB): $(SOURCE_DIR)/Makefile
-	(cd $(SOURCE_DIR) ; LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS) -M $(PWD)/$(BUILD_DIR)/$(SPECMAP)" $(MAKE) $(MFLAGS) )
-
+include ../Makefile.inc
 
-install_gen: $(XTRANS_LIB)
-	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_REQUIRED_LDFLAGS)" $(MAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) libdir=$(XTRANS_prefix)/lib$(ARCHLIBSUBDIR) install pkgconfigdir=/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig)
-	-rm -f $(PROTODIR)/usr/lib/$(MACH64)/pkgconfig/xtrans.pc
-	ln -s ../../pkgconfig/xtrans.pc $(PROTODIR)/usr/lib/$(MACH64)/pkgconfig/xtrans.pc
--- a/open-src/lib/mesa/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/lib/mesa/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.5	07/01/31
+# @(#)Makefile	1.6	07/05/15
 #
 
 PWD:sh=pwd
@@ -36,6 +36,7 @@
 
 # Build 32-bit, 64-bit, or both?
 BUILD_TYPES=32 64
+BUILD_TYPES_SET=yes
 
 # Version number (used in path names)
 MESA_VERS=6.5.2
@@ -44,7 +45,8 @@
 SOURCE_TARBALL_NAME=MesaLib-$(MESA_VERS).tar.bz2
 
 # Download site for source
-SOURCE_URL=http://easynews.dl.sourceforge.net/sourceforge/mesa3d/$(SOURCE_TARBALL_NAME)
+SOURCE_URL=$(SF_DOWNLOADS_URL)/mesa3d/$(SOURCE_TARBALL_NAME)
+SOURCE_URL_SET=yes
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES= \
@@ -78,21 +80,21 @@
 	mkdir -p $(SOURCE_DIR)
 	(cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
 
-MESA_CFG_32_sun4=sunos5-v8
-MESA_CFG_64_sun4=sunos5-v9
+MESA_CFG_32_sparc=sunos5-v8
+MESA_CFG_64_sparc=sunos5-v9
 
 # Build with gcc on x86:
 MESA_CFLAGS=$(DEFAULT_GCC_CFLAGS) $(ARCH_GCC_FLAGS) -D_REENTRANT
-MESA_CFG_32_i86pc=solaris-x86-gcc-dri
-MESA_CFG_64_i86pc=solaris-x64-gcc-dri
+MESA_CFG_32_i386=solaris-x86-gcc-dri
+MESA_CFG_64_i386=solaris-x64-gcc-dri
 
 # Build with Sun Studio cc on x86:
 #MESA_CFLAGS=$(LIB_CFLAGS)
-#MESA_CFG_32_i86pc=solaris-x86-cc-dri
-#MESA_CFG_64_i86pc=solaris-x64-cc-dri
+#MESA_CFG_32_i386=solaris-x86-cc-dri
+#MESA_CFG_64_i386=solaris-x64-cc-dri
 
-MESA_CFG_32:sh=arch | sed 's/^\(.*\)$/\$\(MESA_CFG_32_\1\)/'
-MESA_CFG_64:sh=arch | sed 's/^\(.*\)$/\$\(MESA_CFG_64_\1\)/'
+MESA_CFG_32 = $(MESA_CFG_32_$(MACH))
+MESA_CFG_64 = $(MESA_CFG_64_$(MACH))
 
 BUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_32)
 BUILD_64_FLAGS=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" MESA_CFG=$(MESA_CFG_64)
--- a/open-src/proto/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/proto/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,21 +28,22 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.5	07/01/31
+# @(#)Makefile	1.6	07/05/15
 #
 ###############################################################################
 
-COMMON_SUBDIRS = X11 BigReqs Composite Damage EvIE Fixes Fontcache Fonts \
+OS_SUBDIRS_common = X11 BigReqs Composite Damage EvIE Fixes Fontcache Fonts \
 	Input KB PM Randr Record Render Resource ScrnSaver Trap Video \
 	XCMisc XExt XF86BigFont XF86DGA XF86Misc XF86VidMode Xinerama \
 	lg3dproto
 
-sparc_SUBDIRS = $(COMMON_SUBDIRS)
+OS_SUBDIRS_sparc = $(OS_SUBDIRS_common)
 
-i386_SUBDIRS  = $(COMMON_SUBDIRS)       \
+OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)       \
 	glproto xf86driproto
 
-OS_SUBDIRS:sh=uname -p | sed 's/^\(.*\)$/\$\(\1_SUBDIRS\)/'
+MACH:sh=uname -p
+OS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
 
 # Need to install to proto area by default for inter-package dependencies to
 # work right.
--- a/open-src/proto/Makefile.inc	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/proto/Makefile.inc	Tue May 15 16:55:45 2007 -0700
@@ -1,4 +1,4 @@
-###############################################################################
+# -*- Makefile -*- rules common to most X.Org protocol modules
 #
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use subject to license terms.
@@ -28,22 +28,15 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.4	07/01/31
+# @(#)Makefile.inc	1.5	07/05/15
 #
 
-### Makefile settings/rules common to all X.Org protocol modules
-
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Not really 32 or 64-bit, but we call it 32-bit to avoid subdirs
-BUILD_TYPES=32 
-
 # Source tarball
 SOURCE_TARBALL_NAME=$(PROTO_NAME)-$(VERSION).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/proto/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=proto
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/$(PROTO_NAME)-$(VERSION)
--- a/open-src/util/lndir/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/util/lndir/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -28,23 +28,18 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.2	06/08/25
+# @(#)Makefile	1.3	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-# Not really 32 or 64-bit, but we call it 32-bit to avoid subdirs
-BUILD_TYPES=32 
-
 # Version number (used in path names)
 VERSION=1.0.1
 
 # Source tarball
 SOURCE_TARBALL_NAME=lndir-$(VERSION).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/util/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=util
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES=	
--- a/open-src/xserver/xorg/Makefile	Thu May 10 09:45:10 2007 -0700
+++ b/open-src/xserver/xorg/Makefile	Tue May 15 16:55:45 2007 -0700
@@ -30,15 +30,16 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.40	07/05/04
+# @(#)Makefile	1.41	07/05/15
 #
 
 PWD:sh=pwd
 TOP=$(PWD)/../..
 
-BUILD_TYPES_sun4=64
-BUILD_TYPES_i86pc=32 64
-BUILD_TYPES:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_TYPES_\1\)/'
+BUILD_TYPES_SET=yes
+BUILD_TYPES_sparc=64
+BUILD_TYPES_i386=32 64
+BUILD_TYPES=$(BUILD_TYPES_$(MACH))
 
 # Package name used in tarballs
 MODULE_NAME=xorg-server
@@ -48,9 +49,7 @@
 
 # Source tarball
 SOURCE_TARBALL_NAME=$(MODULE_NAME)-$(XORGSERVER_VERS).tar.bz2
-
-# Download site for source
-SOURCE_URL=$(XORG_RELEASES_URL)/xserver/$(SOURCE_TARBALL_NAME)
+SOURCE_TARBALL_DIR=xserver
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = \
@@ -139,7 +138,7 @@
 MODULES_DIR='$${libdir}/modules$(MODULE_subdir)'
 
 # Command line options to GNU autoconf configure script
-# XXX: enable xorgcfg --disable-dga enable security
+# XXX: --disable-dga
 CONFIG_OPTS_COMMON = \
 	--prefix=$(XORGSERVER_PREFIX) --mandir='$${prefix}/share/man' \
 	--bindir='$${exec_prefix}/bin/$(ARCHBINSUBDIR)' \
@@ -155,9 +154,9 @@
 	--with-xkb-path='$${libdir}/X11/xkb' \
 	--with-default-font-path="$(FONTDIR)/TrueType/,$(FONTDIR)/Type1/,$(FONTDIR)/Type1/sun/,$(FONTDIR)/F3bitmaps/,$(FONTDIR)/misc/,$(FONTDIR)/100dpi/,$(FONTDIR)/75dpi/" 
 
-CONFIG_OPTS_sun4=$(CONFIG_OPTS_COMMON)
-CONFIG_OPTS_i86pc=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
-CONFIG_OPTS:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_OPTS_\1\)/'
+CONFIG_OPTS_sparc=$(CONFIG_OPTS_COMMON)
+CONFIG_OPTS_i386=$(CONFIG_OPTS_COMMON) --with-mesa-source=$(MESA_SRC_DIR)
+CONFIG_OPTS=$(CONFIG_OPTS_$(MACH))
 
 
 # Need to append header path with gcc headers for MMX/SSE intrinsics
@@ -197,15 +196,15 @@
 	LDFLAGS="$(GCC_PROG_LDFLAGS) -L/usr/sfw/lib$(ARCHLIBSUBDIR) -R/usr/sfw/lib$(ARCHLIBSUBDIR) $(LDPATH_ADD)" \
 	CPPFLAGS="$(GCC_HEADERS) $(XORG_CPPFLAGS)"
 
-CONFIG_ENV_sun4= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
-CONFIG_ENV_i86pc= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
-CONFIG_ENV:sh=arch | sed 's/^\(.*\)$/\$\(CONFIG_ENV_\1\)/'
+CONFIG_ENV_sparc= $(CONFIG_ENV_cc) $(CONFIG_ENV_common)
+CONFIG_ENV_i386= $(CONFIG_ENV_gcc) $(CONFIG_ENV_common)
+CONFIG_ENV= $(CONFIG_ENV_$(MACH))
 
 BUILD_32_FLAGS=ARCH_GCC_FLAGS="$(ARCH32_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR32)"
 
-BUILD_64_FLAGS_sun4=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
-BUILD_64_FLAGS_i86pc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
-BUILD_64_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(BUILD_64_FLAGS_\1\)/'
+BUILD_64_FLAGS_sparc=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)"
+BUILD_64_FLAGS_i386=ARCH_GCC_FLAGS="$(ARCH64_GCC_FLAGS)" ARCHBINSUBDIR="$(SUBDIR64)"
+BUILD_64_FLAGS=$(BUILD_64_FLAGS_$(MACH))
 
 # Run configure script
 $(SOURCE_DIR)/Makefile: $(UNPACK_TARGET)
--- a/packages/SUNWfontconfig-docs/prototype	Thu May 10 09:45:10 2007 -0700
+++ b/packages/SUNWfontconfig-docs/prototype	Tue May 15 16:55:45 2007 -0700
@@ -1,4 +1,4 @@
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,7 +26,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# ident	"@(#)prototype	1.5	06/03/30 SMI"
+# ident	"@(#)prototype	1.6	07/05/17 SMI"
 #
 # Fontconfig documentation
 
@@ -34,7 +34,7 @@
 i copyright
 i depend
 
-!HOME=../usr/man
+!HOME=../usr/share/man
 
 d none share 							0755 root sys
 d none share/man						0755 root bin
--- a/packages/SUNWxwxft/prototype	Thu May 10 09:45:10 2007 -0700
+++ b/packages/SUNWxwxft/prototype	Tue May 15 16:55:45 2007 -0700
@@ -26,7 +26,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-#	"@(#)prototype	1.3	05/09/02   Sun Microsystems" 
+#	"@(#)prototype	1.4	07/05/15   Sun Microsystems" 
 #
 # Xft
 
@@ -34,11 +34,11 @@
 i copyright=copyright
 i depend
 
-!HOME=../openwin
+!HOME=../usr
 
 d none openwin 0755 root bin
 
-!search  $HOME/include/X11/Xft
+!search  $HOME/openwin/include/X11/Xft
 d none openwin/share 0755 root bin
 d none openwin/share/include 0755 root bin
 d none openwin/share/include/X11 0755 root bin
@@ -46,7 +46,7 @@
 f none openwin/share/include/X11/Xft/Xft.h 0644 root bin
 f none openwin/share/include/X11/Xft/XftCompat.h 0644 root bin
 
-!search  $HOME/lib
+!search  $HOME/openwin/lib
 d none openwin/lib 		0755 root bin
 f none openwin/lib/libXft.so.2 	0755 root bin
 s none openwin/lib/libXft.so=./libXft.so.2
@@ -56,7 +56,7 @@
 f none lib/pkgconfig/xft.pc	                        0444 root other
 
 #    Xft 64-bit library
-!search  $HOME/lib/$plat_64
+!search  $HOME/openwin/lib/$plat_64
 s none openwin/lib/64=$plat_64
 d none openwin/lib/$plat_64 				0755 root bin
 f none openwin/lib/$plat_64/libXft.so.2          	0755 root bin