21029732 PKG_CONFIG_PATH should be included in CONFIGURE_ENV and BUILD_ENV
authorShawn Walker-Salas <shawn.walker@oracle.com>
Mon, 23 Nov 2015 15:33:43 -0800
changeset 5125 34cc580c62c2
parent 5124 3a6b9e3809f7
child 5126 d8d0ebb8ed32
21029732 PKG_CONFIG_PATH should be included in CONFIGURE_ENV and BUILD_ENV 21029735 shared-macros should define service manifest and method macros 21093823 sample-manifest should omit or comment "standard" directories and certain files 21144358 configure scripts usually detect wrong host for 64-bit builds 21157847 shared-macros.mk instructions have a typo for studio c99 mode 22067225 common make-rules desired for simplifying makefiles 22067806 transforms needs expanding for desktop services
components/aalib/Makefile
components/apache2-modules/mod_wsgi/Makefile
components/berkeleydb/Makefile
components/cmake/Makefile
components/conflict/Makefile
components/cups/Makefile
components/curl/Makefile
components/doxygen/Makefile
components/emacs/Makefile
components/gcc3/Makefile
components/gd2/Makefile
components/ggrep/Makefile
components/ggrep/gnu-grep.p5m
components/ghostscript/Makefile
components/gnump/Makefile
components/gnupg/Makefile
components/gnupth/Makefile
components/ilmbase/Makefile
components/lcms/Makefile
components/mailman/Makefile
components/mpfr/Makefile
components/ncftp/Makefile
components/nmap/Makefile
components/openexr/Makefile
components/openldap/Makefile
components/openssl/openssl-default/Makefile
components/openssl/openssl-fips-140/Makefile
components/openssl/openssl-fips/Makefile
components/pconsole/Makefile
components/pcre/Makefile
components/r/Makefile
components/stdcxx/Makefile
components/subversion/Makefile
components/sudo/Makefile
components/trousers/patches/configure.in.patch
components/unixodbc/Makefile
components/vim/Makefile
components/wireshark/Makefile
components/wxwidgets/Makefile
components/zlib/Makefile
doc/makefile-variables.txt
make-rules/cmake.mk
make-rules/common-32.mk
make-rules/common-32_and_64.mk
make-rules/common-64.mk
make-rules/common-no_arch.mk
make-rules/configure-32.mk
make-rules/configure-32_and_64.mk
make-rules/configure-64.mk
make-rules/configure-no_arch.mk
make-rules/configure.mk
make-rules/intltool.mk
make-rules/ips.mk
make-rules/justmake.mk
make-rules/shared-macros.mk
transforms/actuators
transforms/generate-cleanup
--- a/components/aalib/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/aalib/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -48,20 +48,16 @@
 
 PKG_PROTO_DIRS +=	$(COMPONENT_SRC)
 
-# We need to reset configure options here because aalib is confused with
-# CC and CFLAGS definitions as configure parameters.
-CONFIGURE_OPTIONS	= --prefix=/usr
+# Ensure ancient autoconf scripts are overwritten with fixed versions that
+# properly detect SunOS 5.x hosts.
+COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv)
+
 CONFIGURE_OPTIONS	+= --infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS	+= --mandir=$(CONFIGURE_MANDIR)
-CONFIGURE_OPTIONS	+= --bindir=$(CONFIGURE_BINDIR.$(BITS))
-CONFIGURE_OPTIONS	+= --libdir=$(CONFIGURE_LIBDIR.$(BITS))
 CONFIGURE_OPTIONS	+= --enable-shared
 CONFIGURE_OPTIONS	+= --disable-static
 CONFIGURE_OPTIONS	+= --x-includes=/usr/include
 CONFIGURE_OPTIONS	+= --x-libraries=$(CONFIGURE_LIBDIR.$(BITS))
-CONFIGURE_OPTIONS	+= $(CONFIGURE_OPTIONS.$(BITS))
 
-CONFIGURE_ENV += CC="$(CC)"
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 
 COMPONENT_TEST_DIR =	$(@D)/src
--- a/components/apache2-modules/mod_wsgi/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/apache2-modules/mod_wsgi/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -37,6 +37,8 @@
 TPNO=			19269
 
 include $(WS_MAKE_RULES)/prep.mk
+# Don't use default CPPFLAGS; it causes Apache's custom CPP to fail.
+CONFIGURE_CPPFLAGS=
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
 include ../modules.mk
--- a/components/berkeleydb/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/berkeleydb/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -75,7 +75,6 @@
 
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 JAVA_HOME = $(JAVA7_HOME)
 CONFIGURE_ENV += JAVA_HOME="$(JAVA_HOME)"
--- a/components/cmake/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/cmake/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -57,8 +57,6 @@
 
 # We need these in the environment, although they are already passed
 # as CONFIGURE_OPTIONS; otherwise the correct compilers are not used
-CONFIGURE_ENV +=	CC="$(CC)"	
-CONFIGURE_ENV +=	CXX="$(CXX)"	
 CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"	
 CONFIGURE_ENV +=	MAKE="$(GMAKE)"	
 CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
--- a/components/conflict/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/conflict/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -23,6 +23,7 @@
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		conflict
@@ -45,17 +46,7 @@
 # Required to configure correctly.
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D))
-
-CC +=	$(CC_BITS)
-
-CONFIGURE_ENV += "CC=$(CC)"
-
-# If the configure options are not explicitly set, then configure fails with:
-# configure: warning: CC=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/cc: invalid host type
-# configure: warning: CXX=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/CC: invalid host type
-# configure: error: can only configure for one host and one target at a time
-CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
-CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
+CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 
 COMPONENT_TEST_DIR =	$(BUILD_DIR_64)
 COMPONENT_TEST_CMD =	./run_test.sh
--- a/components/cups/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/cups/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -45,8 +45,11 @@
 # don't use LD_Z_IGNORE: causes linker problems
 LD_Z_IGNORE=
 
-CONFIGURE_OPTIONS +=	--prefix=/usr
-CONFIGURE_OPTIONS +=	--mandir=/usr/share/man
+# cups has an unusual hybrid-build system to support 32-bit and 64-bit
+# libraries in a single build; avoid confusing it by omitting default configure
+# CPPFLAGS.
+CONFIGURE_CPPFLAGS=
+
 CONFIGURE_OPTIONS +=	--localedir=$(USRSHARELOCALEDIR)
 CONFIGURE_OPTIONS +=	--sysconfdir=$(ETCDIR)
 CONFIGURE_OPTIONS +=	--localstatedir=/var
--- a/components/curl/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/curl/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -50,7 +50,6 @@
 
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS) -I/usr/include/openldap"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 CONFIGURE_OPTIONS += --localstatedir=/var --enable-shared --disable-static
 CONFIGURE_OPTIONS += --enable-http --enable-ftp
--- a/components/doxygen/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/doxygen/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		doxygen
@@ -41,6 +42,8 @@
 TPNO=			21549
 
 include $(WS_MAKE_RULES)/prep.mk
+# Omit directory options that break doxygen's configure script.
+CONFIGURE_DEFAULT_DIRS=no
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
 
@@ -57,11 +60,8 @@
 # Missing files in build dir for configure without this.
 COMPONENT_PRE_CONFIGURE_ACTION =	($(CLONEY) $(SOURCE_DIR) $(@D))
 
-# Need to override default options since configure doesn't
-# understand CC, CXX, etc.
-CONFIGURE_OPTIONS =	--platform solaris-g++
-CONFIGURE_OPTIONS +=	--prefix /usr
-CONFIGURE_OPTIONS +=	--enable-langs am,ar,br,ca,cn,cz,de,dk,en,eo,es,fa,fi,fr,gr,hr,hu,id,it,je,jp,ke,kr,lt,lv,mk,nl,no,pl,pt,ro,ru,sc,si,sk,sr,sv,tr,tw,ua,vi,za
+CONFIGURE_OPTIONS +=	--platform solaris-g++
+CONFIGURE_OPTIONS +=	--enable-langs=am,ar,br,ca,cn,cz,de,dk,en,eo,es,fa,fi,fr,gr,hr,hu,id,it,je,jp,ke,kr,lt,lv,mk,nl,no,pl,pt,ro,ru,sc,si,sk,sr,sv,tr,tw,ua,vi,za
 
 # Tests not available from the top-level Makefile, nor via a standard target.
 # We need to add /usr/gnu/bin to the front of the PATH environment variable
--- a/components/emacs/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/emacs/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -72,6 +72,9 @@
 #
 #CONFIGURE_PREFIX =	$(PROTO_DIR)/usr
 
+# configure env common to all variants of emacs that we want to build.
+CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
+
 # The configure script runs the pkg-config command. This allows it to
 # find the non-default GnuTLS v3 library.
 CONFIGURE_ENV +=	PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig/gnutls-3
@@ -82,7 +85,6 @@
 CONFIGURE_ENV +=	XMKMF="false" 
 
 # configure options common to all variants of emacs that we want to build.
-CONFIGURE_OPTIONS +=	CC="$(CC) -m64"
 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS +=	--datarootdir=$(CONFIGURE_PREFIX)/share
 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
--- a/components/gcc3/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/gcc3/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -55,20 +55,14 @@
 
 CONFIGURE_PREFIX =	/usr/gcc/3.4
 
-# we need to override CONFIGURE_OPTIONS because GCC uses a configure that
-# can't deal with CC as an argument
-CONFIGURE_OPTIONS =	 --prefix=$(CONFIGURE_PREFIX)
-CONFIGURE_OPTIONS +=	 --mandir=$(CONFIGURE_MANDIR)
-CONFIGURE_OPTIONS +=	 --infodir=$(CONFIGURE_PREFIX)/share/info
+CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
 CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
 CONFIGURE_OPTIONS +=	--enable-languages='c,c++,f77,objc'
 CONFIGURE_OPTIONS +=	--enable-shared
 # sparc and x86 use different assemblers
 CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=/usr/bin/as
 CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=/usr/gnu/bin/as
-CONFIGURE_OPTIONS +=	$(CONFIGURE_OPTIONS.$(MACH))
 
-CONFIGURE_ENV += 	CC="$(CC)"
 CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
 
 COMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
--- a/components/gd2/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/gd2/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -42,9 +42,6 @@
 include $(WS_MAKE_RULES)/ips.mk
 include $(WS_MAKE_RULES)/lint-libraries.mk
 
-PKG_CONFIG_PATH_32 = /usr/lib/pkgconfig
-PKG_CONFIG_PATH_64 = /usr/lib/$(MACH64)/pkgconfig
-
 PATCH_LEVEL = 0
 
 CFLAGS += $(CPP_LARGEFILES)
@@ -56,7 +53,6 @@
 
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH_$(BITS))"
 
 CONFIGURE_OPTIONS  +=           --includedir=$(CONFIGURE_INCLUDEDIR)/gd2
 CONFIGURE_OPTIONS  +=           --disable-static
--- a/components/ggrep/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/ggrep/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		grep
@@ -43,8 +44,11 @@
 # We need to be able to return from void functions
 CFLAGS	+=			$(studio_FEATURES_EXTENSIONS)
 
+# 64-bit only components are delivered to the "32-bit" locations since we don't
+# need both versions.
+CONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/gnu/bin
+
 CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS  +=		--prefix=/usr
 
 # Enable aslr for this component
 ASLR_MODE = $(ASLR_ENABLE)
--- a/components/ggrep/gnu-grep.p5m	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/ggrep/gnu-grep.p5m	Mon Nov 23 15:33:43 2015 -0800
@@ -40,9 +40,9 @@
 link path=usr/bin/ggrep target=../gnu/bin/grep facet.compat.gnulinks=true
 
 
-file usr/bin/$(MACH64)/egrep path=usr/gnu/bin/egrep
-file usr/bin/$(MACH64)/fgrep path=usr/gnu/bin/fgrep
-file usr/bin/$(MACH64)/grep path=usr/gnu/bin/grep
+file path=usr/gnu/bin/egrep
+file path=usr/gnu/bin/fgrep
+file path=usr/gnu/bin/grep
 file usr/share/man/man1/egrep.1 path=usr/gnu/share/man/man1/egrep.1
 file usr/share/man/man1/fgrep.1 path=usr/gnu/share/man/man1/fgrep.1
 file usr/share/man/man1/grep.1 path=usr/gnu/share/man/man1/grep.1
--- a/components/ghostscript/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/ghostscript/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -47,6 +47,11 @@
 
 PATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 
+# ghostscript uses a non-standard hybrid-build to build both 32 and 64-bit;
+# override these to prevent build failure.
+CC_FOR_BUILD=
+CONFIGURE_CPPFLAGS=
+
 # configure(1) options to use
 CONFIGURE_OPTIONS +=	--with-drivers=ALL
 CONFIGURE_OPTIONS +=	--with-ijs
--- a/components/gnump/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/gnump/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -90,8 +90,6 @@
 # libgmpxx.so.4 always gets built with unnecessary paths in RUNPATH/RPATH
 ELFEDIT = /usr/bin/elfedit
 
-CONFIGURE_ENV += CC="$(CC)"
-CONFIGURE_ENV += CXX="$(CXX)"
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CC_BITS) $(CXXFLAGS)"
--- a/components/gnupg/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/gnupg/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gnupg
@@ -119,8 +120,6 @@
 CONFIGURE_OPTIONS  +=		--with-zlib=$(CONFIGURE_PREFIX)
 CONFIGURE_OPTIONS  +=		--with-bzip2=$(CONFIGURE_PREFIX)
 CONFIGURE_OPTIONS  +=		--with-readline=$(CONFIGURE_PREFIX)
-CONFIGURE_BINDIR.64 =   $(CONFIGURE_PREFIX)/bin
-CONFIGURE_SBINDIR.64 =  $(CONFIGURE_PREFIX)/sbin
 
 LIBKSBA_MANIFEST = 	manifest-$(MACH)-libksba.depend
 LIBASSUAN_MANIFEST =	manifest-$(MACH)-libassuan.depend
--- a/components/gnupth/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/gnupth/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -61,7 +61,6 @@
 CONFIGURE_OPTIONS  +=	--localstatedir=/var
 CONFIGURE_OPTIONS  +=	--with-pic
 
-CONFIGURE_ENV  +=   CC="$(CC)"
 CONFIGURE_ENV  +=   LD="$(CC) $(CFLAGS) $(LDFLAGS)"
 CONFIGURE_ENV  +=   CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV  +=   CPPFLAGS="$(CPPFLAGS)"
--- a/components/ilmbase/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/ilmbase/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -53,7 +53,6 @@
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
 CONFIGURE_ENV += LIBS="$(LIBS)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 CONFIGURE_OPTIONS  +=           --disable-static
 CONFIGURE_OPTIONS  +=           --enable-threading
--- a/components/lcms/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/lcms/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -65,7 +65,6 @@
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
 CONFIGURE_ENV += PYTHON="$(PYTHON)"
 CONFIGURE_ENV += PYTHONMODULEDIR="$(PYTHON_VENDOR_PACKAGES)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 CONFIGURE_OPTIONS  +=           --includedir=/usr/include/lcms
 CONFIGURE_OPTIONS  +=           --enable-shared
--- a/components/mailman/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/mailman/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 #
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mailman
@@ -41,7 +42,7 @@
 CONFIGURE_ENV	+=	MAILMAN_USER=mailman
 CONFIGURE_ENV	+=	MAILMAN_GROUP=mailman
 
-CONFIGURE_OPTIONS +=	--prefix=/usr/lib/mailman
+CONFIGURE_PREFIX= /usr/lib/mailman
 CONFIGURE_OPTIONS +=	--with-var-prefix=/var/mailman
 CONFIGURE_OPTIONS +=	--with-mail-gid=other
 CONFIGURE_OPTIONS +=	--with-cgi-gid=webservd
--- a/components/mpfr/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/mpfr/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -76,9 +76,7 @@
      '-e "/DEPDIR=/d"' \
      '-e "s/^make\[[0-9]\{1,\}\]/make/g"'
 
-CONFIGURE_ENV += CC="$(CC)"
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
 CONFIGURE_ENV += LD="$(CC) $(CFLAGS) $(LDFLAGS)"
 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
 CONFIGURE_ENV += CPP="$(CC) $(CPPFLAGS) $(CFLAGS) -E"
--- a/components/ncftp/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/ncftp/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -23,6 +23,7 @@
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		ncftp
@@ -44,11 +45,8 @@
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D))
 
-CONFIGURE_ENV += CC="$(CC)"
-CONFIGURE_ENV += CXX="$(CXX)"
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 
-CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
 CONFIGURE_OPTIONS += --srcdir=$(BUILD_DIR_64) 
 
 ASLR_MODE = $(ASLR_ENABLE)
--- a/components/nmap/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/nmap/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -53,7 +53,6 @@
 CONFIGURE_OPTIONS  +=   CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS  +=   CXX="$(CXX)"
 CONFIGURE_OPTIONS  +=   CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_OPTIONS  +=   CPPFLAGS="$(CPPFLAGS)"
 CONFIGURE_OPTIONS  +=   LDFLAGS="$(LDFLAGS) -m64"
 CONFIGURE_OPTIONS  +=   LIBS="-lsocket -lnsl"
 CONFIGURE_OPTIONS  +=   PYTHON="$(PYTHON.$(PYTHON_VERSION))"
--- a/components/openexr/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/openexr/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -63,7 +63,6 @@
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
 CONFIGURE_ENV += LIBS="$(LIBS)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 
 CONFIGURE_OPTIONS  +=           --disable-static
 CONFIGURE_OPTIONS  +=           --enable-threading
--- a/components/openldap/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/openldap/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -71,7 +71,6 @@
 CFLAGS += $(CPP_LARGEFILES) $(CC_PIC) $(studio_NORUNPATH)
 
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 CONFIGURE_ENV += "ac_cv_lib_net_main=no"
 CONFIGURE_ENV += "ac_cv_lib_net_socket==no"
 CONFIGURE_ENV += "ac_cv_lib_inet_socket==no"
--- a/components/openssl/openssl-default/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/openssl/openssl-default/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -65,6 +65,11 @@
 # OpenSSL does not use autoconf but its own configure system.
 CONFIGURE_SCRIPT = $(SOURCE_DIR)/Configure
 
+# Ignore default CC_FOR_BUILD, CC, and CXX in CONFIGURE_ENV.
+CONFIGURE_ENV += CC_FOR_BUILD=
+CONFIGURE_ENV += CC=
+CONFIGURE_ENV += CXX=
+
 # This is to force OpenSSL's Configure script to use gmake for 'make links'. 
 # Otherwise it fails with:
 #     mksh: Fatal error in reader: Unmatched `(' on line
--- a/components/openssl/openssl-fips-140/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/openssl/openssl-fips-140/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -75,6 +75,11 @@
 FIPS_BUILD_DIR_64 = $(shell echo $(BUILD_DIR_64) | \
     sed -e 's/openssl-fips-140/openssl-fips/g' )
 
+# Ignore default CC_FOR_BUILD, CC, and CXX in CONFIGURE_ENV.
+CONFIGURE_ENV += CC_FOR_BUILD=
+CONFIGURE_ENV += CC=
+CONFIGURE_ENV += CXX=
+
 CONFIGURE_OPTIONS =  -DSOLARIS_OPENSSL -DNO_WINDOWS_BRAINDEATH
 CONFIGURE_OPTIONS += --openssldir=/etc/openssl
 CONFIGURE_OPTIONS += --prefix=/usr
--- a/components/openssl/openssl-fips/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/openssl/openssl-fips/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -97,6 +97,10 @@
 COMPONENT_BUILD_TARGETS =
 COMPONENT_INSTALL_ARGS =
 COMPONENT_INSTALL_TARGETS = install
+# Ignore default CC_FOR_BUILD, CC, and CXX in CONFIGURE_ENV.
+CONFIGURE_ENV += CC_FOR_BUILD=
+CONFIGURE_ENV += CC=
+CONFIGURE_ENV += CXX=
 CONFIGURE_ENV += FIPS_SITE_LD=$(LD) PATH=$(FIPS_PATH_$(BITS))
 # Add COMPONENT_DIR to PATH so cc wrapper can be found.
 COMPONENT_BUILD_ENV += FIPS_SITE_LD=$(LD) REALCC=$(CC) MYMAKE=$(MAKE) PATH=$(COMPONENT_DIR):$(PATH)
--- a/components/pconsole/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/pconsole/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -23,6 +23,7 @@
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 
+BITS=64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		pconsole
@@ -38,6 +39,8 @@
 TPNO=			9270
 
 include $(WS_MAKE_RULES)/prep.mk
+# DESTDIR doesn't work correctly; omit default directories.
+CONFIGURE_DEFAULT_DIRS=no
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
 
@@ -45,16 +48,11 @@
 COMPONENT_PRE_CONFIGURE_ACTION = \
         ($(CLONEY) $(SOURCE_DIR) $(@D))
 
-# -I argument needed to find the generated config.h file.
-# CC_BITS needed to ensure -m64 is used for 64-bit compile
+# -I argument needed to find the generated config.h file.  Also, pconsole
+# configure.in forcibly overrides CFLAGS, so we override the compiler to
+# specify required flags.
 CONFIGURE_ENV += "CC=$(CC) -I. $(CC_BITS)"
 
-# If the configure options are not explicitly set, then configure fails with:
-# configure: warning: CC=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/cc: invalid host type
-# configure: warning: CXX=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/CC: invalid host type
-# configure: error: can only configure for one host and one target at a time
-CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
-
 ASLR_MODE = $(ASLR_ENABLE)
 
 # DESTDIR doesn't work correctly, so we specify some of the paths directly.
--- a/components/pcre/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/pcre/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -69,10 +69,8 @@
 
 LINTFLAGS+=	-I. $(studio_XBITS) $(CPP_LARGEFILES)
 
-CONFIGURE_ENV+= "CC=$(CC)"
 CONFIGURE_ENV+=	"CFLAGS=$(CFLAGS)"
 CONFIGURE_ENV+=	"CPP=$(CC) $(CPPFLAGS) $(CFLAGS) -E"
-CONFIGURE_ENV+= "CXX=$(CXX)"
 CONFIGURE_ENV+=	"CXXFLAGS=$(CXXFLAGS)"
 CONFIGURE_ENV+=	"CXXCPP=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -E"
 CONFIGURE_ENV+=	"LDFLAGS=$(LDFLAGS)"
--- a/components/r/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/r/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -62,12 +62,9 @@
 
 F95 =			$(SPRO_VROOT)/bin/f95
 
-CONFIGURE_ENV += CC="$(CC)"
-CONFIGURE_ENV += CXX="$(CXX)"
 CONFIGURE_ENV += F77="$(F95) $(CC_BITS)"
 CONFIGURE_ENV += FC="$(F95) $(CC_BITS)"
 
-CONFIGURE_ENV += CPPFLAGS=""
 CONFIGURE_ENV += CPICFLAGS="$(studio_PIC)"
 CONFIGURE_ENV += CFLAGS="-xO3 -xc99 -xlibmieee $(CC_BITS)"
 CONFIGURE_ENV += CXXFLAGS="-xO3 $(CC_BITS)"
--- a/components/stdcxx/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/stdcxx/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -172,8 +172,6 @@
 # a whitespace.
 BUILD_NLSPATH = :%N.cat:/usr/lib/locale/%L/%N.cat:/usr/share/locale/%L/%N.cat:$(BUILD_DIR_$(BITS))/lib/rwstderr.cat
 
-CONFIGURE_ENV = 	CC="$(CC)"
-CONFIGURE_ENV +=	CXX="$(CXX)"
 CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV +=	CPPFLAGS="$(CPPFLAGS)"
 CONFIGURE_ENV +=	CXXFLAGS="$(CXXFLAGS)"
--- a/components/subversion/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/subversion/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -101,11 +101,8 @@
 			    install-mods-shared \
 			    install-bin install-docs
 
-CONFIGURE_ENV += CC="$(CC)"
-CONFIGURE_ENV += CXX="$(CXX)"
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
 CONFIGURE_ENV += PYTHON="$(PYTHON.$(BITS))"
 CONFIGURE_ENV += PYMODS="$(PYMODS)"
 CONFIGURE_ENV += PYTHONPATH="$(PYTHON_VENDOR_PACKAGES.$(BITS))"
@@ -114,8 +111,8 @@
 CONFIGURE_ENV += PLMODS="$(PLMODS)"
 CONFIGURE_ENV += LD_OPTIONS="$(LD_OPTIONS)"
 
-LIBSVNDIR.32 = $(CONFIGURE_PREFIX)/lib/svn
-LIBSVNDIR.64 = $(CONFIGURE_PREFIX)/lib/svn/$(MACH64)
+CONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib/svn
+CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/svn/$(MACH64)
 
 APR-CONFIG.32 = /usr/apr/$(APR_VERSION)/bin/apr-1-config
 APR-CONFIG.64 = /usr/apr/$(APR_VERSION)/bin/$(MACH64)/apr-1-config
@@ -130,17 +127,11 @@
 APACHE_LIBEXECDIR.32 = `$(APXS.32) -q libexecdir`
 APACHE_LIBEXECDIR.64 = `$(APXS.64) -q libexecdir`
 
-LDFLAGS += -R$(LIBSVNDIR.$(BITS)) -R$(APR-CONFIG-RPATH.$(BITS)) \
+LDFLAGS += -R$(CONFIGURE_LIBDIR.$(BITS)) -R$(APR-CONFIG-RPATH.$(BITS)) \
 	   -R$(APU-CONFIG-RPATH.$(BITS))
 
 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
 
-# Let's make noise just because we have to override --libdir
-CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
-CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
-CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
-CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
-CONFIGURE_OPTIONS += --libdir=$(LIBSVNDIR.$(BITS))
 CONFIGURE_OPTIONS += --localstatedir=/var
 CONFIGURE_OPTIONS += --enable-shared 
 CONFIGURE_OPTIONS += --disable-static
--- a/components/sudo/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/sudo/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -44,9 +44,7 @@
 
 COMPONENT_PREP_ACTION = ( cd $(@D) ; $(AUTORECONF) -f -I m4 )
 
-CONFIGURE_ENV +=	"CC=$(CC)"
 CONFIGURE_ENV +=	"CFLAGS=$(CFLAGS)"
-CONFIGURE_ENV +=	"CXX=$(CXX)"
 CONFIGURE_ENV +=	"MAKE=$(GMAKE)"
 CONFIGURE_ENV +=	"CPPFLAGS=$(CPPFLAGS) -I/usr/include/openldap"
 CONFIGURE_ENV +=	"LDFLAGS=$(LDFLAGS) -m64 -lldap_r-2.4"
--- a/components/trousers/patches/configure.in.patch	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/trousers/patches/configure.in.patch	Mon Nov 23 15:33:43 2015 -0800
@@ -1,3 +1,19 @@
+Fix pure 64-bit x86 builds on Solaris, change default port, and ensure endian.h
+is included when appropriate.  No change is necessary for SPARC.
+--- configure.in	2015-10-28 16:05:06.799975827 -0700
++++ configure.in	2015-10-28 16:04:45.893833006 -0700
+@@ -38,6 +38,11 @@
+         *ppc64* | *powerpc64* | *x86_64*)
+ 		CFLAGS="$CFLAGS -m64"
+ 		;;
++        *)
++                ;;
++esac
++
++case $target in
+ 	*solaris*)
+ 		CFLAGS="$CFLAGS -DSOLARIS"
+ 		;;
 --- configure.in	2010-07-08 13:35:18.000000000 -0700
 +++ configure.in	2012-04-10 17:37:23.820532000 -0700
 @@ -143,7 +143,9 @@
--- a/components/unixodbc/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/unixodbc/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -62,9 +62,6 @@
 X11LIB.32 = $(CONFIGURE_PREFIX)/lib
 X11LIB.64 = $(CONFIGURE_PREFIX)/lib/$(MACH64)
 
-PKG_CONFIG_PATH_32 = /usr/lib/pkgconfig
-PKG_CONFIG_PATH_64 = /usr/lib/$(MACH64)/pkgconfig
-
 LD_OPTIONS += -lsocket -lresolv -lnsl -lgen
 
 CONFIGURE_OPTIONS  +=	--includedir=$(CONFIGURE_PREFIX)/include/odbc
@@ -94,12 +91,10 @@
 CONFIGURE_OPTIONS  +=	--disable-ltdl-install
 CONFIGURE_OPTIONS  +=	--with-pic
 
-CONFIGURE_ENV  +=   CC="$(CC)"
 CONFIGURE_ENV  +=   LD="$(CC) $(CFLAGS) $(LDFLAGS)"
 CONFIGURE_ENV  +=   CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV  +=   LDFLAGS="$(LDFLAGS)"
 CONFIGURE_ENV  +=   INSTALL="$(INSTALL)"
-CONFIGURE_ENV  +=   PKG_CONFIG_PATH="$(PKG_CONFIG_PATH_$(BITS))"
 
 PROTOPKGCONFIGDIR32 = $(PROTOUSRLIBDIR)/pkgconfig
 PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig
--- a/components/vim/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/vim/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -75,9 +75,6 @@
 # Put all the binaries directly in /usr/bin, not in /usr/bin/64.
 CONFIGURE_BINDIR.64 =	$(CONFIGURE_PREFIX)/bin
 
-# Use the 64-bit versions of pkg-config files (or GTK+ will add -R/usr/lib)
-CONFIGURE_ENV +=	PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
-
 # Necessary to pass 64-bit flags to the compilation stage.
 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS +=	--with-features=huge
--- a/components/wireshark/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/wireshark/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -61,9 +61,6 @@
 CONFIGURE_OPTIONS +=	PATH="/usr/perl5/bin:/usr/gnu/bin:$(PATH)"
 CONFIGURE_OPTIONS +=	PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig/gnutls-3
 
-# Use the 64-bit versions of pkg-config files
-CONFIGURE_ENV +=	PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
-
 # We need to avoid RPATH=/usr/lib in Wireshark libraries so that we can
 # create successfully IPS package of different Wireshark branch than is
 # installed on build system without dependency errors.
--- a/components/wxwidgets/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/wxwidgets/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -42,11 +42,6 @@
 
 PKG_PROTO_DIRS += $(COMPONENT_DIR)/man
 
-# We need to compile with /usr/lib/$(MACH64)/glib-2.0 to ensure
-# that 64-bit headers will be used, see content of
-# /usr/lib/64/pkgconfig/glib-2.0.pc
-$(BUILD_64): CONFIGURE_OPTIONS += PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig
-
 # get rid of compiler path set in RUNPATH
 LDFLAGS += $(studio_NORUNPATH)
 LDFLAGS += $(CC_BITS)
--- a/components/zlib/Makefile	Mon Nov 16 06:14:40 2015 -0800
+++ b/components/zlib/Makefile	Mon Nov 23 15:33:43 2015 -0800
@@ -38,6 +38,8 @@
 TPNO=			17611
 
 include $(WS_MAKE_RULES)/prep.mk
+# Omit directory options that cause zlib's CMake-based build to fail.
+CONFIGURE_DEFAULT_DIRS=no
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
 include $(WS_MAKE_RULES)/lint-libraries.mk
@@ -86,12 +88,9 @@
 
 # We need to reset configure options here because zlib is confused with
 # CC and CFLAGS definitions as configure parameters.
-CONFIGURE_OPTIONS	=  --shared
-CONFIGURE_OPTIONS	+= --prefix=/usr
-CONFIGURE_OPTIONS	+= $(CONFIGURE_OPTIONS.$(BITS))
+CONFIGURE_OPTIONS	+=  --shared
 CONFIGURE_OPTIONS.64	+= --libdir=/usr/lib/$(MACH64)
 
-CONFIGURE_ENV += CC="$(CC)"
 CONFIGURE_ENV += CFLAGS="$(CFLAGS) -xalias_level=basic -xdepend"
 CONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
 
--- a/doc/makefile-variables.txt	Mon Nov 16 06:14:40 2015 -0800
+++ b/doc/makefile-variables.txt	Mon Nov 23 15:33:43 2015 -0800
@@ -94,7 +94,8 @@
   yielding the wrong results.
 * COMPONENT_BUILD_ENV is for when you just need to override things in the
   calling environment, like PATH.
-* COMPONENT_INSTALL_ARGS is mainly used for altering target directories.
+* COMPONENT_INSTALL_ARGS is mainly used for altering target directories;
+  there are also COMPONENT_INSTALL_ARGS.$(BITS) versions.
 * COMPONENT_INSTALL_ENV is mainly used for altering target directories.
 * COMPONENT_PUBLISH_ENV is so far only used to work around Python issues when
   used by "pkgdepend generate", though the variable may be extended in the
@@ -126,13 +127,37 @@
 * COMPONENT_PREP_ACTION is used to make alterations to the unpacked and patched
   source.  It should be used with care.
 
+For components that have a configure target, the following macros are used to
+control the options and arguments passed:
+
+* If BITS is set before shared-macros.mk is included, the default directories
+  used for various configure options as documented below will change.  For
+  example:
+
+  if BITS=64 explicitly:
+  	32-bit binaries -> $(CONFIGURE_PREFIX)/bin/$(MACH32)
+	32-bit libraries -> $(CONFIGURE_PREFIX)/lib
+  	64-bit binaries -> $(CONFIGURE_PREFIX)/bin
+	64-bit libraries -> $(CONFIGURE_PREFIX)/lib/$(MACH64)
+
+  if BITS=32 explicitly or BITS is unspecified:
+  	32-bit binaries -> $(CONFIGURE_PREFIX)/bin
+	32-bit libraries -> $(CONFIGURE_PREFIX)/lib
+  	64-bit binaries -> $(CONFIGURE_PREFIX)/bin/$(MACH64)
+	64-bit libraries -> $(CONFIGURE_PREFIX)/lib/$(MACH64)
+* CC_FOR_BUILD is included in CONFIGURE_ENV by default to ensure that 32-bit
+  and 64-bit host detection works as expected for autoconf-based components by
+  specifying the exact compiler and relevant $(CC_BITS) for the current build.
+  It can be set to "" to omit it from CONFIGURE_ENV.
+* CONFIGURE_CPPFLAGS contains the default set of CPPFLAGS to be included in
+  CONFIGURE_ENV.  It can be set to "" to omit it from CONFIGURE_ENV.
 * CONFIGURE_DEFAULT_DIRS should be "yes" or "no".  A value of "yes" (the
   default) will trigger the following being passed to CONFIGURE_OPTIONS as
   parameters to corresponding options.
-  * CONFIGURE_BINDIR is the value for the --bindir= option.
-  * CONFIGURE_LIBDIR is the value for the --libdir= option.
-  * CONFIGURE_MANDIR is the value for the --mandir= option.
-  * CONFIGURE_SBINDIR is the value for the --sbindir= option.
+  * CONFIGURE_BINDIR.$(BITS) is the value for the --bindir= option.
+  * CONFIGURE_LIBDIR.$(BITS) is the value for the --libdir= option.
+  * CONFIGURE_MANDIR.$(BITS) is the value for the --mandir= option.
+  * CONFIGURE_SBINDIR.$(BITS) is the value for the --sbindir= option.
 * CONFIGURE_ENV is mainly used for passing CFLAGS and other common Makefile
   variables to configure.  When should this be used as opposed to
   CONFIGURE_OPTIONS and COMPONENT_BUILD_{ARGS,ENV}?  In general, you want
@@ -151,10 +176,36 @@
 * CONFIGURE_SCRIPT should be set if the default "$(SOURCE_DIR)/configure" is
   unsuitable for whatever reason.
 
+To override or otherwise modify the default compilation flags used for
+components, the following macros are provided:
+
+* CFLAGS by default contains the preferred set of compilation flags for most
+  components, which usually includes optimization flags, language mode,
+  alignment flags, and multi-threading flags for the current COMPILER.
+  CFLAGS.$(COMPILER) and CFLAGS.$(COMPILERS).$(BITS) versions are also
+  available for specifying additional flags or overriding the default.
+* CXXFLAGS by default contains the preferred set of compilation flags for most
+  C++ components, which usually includes optimization flags, language mode,
+  alignment flags, and multi-threading flags for the current COMPILER.
+  CXXFLAGS.$(COMPILER) and CXXFLAGS.$(COMPILERS).$(BITS) versions are also
+  available for specifying additional flags or overriding the default.
+* gcc_OPT has a default value of "-O3".  Bugs in the optimizer have been found
+  which have required altering this to "-O2".
 * studio_OPT has a default value of "-xO4".  Occasional bugs in the optimizer
-  have been found which have required altering this to "-xO3".  There are also
-  studio_OPT.$(MACH).$(BITS) versions of this available if greater specificity
-  is needed.
+  have been found which have required altering this to "-xO3".
+* There are also gcc_OPT.$(MACH).$(BITS) and studio_OPT.$(MACH).$(BITS)
+  versions of the above available if greater specificity is needed.
+
+For components that use pkg-config, the following macros are provided:
+
+* PKG_CONFIG_PATH contains the default system paths to use when looking for
+  pkg-config configuration files.  To specify additional paths to be searched,
+  use PKG_CONFIG_PATHS as follows:
+
+  PKG_CONFIG_PATHS += /path/to/pc/files
+
+Finally, for control of packaging-related operations and values used during
+publication, the following macros are available:
 
 * TPNO is the Third Party number (i.e., a numeric value): the License
   Technology from the Product Lifecycle Suite tool.  This should be used
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/cmake.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,86 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for GNOME
+# components.
+#
+include $(WS_MAKE_RULES)/prep.mk
+# Most cmake-based components require intltools.
+include $(WS_MAKE_RULES)/intltool.mk
+# cmake components don't generally use autoconf.
+include $(WS_MAKE_RULES)/justmake.mk
+
+# Ensure correct version of libraries are linked to.
+LDFLAGS += "$(CC_BITS)"
+
+# This component uses cmake to generate Makefiles and so has no configure
+CMAKE = $(shell which cmake)
+CMAKE_BUILD_TYPE ?= RelWithDebInfo
+
+CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER="$(CXX)"
+CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS="$(CXXFLAGS)"
+CMAKE_OPTIONS += -DCMAKE_C_COMPILER="$(CC)"
+CMAKE_OPTIONS += -DCMAKE_C_FLAGS="$(CFLAGS)"
+CMAKE_OPTIONS += -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)"
+
+# Must start install paths with a leading '/' or files will be installed into
+# wrong location!
+CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX="$(USRDIR)"
+CMAKE_OPTIONS += -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)"
+CMAKE_OPTIONS += -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)"
+CMAKE_OPTIONS += -DGETTEXT_MSGFMT_EXECUTABLE="$(GNUBIN)/msgfmt"
+CMAKE_OPTIONS += -DBIN_INSTALL_DIR="$(USRBIN)"
+CMAKE_OPTIONS += -DEXEC_INSTALL_DIR="$(USRBIN)"
+
+# Some components use LIB_INSTALL_DIR, as-is, others forcibly ignore it and set
+# based on CMAKE_INSTALL_PREFIX.  Those usually instead offer a LIB_SUFFIX
+# variable that we can generally use to accomplish the same result.  Setting
+# them both shouldn't harm anything.
+CMAKE_OPTIONS += -DLIB_INSTALL_DIR="$(USRLIB)"
+CMAKE_OPTIONS.64 += -DLIB_SUFFIX="/$(MACH64)"
+CMAKE_OPTIONS += -DLIBEXEC_INSTALL_DIR="$(USRLIB)"
+
+# Required to ensure expected defines are set; also, ensures project's
+# optimisation level set appropriately.
+CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
+
+CMAKE_OPTIONS += $(CMAKE_OPTIONS.$(BITS))
+
+COMPONENT_PRE_BUILD_ACTION += cd $(@D);
+COMPONENT_PRE_BUILD_ACTION += echo Running cmake with $(CMAKE_OPTIONS);
+COMPONENT_PRE_BUILD_ACTION += $(CMAKE) . $(CMAKE_OPTIONS);
+
+# Ensure cmake finds the matching 32/64-bit version of dependencies.
+COMPONENT_BUILD_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
+
+REQUIRED_PACKAGES += developer/build/cmake
+REQUIRED_PACKAGES += developer/build/pkg-config
+REQUIRED_PACKAGES += developer/gnu-binutils
+REQUIRED_PACKAGES += developer/intltool
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/linker
+# Most cmake-based components expect GNU versions of these.
+REQUIRED_PACKAGES += text/gawk
+REQUIRED_PACKAGES += text/gnu-grep
+REQUIRED_PACKAGES += text/gnu-sed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/common-32.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for components
+# that should be built for 32-bit only.
+#
+include $(WS_MAKE_RULES)/ips.mk
+
+ASLR_MODE= $(ASLR_ENABLE)
+
+# common targets
+build:          $(BUILD_32)
+install:        $(INSTALL_32)
+test:           $(TEST_32)
+system-test:    $(SYSTEM_TEST_32)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/common-32_and_64.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for components
+# that should be built for 32-bit and 64-bit.
+#
+include $(WS_MAKE_RULES)/ips.mk
+
+ASLR_MODE= $(ASLR_ENABLE)
+
+# common targets
+build:          $(BUILD_32_and_64)
+install:        $(INSTALL_32_and_64)
+test:           $(TEST_32_and_64)
+system-test:    $(SYSTEM_TEST_32_and_64)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/common-64.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for components
+# that should be built for 64-bit only.
+#
+include $(WS_MAKE_RULES)/ips.mk
+
+ASLR_MODE= $(ASLR_ENABLE)
+
+# common targets
+build:          $(BUILD_64)
+install:        $(INSTALL_64)
+test:           $(TEST_64)
+system-test:    $(SYSTEM_TEST_64)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/common-no_arch.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for components
+# that are architecture independent.
+#
+include $(WS_MAKE_RULES)/ips.mk
+
+ASLR_MODE= $(ASLR_NOT_APPLICABLE)
+
+# common targets
+build:          $(BUILD_NO_ARCH)
+install:        $(INSTALL_NO_ARCH)
+test:           $(TEST_NO_ARCH)
+system-test:    $(SYSTEM_TEST_NO_ARCH)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/configure-32.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for
+# autoconf-based components that should be built for 32-bit only.
+#
+include $(WS_MAKE_RULES)/configure.mk
+configure:      $(CONFIGURE_32)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/configure-32_and_64.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for
+# autoconf-based components that should be built for 32-bit and 64-bit.
+#
+include $(WS_MAKE_RULES)/configure.mk
+configure:      $(CONFIGURE_32_and_64)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/configure-64.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for
+# autoconf-based components that should be built for 64-bit only.
+#
+include $(WS_MAKE_RULES)/configure.mk
+configure:      $(CONFIGURE_64)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/configure-no_arch.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the default options and base requirements for
+# autoconf-based components that should be built architecture independent.
+#
+include $(WS_MAKE_RULES)/configure.mk
+configure:      $(CONFIGURE_NO_ARCH)
--- a/make-rules/configure.mk	Mon Nov 16 06:14:40 2015 -0800
+++ b/make-rules/configure.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -72,16 +72,25 @@
 
 CONFIGURE_DEFAULT_DIRS?=yes
 
-CONFIGURE_OPTIONS += CC="$(CC)"
-CONFIGURE_OPTIONS += CXX="$(CXX)"
+CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
+CONFIGURE_ENV += CC="$(CC)"
+CONFIGURE_ENV += CXX="$(CXX)"
+
 CONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
 ifeq ($(CONFIGURE_DEFAULT_DIRS),yes)
 CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
+ifeq ($(INITIAL_BITS),64)
+CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.32)
+CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.32)
+else
 CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
-CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
 CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
 endif
+CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
+endif
 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
+CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
+CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH).$(BITS))
 
 COMPONENT_INSTALL_ARGS +=	DESTDIR=$(PROTO_DIR)
 
@@ -99,6 +108,31 @@
 CONFIGURE_ENV += ac_cv_header_stdbool_h=yes
 endif
 
+# This MUST be set in the build environment so that if pkg-config is executed
+# during the build process, the correct header files and libraries will be
+# picked up.  In the Linux world, a system is generally only 32-bit or 64-bit
+# at one time so this isn't an issue that various auto* files account for (they
+# don't set PKG_CONFIG_PATH when executing pkg-config even if it was specified
+# during ./configure).
+COMPONENT_BUILD_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
+
+# CC_FOR_BUILD is used by autoconf to set the compiler and required flags for
+# generating native executables and is typically used for host detection and
+# other tests during the autoconf process.  Explicitly specifying the target
+# bits ensures that autoconf reliably detects 32-bit and 64-bit builds.
+CC_FOR_BUILD ?= "$(CC) $(CC_BITS)"
+ifneq  ($(strip $(CC_FOR_BUILD)),)
+CONFIGURE_ENV += CC_FOR_BUILD=$(CC_FOR_BUILD)
+endif
+
+# Similar idea for CPP as above; there's a common macro found in lib-prefix.m4
+# for autoconf that detects a 64-bit host on Solaris by using CPP.  As such, by
+# default, we need to explicitly specify the target bits to ensure that
+# autoconf reliably detects 32-bit and 64-bit builds.
+CONFIGURE_CPPFLAGS ?= $(CC_BITS)
+ifneq  ($(strip $(CONFIGURE_CPPFLAGS)),)
+CONFIGURE_ENV += CPPFLAGS="$(CONFIGURE_CPPFLAGS) $(CPPFLAGS)"
+endif
 
 # temporarily work around some issues
 CONFIGURE_ENV += "ac_cv_func_realloc_0_nonnull=yes"
@@ -106,7 +140,7 @@
 COMPONENT_BUILD_ENV += "ac_cv_func_realloc_0_nonnull=yes"
 
 # configure the unpacked source for building 32 and 64 bit version
-CONFIGURE_SCRIPT =	$(SOURCE_DIR)/configure
+CONFIGURE_SCRIPT ?=	$(SOURCE_DIR)/configure
 $(BUILD_DIR)/%/.configured:	$(SOURCE_DIR)/.prep
 	($(RM) -rf $(@D) ; $(MKDIR) $(@D))
 	$(COMPONENT_PRE_CONFIGURE_ACTION)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make-rules/intltool.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file sets up the necessary overrides for components that use intltool.
+#
+CONFIGURE_ENV += MSGFMT="/usr/bin/gmsgfmt"
+CONFIGURE_ENV += XGETTEXT="/usr/bin/gxgettext"
+CONFIGURE_ENV += ac_cv_path_XGETTEXT="/usr/bin/gxgettext"
--- a/make-rules/ips.mk	Mon Nov 16 06:14:40 2015 -0800
+++ b/make-rules/ips.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -120,6 +120,7 @@
 PKG_MACROS +=		COMPONENT_HG_URL=$(COMPONENT_HG_URL)
 PKG_MACROS +=		COMPONENT_HG_REV=$(COMPONENT_HG_REV)
 PKG_MACROS +=		COMPONENT_NAME=$(COMPONENT_NAME)
+PKG_MACROS +=		ARC_CASE=$(ARC_CASE)
 PKG_MACROS +=		TPNO=$(TPNO)
 PKG_MACROS +=		CONSOLIDATION_CHANGESET=$(CONSOLIDATION_CHANGESET)
 PKG_MACROS +=		CONSOLIDATION_REPOSITORY_URL=$(CONSOLIDATION_REPOSITORY_URL)
--- a/make-rules/justmake.mk	Mon Nov 16 06:14:40 2015 -0800
+++ b/make-rules/justmake.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -45,6 +45,7 @@
 #
 
 COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
+COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
 
 # build the configured source
 $(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
--- a/make-rules/shared-macros.mk	Mon Nov 16 06:14:40 2015 -0800
+++ b/make-rules/shared-macros.mk	Mon Nov 23 15:33:43 2015 -0800
@@ -86,6 +86,12 @@
 PUBLISHER ?=	nightly
 PUBLISHER_LOCALIZABLE ?=	$(CONSOLIDATION)-localizable
 
+# Defines $(space) as a single blank space, so we can use it to convert
+# space-separated paths to colon-separated paths in variables with
+# $(subst $(space),:,$(strip $(SPATHS)))
+empty :=
+space := $(empty) $(empty)
+
 ROOT =			/
 
 # The changset and external source repo used in building the packages.
@@ -112,7 +118,13 @@
 include $(WS_MAKE_RULES)/ips-buildinfo.mk
 
 COMPILER ?=		studio
-BITS =			32
+BITS ?=			32
+
+# The values of BITS changes during the build process for components that
+# are built 32-bit and 64-bit.  This macro makes it possible to determine
+# which components are only built 64-bit and allow other make-rules files
+# to adjust accordingly.
+INITIAL_BITS=		$(BITS)
 
 # The default version should go last.
 PYTHON_VERSION =	2.7
@@ -140,6 +152,7 @@
 BINDIR =	/bin
 SBINDIR =	/sbin
 LIBDIR =	/lib
+VARDIR =	/var
 USRBINDIR =	$(USRDIR)/bin
 USRBINDIR64 =	$(USRDIR)/bin/$(MACH64)
 USRSBINDIR =	$(USRDIR)/sbin
@@ -149,6 +162,8 @@
 USRSHARELOCALEDIR =	$(USRSHAREDIR)/locale
 USRSHAREMANDIR =	$(USRSHAREDIR)/man
 USRSHAREDOCDIR =	$(USRSHAREDIR)/doc
+USRSHAREFONTSDIR =	$(USRSHAREDIR)/fonts
+USRSHARETTFONTSDIR =	$(USRSHAREFONTSDIR)/TrueType
 USRSHARELIBDIR =	$(USRSHAREDIR)/lib
 USRSHAREMAN1DIR =	$(USRSHAREMANDIR)/man1
 USRSHAREMAN1MDIR =	$(USRSHAREMANDIR)/man1m
@@ -161,16 +176,21 @@
 PROTOETCSECDIR = $(PROTO_DIR)/$(ETCDIR)/security
 PROTOUSRDIR =	$(PROTO_DIR)/$(USRDIR)
 PROTOLIBDIR =	$(PROTO_DIR)/$(LIBDIR)
+PROTOSVCMANIFESTDIR =	$(PROTOLIBDIR)/svc/manifest
+PROTOSVCMETHODDIR =	$(PROTOLIBDIR)/svc/method
 PROTOUSRBINDIR =	$(PROTO_DIR)/$(USRBINDIR)
 PROTOUSRBINDIR64 =	$(PROTO_DIR)/$(USRBINDIR64)
 PROTOUSRSBINDIR =	$(PROTO_DIR)/$(USRSBINDIR)
 PROTOUSRLIBDIR =	$(PROTO_DIR)/$(USRLIBDIR)
 PROTOUSRLIBDIR64 =	$(PROTO_DIR)/$(USRLIBDIR64)
+PROTOPKGCONFIGDIR = 	$(PROTOUSRLIBDIR)/pkgconfig
+PROTOPKGCONFIGDIR64 =	$(PROTOUSRLIBDIR64)/pkgconfig
 PROTOUSRINCDIR =	$(PROTO_DIR)/$(USRINCDIR)
 PROTOUSRSHAREDIR =	$(PROTO_DIR)/$(USRSHAREDIR)
 PROTOUSRSHARELIBDIR =	$(PROTO_DIR)/$(USRSHARELIBDIR)
+PROTOUSRSHAREDOCDIR =	$(PROTO_DIR)/$(USRSHAREDOCDIR)
+PROTOUSRSHAREINFODIR =	$(PROTOUSRSHAREDIR)/info
 PROTOUSRSHAREMANDIR =	$(PROTO_DIR)/$(USRSHAREMANDIR)
-PROTOUSRSHAREDOCDIR =	$(PROTO_DIR)/$(USRSHAREDOCDIR)
 PROTOUSRSHAREMAN1DIR =	$(PROTO_DIR)/$(USRSHAREMAN1DIR)
 PROTOUSRSHAREMAN1MDIR =	$(PROTO_DIR)/$(USRSHAREMAN1MDIR)
 PROTOUSRSHAREMAN3DIR =	$(PROTO_DIR)/$(USRSHAREMAN3DIR)
@@ -501,6 +521,10 @@
 USRBIN.64 =	/usr/bin/$(MACH64)
 USRBIN =	$(USRBIN.$(BITS))
 
+USRLIB.32 =	$(USRLIBDIR)
+USRLIB.64 =	$(USRLIBDIR64)
+USRLIB =	$(USRLIB.$(BITS))
+
 PYTHON.2.7.32 =	$(USRBIN.32)/python2.7
 PYTHON.2.7.64 =	$(USRBIN.64)/python2.7
 PYTHON.2.7 =	$(USRBIN)/python2.7
@@ -607,10 +631,15 @@
 INS.dir=        $(INSTALL) -d $@
 INS.file=       $(INSTALL) -m 444 $< $(@D)
 
+#
+# To simplify adding directories to PKG_CONFIG_PATH, since += adds spaces, not :
+# use PKG_CONFIG_PATHS += ... and the following will convert to the : form
+#
 PKG_CONFIG_PATH.32 = /usr/lib/pkgconfig
 PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig
-PKG_CONFIG_PATH = $(PKG_CONFIG_PATH.$(BITS))
-
+PKG_CONFIG_DEFAULT = $(PKG_CONFIG_PATH.$(BITS))
+PKG_CONFIG_PATH    = $(subst $(space),:,$(strip \
+			$(PKG_CONFIG_PATHS) $(PKG_CONFIG_DEFAULT)))
 
 #
 # C preprocessor flag sets to ease feature selection.  Add the required
@@ -668,13 +697,13 @@
 
 # Turn on recognition of supported C99 language features and enable the 1999 C
 # standard library semantics of routines that appear in	both the 1990 and
-# 1999 C standard. To use set studio_C99MODE=$(studio_99_ENABLE) in your
+# 1999 C standard. To use set studio_C99MODE=$(studio_C99_ENABLE) in your
 # component Makefile.
 studio_C99_ENABLE =		-xc99=all
 
 # Turn off recognition of C99 language features, and do not enable the 1999 C
 # standard library semantics of routines that appeared in both the 1990	and
-# 1999 C standard.  To use set studio_C99MODE=$(studio_99_DISABLE) in your
+# 1999 C standard.  To use set studio_C99MODE=$(studio_C99_DISABLE) in your
 # component Makefile.
 studio_C99_DISABLE =	-xc99=none
 
@@ -696,11 +725,11 @@
 studio_FEATURES_EXTENSIONS =	-features=extensions
 
 # Control the Studio optimization level.
-studio_OPT.sparc.32 =	-xO4
-studio_OPT.sparc.64 =	-xO4
-studio_OPT.i386.32 =	-xO4
-studio_OPT.i386.64 =	-xO4
-studio_OPT =		$(studio_OPT.$(MACH).$(BITS))
+studio_OPT.sparc.32 ?=	-xO4
+studio_OPT.sparc.64 ?=	-xO4
+studio_OPT.i386.32 ?=	-xO4
+studio_OPT.i386.64 ?=	-xO4
+studio_OPT ?=		$(studio_OPT.$(MACH).$(BITS))
 
 # Studio PIC code generation.  Use CC_PIC instead to select PIC code generation.
 studio_PIC = 	-KPIC -DPIC
@@ -758,6 +787,14 @@
 			$(studio_IROPTS) $(studio_C99MODE) $(studio_ALIGN) \
 			$(studio_MT)
 
+# Default Studio C++ compiler flags.  Add the required feature to your Makefile
+# with CXXFLAGS += $(FEATURE_MACRO) and add to the component build with
+# CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)" or similiar.  In most cases, it
+# should not be necessary to add CXXFLAGS to any environment other than the
+# configure environment.
+CXXFLAGS.studio +=	$(studio_OPT) $(studio_XBITS) $(studio_XREGS) \
+			$(studio_IROPTS) $(studio_ALIGN)
+
 #
 # GNU C compiler flag sets to ease feature selection.  Add the required
 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
@@ -765,13 +802,17 @@
 #
 
 # GCC Compiler optimization flag
-gcc_OPT =	-O3
+gcc_OPT.sparc.32 ?=	-O3
+gcc_OPT.sparc.64 ?=	-O3
+gcc_OPT.i386.32 ?=	-O3
+gcc_OPT.i386.64 ?=	-O3
+gcc_OPT ?=		$(gcc_OPT.$(MACH).$(BITS))
 
 # GCC PIC code generation.  Use CC_PIC instead to select PIC code generation.
 gcc_PIC =	-fPIC -DPIC
 
 # Generic macro for PIC code generation.  Use this macro instead of the
-# compiler specific variant.
+# compiler-specific variant.
 CC_PIC =	$($(COMPILER)_PIC)
 
 
@@ -785,13 +826,22 @@
 CFLAGS.gcc3 +=	$(gcc_OPT)
 CFLAGS.gcc3 +=	$(gcc_XREGS)
 
+# Default GNU C++ compiler flags.  Add the required feature to your Makefile
+# with CXXFLAGS += $(FEATURE_MACRO) and add to the component build with
+# CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)" or similiar.  In most cases, it
+# should not be necessary to add CXXFLAGS to any environment other than the
+# configure environment.
+CXXFLAGS.gcc +=		$(gcc_OPT)
+CXXFLAGS.gcc +=		$(gcc_XREGS)
+CXXFLAGS.gcc3 +=	$(gcc_OPT)
+CXXFLAGS.gcc3 +=	$(gcc_XREGS)
 
 # Build 32 or 64 bit objects.
 CFLAGS +=	$(CC_BITS)
 
-# Add compiler specific 'default' features
+# Add compiler-specific 'default' features
 CFLAGS +=	$(CFLAGS.$(COMPILER))
-
+CFLAGS +=	$(CFLAGS.$(COMPILER).$(BITS))
 
 # Studio C++ requires -norunpath to avoid adding its location into the RUNPATH
 # to C++ applications.
@@ -822,6 +872,10 @@
 # Build 32 or 64 bit objects in C++ as well.
 CXXFLAGS +=	$(CC_BITS)
 
+# Add compiler-specific 'default' features
+CXXFLAGS +=	$(CXXFLAGS.$(COMPILER))
+CXXFLAGS +=	$(CXXFLAGS.$(COMPILER).$(BITS))
+
 #
 # Solaris linker flag sets to ease feature selection.  Add the required
 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
--- a/transforms/actuators	Mon Nov 16 06:14:40 2015 -0800
+++ b/transforms/actuators	Mon Nov 23 15:33:43 2015 -0800
@@ -20,10 +20,10 @@
 #
 
 #
-# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 
-# SFW service manifests
+# SMF service manifests
 <transform file path=(var|lib)/svc/manifest/.*\.xml$ -> \
     default restart_fmri svc:/system/manifest-import:default>
 
@@ -41,6 +41,22 @@
 <transform file path=usr/share/applications/.*\.desktop$ -> \
     default restart_fmri svc:/application/desktop-cache/desktop-mime-cache:default>
 
+# GNOME/XDG icons
+<transform file path=usr/share/icons/.*$ -> \
+    default restart_fmri svc:/application/desktop-cache/icon-cache:default>
+
+# GNOME/XDG mime-types
+<transform file path=usr/share/mime/packages/.*\.xml$ -> \
+    default restart_fmri svc:/application/desktop-cache/mime-types-cache:default>
+
+# GNOME gtk Input Method modules
+<transform file path=usr/lib.*/gtk-.*/.*/immodules/.*.so$ -> \
+    default restart_fmri svc:/application/desktop-cache/input-method-cache:default>
+
+# GNOME gdk-pixbuf image loader modules
+<transform file path=usr/lib.*/gdk-pixbuf-.*/.*/loaders/.*.so$ -> \
+    default restart_fmri svc:/application/desktop-cache/pixbuf-loaders-installer:default>
+
 # RAD
 <transform file path=usr/lib/rad/.* -> add restart_fmri \
     svc:/system/rad:local>
--- a/transforms/generate-cleanup	Mon Nov 16 06:14:40 2015 -0800
+++ b/transforms/generate-cleanup	Mon Nov 23 15:33:43 2015 -0800
@@ -41,34 +41,34 @@
 #<transform set name=pkg.fmri -> edit value "@[^ \t\n\r\f\v]*" "@$!(IPS_COMPONENT_VERSION),$!(BUILD_VERSION)">
 
 <transform dir file link hardlink -> \
-	edit path "/(sparcv9|amd64)$" "/$!(MACH64)">
+    edit path "/(sparcv9|amd64)$" "/$!(MACH64)">
 <transform dir file link hardlink -> \
-	edit path "/(sparcv9|amd64)/" "/$!(MACH64)/">
+    edit path "/(sparcv9|amd64)/" "/$!(MACH64)/">
 <transform dir file link hardlink -> \
-	edit path "/(sparcv7|i86)$" "/$!(MACH32)">
+    edit path "/(sparcv7|i86)$" "/$!(MACH32)">
 <transform dir file link hardlink -> \
-	edit path "/(sparcv7|i86)/" "/$!(MACH32)/">
+    edit path "/(sparcv7|i86)/" "/$!(MACH32)/">
 <transform dir file link hardlink -> \
-	edit path "/(sparc|i386)$" "/$!(MACH)">
+    edit path "/(sparc|i386)$" "/$!(MACH)">
 <transform dir file link hardlink -> \
-	edit path "/(sparc|i386)/" "/$!(MACH)/">
+    edit path "/(sparc|i386)/" "/$!(MACH)/">
 <transform dir file link hardlink -> \
-	edit path "/(sparc|i386)-(sun|pc)-solaris\d\.\d+" "/$!(MACH)-$!(PLAT)-solaris$!(SOLARIS_RELEASE)">
+    edit path "/(sparc|i386)-(sun|pc)-solaris\d\.\d+" "/$!(MACH)-$!(PLAT)-solaris$!(SOLARIS_RELEASE)">
 
 <transform dir file link hardlink -> \
-	edit target "/(sparcv9|amd64)$" "/$!(MACH64)">
+    edit target "/(sparcv9|amd64)$" "/$!(MACH64)">
 <transform dir file link hardlink -> \
-	edit target "/(sparcv9|amd64)/" "/$!(MACH64)/">
+    edit target "/(sparcv9|amd64)/" "/$!(MACH64)/">
 <transform dir file link hardlink -> \
-	edit target "/(sparcv7|i86)$" "/$!(MACH32)">
+    edit target "/(sparcv7|i86)$" "/$!(MACH32)">
 <transform dir file link hardlink -> \
-	edit target "/(sparcv7|i86)/" "/$!(MACH32)/">
+    edit target "/(sparcv7|i86)/" "/$!(MACH32)/">
 <transform dir file link hardlink -> \
-	edit target "/(sparc|i386)$" "/$!(MACH)">
+    edit target "/(sparc|i386)$" "/$!(MACH)">
 <transform dir file link hardlink -> \
-	edit target "/(sparc|i386)/" "/$!(MACH)/">
+    edit target "/(sparc|i386)/" "/$!(MACH)/">
 <transform dir file link hardlink -> \
-	edit target "/(sparc|i386)-(sun|pc)-solaris\d\.\d+" "/$!(MACH)-$!(PLAT)-solaris$!(SOLARIS_RELEASE)">
+    edit target "/(sparc|i386)-(sun|pc)-solaris\d\.\d+" "/$!(MACH)-$!(PLAT)-solaris$!(SOLARIS_RELEASE)">
 
 # <transform dir file link hardlink -> \
 # 	edit path "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
@@ -76,35 +76,57 @@
 # 	edit target "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
 
 <transform dir file link hardlink -> \
-	edit path "$(COMPONENT_VERSION)" "$!(COMPONENT_VERSION)">
+    edit path "$(COMPONENT_VERSION)" "$!(COMPONENT_VERSION)">
 <transform dir file link hardlink -> \
-	edit target "$(COMPONENT_VERSION)" "$!(COMPONENT_VERSION)">
+    edit target "$(COMPONENT_VERSION)" "$!(COMPONENT_VERSION)">
 
 <transform dir file link hardlink -> \
-	edit path "$(IPS_VERSION)" "$!(IPS_VERSION)">
+    edit path "$(IPS_VERSION)" "$!(IPS_VERSION)">
 <transform dir file link hardlink -> \
-	edit target "$(IPS_VERSION)" "$!(IPS_VERSION)">
+    edit target "$(IPS_VERSION)" "$!(IPS_VERSION)">
 
 # convert temporary macro names to their real name
 <transform set -> \
-	edit value "\$!\((.*)\)" "$(\1)">
+    edit value "\$!\((.*)\)" "$(\1)">
+<transform dir file link hardlink -> \
+    edit path "\$!\((.*)\)" "$(\1)">
 <transform dir file link hardlink -> \
-	edit path "\$!\((.*)\)" "$(\1)">
+    edit target "\$!\((.*)\)" "$(\1)">
+<transform dir file link hardlink -> \
+    edit path "\$!\((.*)\)" "$(\1)">
+<transform dir file link hardlink -> \
+    edit target "\$!\((.*)\)" "$(\1)">
 <transform dir file link hardlink -> \
-	edit target "\$!\((.*)\)" "$(\1)">
+    edit path "\$!\((.*)\)" "$(\1)">
+<transform dir file link hardlink -> \
+    edit target "\$!\((.*)\)" "$(\1)">
 <transform dir file link hardlink -> \
-	edit path "\$!\((.*)\)" "$(\1)">
+    edit path "\$!\((.*)\)" "$(\1)">
 <transform dir file link hardlink -> \
-	edit target "\$!\((.*)\)" "$(\1)">
+    edit target "\$!\((.*)\)" "$(\1)">
+<transform dir file link hardlink -> \
+    edit path "\$!\((.*)\)" "$(\1)">
 <transform dir file link hardlink -> \
-	edit path "\$!\((.*)\)" "$(\1)">
-<transform dir file link hardlink -> \
-	edit target "\$!\((.*)\)" "$(\1)">
-<transform dir file link hardlink -> \
-	edit path "\$!\((.*)\)" "$(\1)">
-<transform dir file link hardlink -> \
-	edit target "\$!\((.*)\)" "$(\1)">
-<transform dir file link hardlink -> \
-	edit path "\$!\((.*)\)" "$(\1)">
-<transform dir file link hardlink -> \
-	edit target "\$!\((.*)\)" "$(\1)">
+    edit target "\$!\((.*)\)" "$(\1)">
+
+# Omit "standard" directories and files we never want to ship (such as
+# libtool files).
+<transform dir path=etc$ -> drop>
+<transform dir path=etc/$\(MACH(32|64)\)$ -> drop>
+<transform dir path=usr$ -> drop>
+<transform dir path=usr/bin$ -> drop>
+<transform dir path=usr/bin/\$\(MACH(32|64)\)$ -> drop>
+<transform dir path=usr/include$ -> drop>
+<transform dir path=usr/lib$ -> drop>
+<transform dir path=usr/lib/pkgconfig$ -> drop>
+<transform dir path=usr/lib/\$\(MACH(32|64)\)$ -> drop>
+<transform dir path=usr/lib/\$\(MACH(32|64)\)/pkgconfig$ -> drop>
+<transform dir path=usr/share$ -> drop>
+<transform dir path=usr/share/aclocal$ -> drop>
+<transform dir path=usr/share/locale$ -> drop>
+<transform dir path=usr/share/locale/.*$ -> drop>
+<transform dir path=usr/share/man$ -> drop>
+<transform dir path=usr/share/man/.*$ -> drop>
+<transform dir path=usr/sbin$ -> drop>
+<transform dir path=usr/sbin/\$\(MACH(32|64)\)$ -> drop>
+<transform file path=.*\.la$ -> drop>