15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
authorShawn Walker-Salas <shawn.walker@oracle.com>
Wed, 30 Mar 2016 13:33:31 -0700
changeset 5682 94c0ca64c022
parent 5681 b8fe51f35344
child 5683 05b2186d572e
15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh 22228656 remove redundant declarations and additions from makefiles 22252545 simplify build rules for components from common upstream 22378457 tclConfig.sh compiler settings are too specific 22727315 httping curses gui missing 22750630 procmail ignores userland cflags and may use private strstr function 22758725 wdiff uses diff from PATH instead of /usr/gnu/bin/diff 22926847 cloog Makefile typo when setting ASLR_MODE 22935090 tk config script has wrong linker flags
components/a2ps/Makefile
components/aalib/Makefile
components/acpidump/Makefile
components/acpidump/acpidump.p5m
components/ant/Makefile
components/antlr/Makefile
components/apache2-modules/mod_dtrace/Makefile
components/apache2-modules/mod_dtrace/src/Makefile
components/apache2-modules/mod_fcgid/Makefile
components/apache2-modules/mod_jk/Makefile
components/apache2-modules/mod_perl/Makefile
components/apache2-modules/mod_security2/Makefile
components/apache2-modules/mod_wsgi/Makefile
components/apache2-modules/modules.mk
components/apache24/Makefile
components/apr-1_5/Makefile
components/apr-util-1_5/Makefile
components/asciidoc/Makefile
components/asciidoc/asciidoc.p5m
components/aspell/Makefile
components/aspell/aspell.p5m
components/augeas/Makefile
components/autoconf/Makefile
components/autogen/Makefile
components/automake/automake-1.10/Makefile
components/automake/automake-1.11.2/Makefile
components/automake/automake-1.15/Makefile
components/avahi/Makefile
components/bash/Makefile
components/bash/bash.p5m
components/bash/patches/solaris-009.configure.patch
components/bcc/Makefile
components/beanshell/Makefile
components/berkeleydb/Makefile
components/berkeleydb/berkeleydb.p5m
components/bind/Makefile
components/binutils/Makefile
components/bison/Makefile
components/bison/bison.p5m
components/bzip2/Makefile
components/bzip2/bzip2.p5m
components/cdrtools/Makefile
components/cdrtools/cdrtools.p5m
components/check/Makefile
components/check/check.p5m
components/cloog/Makefile
components/cloog/cloog.p5m
components/cmake/Makefile
components/common/Makefile
components/conflict/Makefile
components/convmv/Makefile
components/coreutils/Makefile
components/cppunit/Makefile
components/cups/Makefile
components/curl/Makefile
components/curl/curl.p5m
components/cvs/Makefile
components/cvs/cvs.p5m
components/cyrus-sasl/Makefile
components/daq/Makefile
components/dejagnu/Makefile
components/dejagnu/dejagnu.p5m
components/desktop/firefox/Makefile
components/desktop/harfbuzz/Makefile
components/desktop/libgtkspell/Makefile
components/desktop/libotr/Makefile
components/desktop/libspectre/Makefile
components/desktop/pidgin-otr/Makefile
components/desktop/pidgin/Makefile
components/desktop/poppler/Makefile
components/desktop/poppler/poppler.p5m
components/desktop/thunderbird/Makefile
components/desktop/xscreensaver/Makefile
components/diffstat/Makefile
components/diffstat/diffstat.p5m
components/diffutils/Makefile
components/diffutils/diffutils.p5m
components/dnsmasq/Makefile
components/dnsmasq/dnsmasq.p5m
components/doxygen/Makefile
components/ejabberd/Makefile
components/elinks/Makefile
components/elinks/elinks.p5m
components/emacs/Makefile
components/enscript/Makefile
components/enscript/enscript.p5m
components/erlang/Makefile
components/fastcgi/Makefile
components/fetchmail/Makefile
components/fetchmail/fetchmail.p5m
components/findutils/Makefile
components/findutils/findutils.p5m
components/flex/Makefile
components/flex/flex.p5m
components/foomatic/db-engine/Makefile
components/foomatic/db/Makefile
components/foomatic/filters/Makefile
components/foomatic/fppd/Makefile
components/fping/Makefile
components/fping/fping.p5m
components/ftp-proxy/Makefile
components/gamin/Makefile
components/gawk/Makefile
components/gcc3/Makefile
components/gcc45/Makefile
components/gcc47/Makefile
components/gcc48/Makefile
components/gcc49/Makefile
components/gcc53/Makefile
components/gd2/Makefile
components/gd2/gd2.p5m
components/gdb/Makefile
components/gdb/gdb.p5m
components/gdbm/Makefile
components/getopt/Makefile
components/gettext/Makefile
components/ggrep/Makefile
components/ggrep/gnu-grep.p5m
components/ghostscript/Makefile
components/git/Makefile
components/gnome/evince/Makefile
components/gnu-gs-fonts-other/Makefile
components/gnu-gs-fonts-std/Makefile
components/gnump/Makefile
components/gnupg/Makefile
components/gnuplot/Makefile
components/gnuplot/gnuplot.p5m
components/gnupth/Makefile
components/gnupth/gnupth.p5m
components/gnutls-3/Makefile
components/gnutls/Makefile
components/gocr/Makefile
components/gocr/gocr.p5m
components/gparted/Makefile
components/gpatch/Makefile
components/gperf/Makefile
components/gpgme/Makefile
components/gpgme/gpgme.p5m
components/graphviz/Makefile
components/graphviz/graphviz.p5m
components/groff/Makefile
components/gtar/Makefile
components/gtar/gtar.p5m
components/guile/Makefile
components/guile/guile.p5m
components/gutenprint/Makefile
components/gzip/Makefile
components/hal-cups-utils/Makefile
components/help2man/Makefile
components/hexedit/Makefile
components/hexedit/hexedit.p5m
components/hplip/Makefile
components/httping/Makefile
components/hwdata/Makefile
components/iftop/Makefile
components/iftop/iftop.p5m
components/ilmbase/Makefile
components/imagemagick/Makefile
components/imagemagick/imagemagick.p5m
components/indent/Makefile
components/indent/indent.p5m
components/iperf/Makefile
components/iperf/iperf.p5m
components/irssi/Makefile
components/isc-dhcp/Makefile
components/isl/Makefile
components/jansson/Makefile
components/jsl/Makefile
components/junit/Makefile
components/krb5/Makefile
components/ksh93/Makefile
components/lcms/Makefile
components/lcms/lcms.p5m
components/lcms2/Makefile
components/less/Makefile
components/lftp/Makefile
components/lftp/lftp.p5m
components/libarchive/Makefile
components/libassuan/Makefile
components/libassuan/libassuan.p5m
components/libconfuse/Makefile
components/libdaemon/Makefile
components/libdnet/Makefile
components/libdnet/libdnet.p5m
components/libedit/Makefile
components/libee/Makefile
components/libestr/Makefile
components/libevent/Makefile
components/libexpat/Makefile
components/libffi/Makefile
components/libgcrypt/Makefile
components/libgcrypt/libgcrypt.p5m
components/libgpg-error/Makefile
components/libgpg-error/libgpg-error.p5m
components/libgsl/Makefile
components/libgsl/libgsl.p5m
components/libidn/Makefile
components/libksba/Makefile
components/libksba/libksba.p5m
components/liblogging/Makefile
components/libmemcached/Makefile
components/libmicrohttpd/Makefile
components/libmng/Makefile
components/libneon/Makefile
components/libneon/libneon.p5m
components/libnet/Makefile
components/libpcap/Makefile
components/librsync/Makefile
components/librsync/librsync.p5m
components/libsdl/Makefile
components/libsigsegv/Makefile
components/libsndfile/Makefile
components/libsndfile/libsndfile.p5m
components/libssh2/Makefile
components/libtasn1/Makefile
components/libtasn1/libtasn1.p5m
components/libtecla/Makefile
components/libtecla/libtecla.p5m
components/libtool/Makefile
components/libtorrent/Makefile
components/libusb/ugen/Makefile
components/libusb/ugen/src/Makefile
components/libusb/wrapper/Makefile
components/libusb/wrapper/src/Makefile
components/libxml2/Makefile
components/libxml2/libxml2.p5m
components/libxslt/Makefile
components/libxslt/libxslt.p5m
components/lighttpd/Makefile
components/links/Makefile
components/links/links.p5m
components/llvm/Makefile
components/llvm/cxa_finalize/Makefile
components/lua/Makefile
components/lua/lua.p5m
components/lynx/Makefile
components/lynx/lynx.p5m
components/m4/Makefile
components/m4/m4.p5m
components/mailman/Makefile
components/make/Makefile
components/mc/Makefile
components/mc/mc.p5m
components/meld/Makefile
components/memcached-java/Makefile
components/memcached/Makefile
components/memcached/memcached.p5m
components/mercurial/Makefile
components/meta-packages/developer-opensolaris-userland/Makefile
components/meta-packages/group-feature/Makefile
components/meta-packages/history/Makefile
components/mlocate/Makefile
components/mlocate/mlocate.p5m
components/mpc/Makefile
components/mpfr/Makefile
components/mrtg/Makefile
components/mtr/Makefile
components/mutt/Makefile
components/mutt/mutt.p5m
components/mysql-5-5/Makefile
components/mysql-5-6/Makefile
components/mysql-common/Makefile
components/nano/Makefile
components/ncftp/Makefile
components/ncurses/Makefile
components/ncurses/ncurses.p5m
components/net-snmp/Makefile
components/nethack/Makefile
components/nettle/Makefile
components/nettle/nettle.p5m
components/nghttp2/Makefile
components/nicstat/Makefile
components/nmap/Makefile
components/nmap/nmap.p5m
components/novnc/Makefile
components/ntp/Makefile
components/ocaml/Makefile
components/open-fabrics/Makefile
components/open-fabrics/ibutils/Makefile
components/open-fabrics/infiniband-diags/Makefile
components/open-fabrics/libibmad/Makefile
components/open-fabrics/libibumad/Makefile
components/open-fabrics/libibverbs/Makefile
components/open-fabrics/libmlx4/Makefile
components/open-fabrics/librdmacm/Makefile
components/open-fabrics/libsdp/Makefile
components/open-fabrics/libsif/Makefile
components/open-fabrics/ofed-component-macros.mk
components/open-fabrics/ofed-component.mk
components/open-fabrics/ofed.mk
components/open-fabrics/open-fabrics.p5m
components/open-fabrics/opensm/Makefile
components/open-fabrics/perftest/Makefile
components/open-fabrics/qperf/Makefile
components/open-fabrics/rds-tools/Makefile
components/openexr/Makefile
components/openexr/openexr.p5m
components/openjade/Makefile
components/openjade/openjade.p5m
components/openldap/Makefile
components/openldap/openldap.p5m
components/openscap/Makefile
components/opensp/Makefile
components/openssh/Makefile
components/openssl/openssl-default/Makefile
components/openssl/openssl-fips-140/Makefile
components/openssl/openssl-fips/Makefile
components/openstack/common/Makefile
components/openusb/Makefile
components/openvswitch/Makefile
components/p7zip/Makefile
components/pam_pkcs11/Makefile
components/pam_pkcs11/pam_pkcs11.p5m
components/pam_pkcs11/patches/pam_pkcs11.patch
components/parallel/Makefile
components/parallel/parallel.p5m
components/patchutils/Makefile
components/pbzip2/Makefile
components/pconsole/Makefile
components/pconsole/patches/Makefile.in.patch
components/pcre/Makefile
components/pcre/pcre.p5m
components/perl/perl516/Makefile
components/perl/perl520/Makefile
components/perl512/Makefile
components/perl_modules/DBI/Makefile
components/perl_modules/authen-pam/Makefile
components/perl_modules/cssh/Makefile
components/perl_modules/gettext/Makefile
components/perl_modules/perl-tk/Makefile
components/perl_modules/perl-x11-protocol/Makefile
components/perl_modules/xml-libxml/Makefile
components/perl_modules/xml-namespacesupport/Makefile
components/perl_modules/xml-parser/Makefile
components/perl_modules/xml-sax-base/Makefile
components/perl_modules/xml-sax/Makefile
components/perl_modules/xml-simple/Makefile
components/php-common/Makefile
components/php/php56/Makefile
components/php/suhosin-extension/Makefile
components/php/xdebug/Makefile
components/pigz/Makefile
components/pinentry/Makefile
components/pixz/Makefile
components/pkg-config/Makefile
components/pkg-config/pkg-config.p5m
components/pkgbuild/Makefile
components/popt/Makefile
components/postfix/Makefile
components/privoxy/Makefile
components/procmail/Makefile
components/procmail/patches/07-use-libc-strstr.patch
components/proftpd/Makefile
components/psutils/Makefile
components/psutils/psutils.p5m
components/ptp/Makefile
components/pv/Makefile
components/pv/pv.p5m
components/pwgen/Makefile
components/pwgen/pwgen.p5m
components/python/anyjson/Makefile
components/python/astroid/Makefile
components/python/beautifulsoup4/Makefile
components/python/cheetah/Makefile
components/python/cherrypy/Makefile
components/python/cmd2/Makefile
components/python/cov-core/Makefile
components/python/d2to1/Makefile
components/python/django-appconf/Makefile
components/python/filechunkio/Makefile
components/python/formencode/Makefile
components/python/httplib2/Makefile
components/python/iso8601/Makefile
components/python/jsonpatch/Makefile
components/python/jsonpointer/Makefile
components/python/jsonschema/Makefile
components/python/ldtp/Makefile
components/python/lesscpy/Makefile
components/python/librabbitmq/Makefile
components/python/lockfile/Makefile
components/python/markdown/Makefile
components/python/markupsafe/Makefile
components/python/mock/Makefile
components/python/nose-cover3/Makefile
components/python/passlib/Makefile
components/python/paste.deploy/Makefile
components/python/paste/Makefile
components/python/ply/Makefile
components/python/prettytable/Makefile
components/python/pyasn1-modules/Makefile
components/python/pyasn1/Makefile
components/python/pycountry/Makefile
components/python/pydns/Makefile
components/python/pygments/Makefile
components/python/pylint/Makefile
components/python/pyparsing/Makefile
components/python/pyrabbit/Makefile
components/python/pytest-capturelog/Makefile
components/python/pytest-codecheckers/Makefile
components/python/pytest-cov/Makefile
components/python/python-ldap/Makefile
components/python/python27/Makefile
components/python/python34/Makefile
components/python/python35/Makefile
components/python/repoze.lru/Makefile
components/python/routes/Makefile
components/python/setuptools-git/Makefile
components/python/setuptools/Makefile
components/python/sqlalchemy-migrate/Makefile
components/python/suds/Makefile
components/python/tempita/Makefile
components/python/waitress/Makefile
components/python/warlock/Makefile
components/python/webob/Makefile
components/python/webtest/Makefile
components/quagga/Makefile
components/quilt/Makefile
components/quilt/quilt.p5m
components/r/Makefile
components/r/r.p5m
components/rabbitmq/Makefile
components/rdiff-backup/Makefile
components/re2c/Makefile
components/re2c/re2c.p5m
components/readline/Makefile
components/rpm2cpio/Makefile
components/rrdtool/Makefile
components/rrdtool/rrdtool.p5m
components/rsync/Makefile
components/rsyslog/Makefile
components/rtorrent/Makefile
components/rtorrent/rtorrent.p5m
components/ruby/facter/Makefile
components/ruby/hiera/Makefile
components/ruby/mcollective/Makefile
components/ruby/puppet-modules/oracle-solaris_providers/Makefile
components/ruby/puppet-solaris/Makefile
components/ruby/puppet/Makefile
components/ruby/ruby-21/Makefile
components/ruby/ruby-common/Makefile
components/ruby/stomp/Makefile
components/samba/Makefile
components/sane-backends/Makefile
components/sane-backends/patches/backends.patch
components/sane-backends/sane-backends.p5m
components/sane-frontends/Makefile
components/sane-frontends/sane-frontends.p5m
components/scons/Makefile
components/screen/Makefile
components/sed/Makefile
components/sed/sed.p5m
components/sendmail/Makefile
components/sendmail/files/aux/Makefile
components/serf/Makefile
components/sg3_utils/Makefile
components/smp_utils/Makefile
components/smp_utils/smp_utils.p5m
components/snort/Makefile
components/sox/Makefile
components/sox/sox.p5m
components/spawn-fcgi/Makefile
components/spawn-fcgi/spawn-fcgi.p5m
components/sqlite-3/Makefile
components/sqlite-3/sqlite-3.p5m
components/squid/Makefile
components/stdcxx/Makefile
components/stunnel/Makefile
components/stunnel/stunnel.p5m
components/subversion/Makefile
components/subversion/subversion.p5m
components/sudo/Makefile
components/swig/Makefile
components/swig/swig.p5m
components/tcl/expect/Makefile
components/tcl/expect/expect.p5m
components/tcl/tcl/Makefile
components/tcl/tcl/files/tclsed
components/tcl/tcl/files/tclsed.32
components/tcl/tcl/files/tclsed.64
components/tcl/tcl/tcl.p5m
components/tcl/tk/Makefile
components/tcl/tk/files/tksed
components/tcl/tk/files/tksed.32
components/tcl/tk/files/tksed.64
components/tcl/tk/tk.p5m
components/tcpdump/Makefile
components/tcpdump/tcpdump.p5m
components/tcsh/Makefile
components/texinfo/Makefile
components/texinfo/texinfo.p5m
components/text-utilities/Makefile
components/tidy/Makefile
components/tidy/tidy.p5m
components/timezone/Makefile
components/tmux/Makefile
components/tmux/tmux.p5m
components/tomcat-8/Makefile
components/top/Makefile
components/top/top.p5m
components/tree/Makefile
components/trousers/Makefile
components/unixodbc/Makefile
components/unrar/Makefile
components/unzip/Makefile
components/vim/Makefile
components/w3m/Makefile
components/watch/Makefile
components/wdiff/Makefile
components/wdiff/wdiff.p5m
components/webalizer/Makefile
components/webalizer/webalizer.p5m
components/wget/Makefile
components/which/Makefile
components/wireshark/Makefile
components/wxwidgets/Makefile
components/xmlto/Makefile
components/xmlto/xmlto.p5m
components/xorriso/Makefile
components/xz/Makefile
components/yasm/Makefile
components/yasm/yasm.p5m
components/zip/Makefile
components/zlib/Makefile
components/zsh/Makefile
doc/makefile-variables.txt
exception_lists/cddlchk
exception_lists/cdm
make-rules/ant.mk
make-rules/attpackagemake.mk
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/common.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/environment.mk
make-rules/gem.mk
make-rules/gnu-component.mk
make-rules/install.rb.mk
make-rules/intltool.mk
make-rules/ips-buildinfo.mk
make-rules/justmake.mk
make-rules/lint-libraries.mk
make-rules/makemaker.mk
make-rules/prep-download.mk
make-rules/prep-git.mk
make-rules/prep-hg.mk
make-rules/prep-patch.mk
make-rules/prep-svn.mk
make-rules/prep-unpack.mk
make-rules/puppetmodule.mk
make-rules/shared-macros.mk
make-rules/shared-targets.mk
make-rules/skip-test.mk
tools/Makefile
tools/bass-o-matic
tools/build-watch.pl
tools/cloney
tools/gen-components
tools/pkglint.sh
tools/pkglintrc
tools/python/pkglint/__init__.py
tools/sunw-history-package
tools/userland-fetch
tools/userland-incorporator
tools/userland-mangler
tools/userland-unpack
transforms/autopyc
transforms/comparison-cleanup
transforms/copyright-template
transforms/generate-cleanup
transforms/license-changes
transforms/print-paths
transforms/print-pkgs
transforms/publish-cleanup
transforms/variant-cleanup
--- a/components/a2ps/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/a2ps/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,34 +22,26 @@
 #
 # Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		a2ps
 COMPONENT_VERSION=	4.14
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/a2ps/
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:f3ae8d3d4564a41b6e2a21f237d2f2b104f48108591e8b83497500182a3ab3a4
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/a2ps/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/a2ps
 
 TPNO=			4517
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # don't use LD_Z_IGNORE: causes linker problems
 LD_Z_IGNORE=
 
 CONFIGURE_OPTIONS  +=		--enable-shared
 CONFIGURE_OPTIONS  +=		--disable-static
-CONFIGURE_OPTIONS  +=		--sysconfdir=/etc/gnu
+CONFIGURE_OPTIONS  +=		--sysconfdir=$(ETCDIR)/gnu
 CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS  +=		--with-medium=letter
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
 
 # because viewpathing isn't quite right in this version of a2ps
 COMPONENT_PREP_ACTION = \
@@ -63,24 +55,8 @@
 	     ln -s $$sheet ; \
 	 done)
 
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
-
-# common targets
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
-test:		$(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += developer/gperf
 REQUIRED_PACKAGES += editor/gnu-emacs
 REQUIRED_PACKAGES += runtime/perl-522
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/aalib/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/aalib/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -23,13 +23,15 @@
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
+# Prefer 32-bit over 64-bit as we have to manually shuffle the resulting
+# binaries around anyway in the package manifest.
+BUILD_BITS= 32_and_64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		aalib
 COMPONENT_VERSION=	1.4.0
 HUMAN_VERSION=		1.4rc5
 IPS_COMPONENT_VERSION =	1.4.5
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=	http://aa-project.sourceforge.net/aalib/
 COMPONENT_ARCHIVE=	$(COMPONENT_NAME)-$(HUMAN_VERSION).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
@@ -39,15 +41,11 @@
 
 TPNO=			6118
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-include $(WS_MAKE_RULES)/lint-libraries.mk
+SYSTEM_TEST_TARGET= $(SYSTEM_TEST_32_and_64)
+include $(WS_MAKE_RULES)/common.mk
 
 LINT_FLAGS += -I$(SOURCE_DIR)/src
 
-PKG_PROTO_DIRS +=	$(COMPONENT_SRC)
-
 # Ensure ancient autoconf scripts are overwritten with fixed versions that
 # properly detect SunOS 5.x hosts.
 COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv)
@@ -60,8 +58,6 @@
 CONFIGURE_OPTIONS	+= --x-includes=$(USRINCDIR)
 CONFIGURE_OPTIONS	+= --x-libraries=$(CONFIGURE_LIBDIR.$(BITS))
 
-CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
-
 COMPONENT_TEST_DIR =	$(@D)/src
 COMPONENT_TEST_CMD =	perl -E 'say "\n" x 40' | ./aatest
 COMPONENT_TEST_ARGS =	-kbddriver stdin -driver stdout
@@ -76,21 +72,7 @@
 # here, rather than create multiple identical master files.
 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(TEST_32_and_64)
-system-test:	$(SYSTEM_TEST_32_and_64)
-
-
 REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
 REQUIRED_PACKAGES += x11/library/libx11
--- a/components/acpidump/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/acpidump/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,9 +22,9 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-COMPILER =	gcc
-
+COMPILER= gcc
+BUILD_ARCH= i386
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		acpidump
@@ -32,47 +32,15 @@
 IPS_COMPONENT_VERSION=	0.2007.11.16
 COMPONENT_PROJECT_URL=	http://www.lesswatts.org/projects/acpi/utilities.php
 COMPONENT_SRC_NAME=	pmtools
-COMPONENT_SRC=		$(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:91751774976e39f6237efd0326eb35196a9346220b92ad35894a33283e872748
 COMPONENT_ARCHIVE_URL=	http://www.lesswatts.org/patches/linux_acpi/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/acpidump
 
 TPNO=			8848
 
-# we're i386-only
-ifeq ($(MACH), sparc)
-PUBLISH_STAMP= 
-endif
-
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-PKG_PROTO_DIRS += $(BUILD_DIR_64)
-
-CC +=	$(CC_BITS)
-
-COMPONENT_BUILD_ENV +=	CC="$(CC)"
-
-# common targets. we're i386-only so we have to
-# be slightly tricky.
+BUILD_STYLE= justmake
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
-build_sparc:
-	@echo "Not available."
-
-ASLR_MODE =	$(ASLR_ENABLE)
-
-build_i386:	$(BUILD_64)
-
-build:		build_$(MACH)
-
-install:	build
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
+COMPONENT_PRE_INSTALL_ACTION += $(MKDIR) $(PROTOUSRBINDIR)
+COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTOUSRBINDIR)
--- a/components/acpidump/acpidump.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/acpidump/acpidump.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -18,11 +18,8 @@
 #
 # CDDL HEADER END
 #
-
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
-#
-
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommited>
 set name=pkg.fmri \
     value=pkg:/diagnostic/acpidump@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -36,9 +33,9 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2009/458
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file acpidump/acpidump path=usr/bin/acpidump
-file acpixtract/acpixtract path=usr/bin/acpixtract
-file madt/madt path=usr/bin/madt
+file path=usr/bin/acpidump
+file path=usr/bin/acpixtract
+file path=usr/bin/madt
 file acpidump.1 path=usr/share/man/man1/acpidump.1
 file acpixtract.1 path=usr/share/man/man1/acpixtract.1
 file madt.1 path=usr/share/man/man1/madt.1
--- a/components/ant/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/ant/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,40 +22,37 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= NO_ARCH
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		ant
 COMPONENT_VERSION=	1.9.6
 COMPONENT_PROJECT_URL=	http://ant.apache.org/
 COMPONENT_SRC_NAME=	apache-ant
-COMPONENT_SRC=		$(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC)-src.tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:2ad98dd3a4805452e546e0f5b682360370ae11692a2157fff8ec6d177c957123
 COMPONENT_ARCHIVE_URL=	http://archive.apache.org/dist/ant/source/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/ant
 
 TPNO=			25967
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
+include $(WS_MAKE_RULES)/common.mk
 
 GMAKE=./build.sh
 
 ANT_ENV+=JAVA_HOME=$(JAVA_HOME)
 
 ANT_DIST_DIRS+=-Ddist.dir=$(PROTO_DIR)
-ANT_DIST_DIRS+=-Ddist.bin=$(PROTO_DIR)/usr/bin
-ANT_DIST_DIRS+=-Ddist.etc=$(PROTO_DIR)/usr/share/lib/ant
-ANT_DIST_DIRS+=-Ddist.docs=$(PROTO_DIR)/usr/share/doc/ant
-ANT_DIST_DIRS+=-Ddist.manual=$(PROTO_DIR)/usr/share/doc/ant/manual
-ANT_DIST_DIRS+=-Ddist.javadocs=$(PROTO_DIR)/usr/share/doc/ant/manual/api
-ANT_DIST_DIRS+=-Ddist.lib=$(PROTO_DIR)/usr/share/lib/ant
+ANT_DIST_DIRS+=-Ddist.bin=$(PROTOUSRBINDIR)
+ANT_DIST_DIRS+=-Ddist.etc=$(PROTOUSRSHARELIBDIR)/ant
+ANT_DIST_DIRS+=-Ddist.docs=$(PROTOUSRSHAREDOCDIR)/ant
+ANT_DIST_DIRS+=-Ddist.manual=$(PROTOUSRSHAREDOCDIR)/ant/manual
+ANT_DIST_DIRS+=-Ddist.javadocs=$(PROTOUSRSHAREDOCDIR)/ant/manual/api
+ANT_DIST_DIRS+=-Ddist.lib=$(PROTOUSRSHARELIBDIR)/ant
 
-OPTIONAL_LIBS+=/usr/share/lib/java/junit.jar
-OPTIONAL_LIBS+=/usr/share/antlr-2.7.7/antlr.jar
+OPTIONAL_LIBS+=$(USRSHARELIBDIR)/java/junit.jar
+OPTIONAL_LIBS+=$(USRSHAREDIR)/antlr-2.7.7/antlr.jar
 
 COMPONENT_PRE_BUILD_ACTION = $(CP) $(OPTIONAL_LIBS) $(@D)/lib/optional
 
@@ -80,17 +77,6 @@
 	'-e "/^Buildfile: /d" ' \
 	'-e "/^Total time: /d" '
 
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-build:	$(BUILD_32)
-
-install: $(INSTALL_32)
-
-test:  $(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += developer/java/junit
 REQUIRED_PACKAGES += developer/parser/antlr-2
 REQUIRED_PACKAGES += runtime/perl-522
--- a/components/antlr/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/antlr/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,16 +20,14 @@
 #
 
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		antlr
 COMPONENT_VERSION=	2.7.7
 COMPONENT_PROJECT_URL=	http://www.antlr.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:853aeb021aef7586bda29e74a6b03006bcb565a755c86b66032d8ec31b67dbb9
 COMPONENT_ARCHIVE_URL=	http://www.antlr2.org/download/$(COMPONENT_ARCHIVE)
@@ -38,11 +36,9 @@
 TPNO=			5546
 
 # Use version of Java defined in ../../make-rules/shared-macros.mk
-PATH=$(SPRO_VROOT)/bin:$(JAVA_HOME)/bin:/usr/bin
+PATH=$(SPRO_VROOT)/bin:$(JAVA_HOME)/bin:$(USRBINDIR)
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL =		0
 
@@ -65,24 +61,9 @@
 	'-e "/^ANTLR Parser Generator.*$$/d"' \
 	'-e "/^XXX_JAVA_XXX$$/d" '
 
-# Needed to find the antlr man page.
-PKG_PROTO_DIRS +=	$(COMPONENT_DIR)/files
-
 COMPONENT_TEST_TARGETS = test
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-# common targets
-configure:	$(CONFIGURE_32)
-
-build:          $(BUILD_32)
-
-install:        $(INSTALL_32)
-
-test:           $(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += runtime/python-27
 REQUIRED_PACKAGES += shell/ksh93
--- a/components/apache2-modules/mod_dtrace/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_dtrace/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,37 +18,27 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mod_dtrace
 COMPONENT_VERSION=	0.3.1
 COMPONENT_SRC=		src
+COMPONENT_ARCHIVE=
 COMPONENT_PROJECT_URL=	http://prefetch.net/projects/apache_modtrace/
-COMPONENT_BUGDB=	utility/apache
 
 TPNO=			8876
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
+MODULES_INSTALL=
 include ../modules.mk
 
 COMPONENT_BUILD_ARGS +=	APXS=$(APXS)
-COMPONENT_BUILD_ARGS +=	DTRACE="/usr/sbin/dtrace -$(BITS)"
+COMPONENT_BUILD_ARGS +=	DTRACE="$(USRSBINDIR)/dtrace -$(BITS)"
 COMPONENT_BUILD_ARGS +=	PATH="$(PATH)"
 
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-clean::
-	$(RM) $(SOURCE_DIR)/.prep
-
-build: $(MODULES_BUILD)
-
-test: $(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
+CLEAN_PATHS += $(SOURCE_DIR)/.prep
--- a/components/apache2-modules/mod_dtrace/src/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_dtrace/src/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,6 +18,8 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 #
 
--- a/components/apache2-modules/mod_fcgid/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_fcgid/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,40 +18,25 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mod_fcgid
 COMPONENT_VERSION=	2.3.9
 COMPONENT_PROJECT_URL=	http://httpd.apache.org/mod_fcgid/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:1cbad345e3376b5d7c8f9a62b471edd7fa892695b90b79502f326b4692a679cf
 COMPONENT_ARCHIVE_URL=	http://archive.apache.org/dist/httpd/mod_fcgid/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/apache
 
 TPNO=			8878
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
 include ../modules.mk
 
 PATCH_LEVEL=0
 
 COMPONENT_PRE_BUILD_ACTION= ( cd $(@D); APXS=$(APXS) ./configure.apxs )
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-build: $(MODULES_BUILD)
-
-install: $(MODULES_INSTALL)
-
-test: $(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
--- a/components/apache2-modules/mod_jk/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_jk/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,8 +18,11 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mod_jk
@@ -27,37 +30,16 @@
 COMPONENT_PROJECT_URL=	http://tomcat.apache.org/connectors-doc/
 COMPONENT_SRC_NAME=	tomcat-connectors
 COMPONENT_SRC=		$(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)-src
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:f193b02aeec71daab13fc5bbb99f13eca9d916b79a024f8035a65f39559bc7fd
 COMPONENT_ARCHIVE_URL=	http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/apache
 
 TPNO=			24206
 
 CONFIGURE_DEFAULT_DIRS=no
-DEFAULT_COMPILER=no
-
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+MODULES_INSTALL=
 include ../modules.mk
 
 PATCH_LEVEL=0
 
 CONFIGURE_SCRIPT = $(SOURCE_DIR)/native/configure
-
-CONFIGURE_OPTIONS += --with-apxs=$(APXS)
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-configure:	$(MODULES_CONFIGURE)
-
-build: $(MODULES_BUILD)
-
-test: $(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
--- a/components/apache2-modules/mod_perl/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_perl/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,16 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mod_perl
 COMPONENT_VERSION=	2.0.9
 COMPONENT_PROJECT_URL=	http://perl.apache.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:0260f26ab771c1c95fadc67544b3400e420bb30b8a77565d2d02ad05498ef52b
 COMPONENT_ARCHIVE_URL=	http://www.apache.org/dist/perl/$(COMPONENT_ARCHIVE)
@@ -34,11 +35,10 @@
 
 TPNO=			23900
 
-CONFIGURE_DEFAULT_DIRS=no
-
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
+CONFIGURE_DEFAULT_DIRS= no
+SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL=0
 
@@ -67,9 +67,10 @@
 COMPONENT_TEST_TARGETS=	test
 COMPONENT_SYSTEM_TEST_TARGETS=	system_test
 
-PATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:/usr/bin
+PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR)
+else
+PATH=$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
 endif
 
 COMPONENT_TEST_TRANSFORMS += \
@@ -91,17 +92,8 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-build: $(BUILD_64)
-
-install: $(INSTALL_64)
-
-test: $(TEST_64)
-
-system-test:    $(BUILD_64) $(SYSTEM_TEST_64)
-
 REQUIRED_PACKAGES += library/apr-15
 REQUIRED_PACKAGES += library/apr-util-15
 REQUIRED_PACKAGES += runtime/perl-520
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
 REQUIRED_PACKAGES += web/server/apache-24
--- a/components/apache2-modules/mod_security2/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_security2/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,8 +18,11 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mod_security2
@@ -27,46 +30,28 @@
 COMPONENT_PROJECT_URL=	http://www.modsecurity.org/
 COMPONENT_SRC_NAME=	modsecurity-apache
 COMPONENT_SRC=		$(COMPONENT_SRC_NAME)_$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:95de6ec30982e5bde7981929ba89be89488e9f237ee8c4236e064b074bbb6f28
 COMPONENT_ARCHIVE_URL= \
     $(COMPONENT_PROJECT_URL)tarball/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/apache
 
 TPNO=			18233
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+MODULES_INSTALL=
 include ../modules.mk
 
 COMPONENT_POST_UNPACK_ACTION += \
   (cd $(SOURCE_DIR); \
   $(CP) modsecurity.conf-recommended modsecurity-24.conf-recommended)
 
-CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS += LTFLAGS="--silent --tag=CC"
-CONFIGURE_OPTIONS += --with-apxs=$(APXS)
 CONFIGURE_OPTIONS += --with-apr=`$(APXS) -q APR_CONFIG`
 CONFIGURE_OPTIONS += --with-apu=`$(APXS) -q APU_CONFIG`
 
 COMPONENT_TEST_ARGS += CFLAGS="$(CFLAGS) -DMSC_TEST"
 
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-configure:	$(MODULES_CONFIGURE)
-
-build: $(MODULES_BUILD)
-
-test: $(MODULES_TEST)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += library/apr-15
 REQUIRED_PACKAGES += library/apr-util-15
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += library/pcre
 REQUIRED_PACKAGES += runtime/lua
-REQUIRED_PACKAGES += system/library
--- a/components/apache2-modules/mod_wsgi/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/mod_wsgi/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,37 +20,30 @@
 #
 
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		mod_wsgi
 COMPONENT_VERSION=	4.3.0
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	sha256:89dfcc8564bb8781f36370c80c6fbeef9ec0723dec273231f4f760760d8e813d
 COMPONENT_ARCHIVE_URL=	https://pypi.python.org/packages/source/m/mod_wsgi/$(COMPONENT_ARCHIVE)
 COMPONENT_PROJECT_URL=  http://code.google.com/p/modwsgi/
-COMPONENT_BUGDB=	utility/apache
 
 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
+VARIANTS_64 = $(BUILD_DIR)/apache24-python27 $(BUILD_DIR)/apache24-python34
 include ../modules.mk
 
-APACHE_USR_PREFIX = /usr/apache2/
+# Fix 64-bit linking via compiler.
+LDFLAGS += $(CC_BITS)
 
-VARIANT_AP_24_PY27 = $(BUILD_DIR)/apache24-python27
-VARIANT_AP_24_PY34 = $(BUILD_DIR)/apache24-python34
-
-VARIANTS_64 = $(VARIANT_AP_24_PY27) $(VARIANT_AP_24_PY34)
-
-$(BUILD_DIR)/apache24-%/$(MACH64)/.configured: APXS=$(APACHE_USR_PREFIX)/2.4/bin/apxs
+$(BUILD_DIR)/apache24-%/$(MACH64)/.configured: APXS=$(APACHE_24_USR_PREFIX)/bin/apxs BITS=64
+$(BUILD_DIR)/apache24-%/$(MACH64)/.built: BITS=64
+$(BUILD_DIR)/apache24-%/$(MACH64)/.tested: BITS=64
 
 $(BUILD_DIR)/apache2%-python27/$(MACH64)/.configured: PYTHON=$(PYTHON.2.7.64)
 $(BUILD_DIR)/apache2%-python34/$(MACH64)/.configured: PYTHON=$(PYTHON.3.4.64)
@@ -59,20 +52,7 @@
 	($(CLONEY) $(SOURCE_DIR) $(@D))
 
 CONFIGURE_OPTIONS += --with-python=$(PYTHON)
-CONFIGURE_OPTIONS += --with-apxs=$(APXS)
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-# common targets
-configure:	$(MODULES_CONFIGURE)
-
-build:		$(MODULES_BUILD)
-
-install:	$(MODULES_INSTALL)
-
-system-test:	$(NO_TESTS)
 
 REQUIRED_PACKAGES += runtime/python-27
 REQUIRED_PACKAGES += runtime/python-34
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/apache2-modules/modules.mk	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache2-modules/modules.mk	Wed Mar 30 13:33:31 2016 -0700
@@ -20,17 +20,22 @@
 #
 # Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 #
+COMPONENT_BUGDB ?=	utility/apache
 
-MODULES_CONFIGURE = $(CONFIGURE_64)
-MODULES_BUILD = $(BUILD_64)
-MODULES_INSTALL = $(INSTALL_64)
-MODULES_TEST = $(TEST_64)
+COMMON_TARGETS=no
+include $(WS_MAKE_RULES)/common.mk
+
+MODULES_CONFIGURE ?= $(CONFIGURE_64)
+MODULES_BUILD ?= $(BUILD_64)
+MODULES_INSTALL ?= $(INSTALL_64)
+MODULES_TEST ?= $(NO_TESTS)
+MODULES_SYSTEM_TEST ?= $(NO_TESTS)
 
 APACHE_24_USR_PREFIX=/usr/apache2/2.4
 
 VARIANT_APACHE_24 =	$(BUILD_DIR)/apache24
 
-VARIANTS_64 = $(VARIANT_APACHE_22) $(VARIANT_APACHE_24)
+VARIANTS_64 ?= $(VARIANT_APACHE_24)
 
 BUILD_64 = $(VARIANTS_64:%=%/$(MACH64)/.built)
 
@@ -54,16 +59,44 @@
 
 $(BUILD_DIR)/apache24/$(MACH64)/.built: APXS=$(APACHE_USR_PREFIX)/bin/apxs
 
-DEFAULT_COMPILER?=yes
+ASLR_MODE= $(ASLR_NOT_APPLICABLE)
+
+DEFAULT_COMPILER ?= yes
+
+ifeq ($(strip $(BUILD_STYLE)),configure)
+CONFIGURE_OPTIONS += --with-apxs=$(APXS)
+endif
+
+# Attempt to define shared module targets.
+ifeq ($(strip $(MODULES_CONFIGURE)),configure)
+configure:	$(MODULES_CONFIGURE)
+endif
+
+ifneq ($(strip $(MODULES_BUILD)),)
+build:          $(MODULES_BUILD)
+endif
+
+ifneq ($(strip $(MODULES_INSTALL)),)
+install:        $(MODULES_INSTALL)
+endif
+
+ifneq ($(strip $(MODULES_TEST)),)
+test:           $(MODULES_TEST)
+endif
+
+ifneq ($(strip $(MODULES_SYSTEM_TEST)),)
+system-test:    $(MODULES_SYSTEM_TEST)
+endif
 
 ifeq   ($(strip $(DEFAULT_COMPILER)),no)
 CC=
 CXX=
 endif
 
-PATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:/usr/bin
+PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR)
+else
+PATH=$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
 endif
 
 REQUIRED_PACKAGES += web/server/apache-24
--- a/components/apache24/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apache24/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,16 +18,17 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		apache2
 COMPONENT_VERSION=	2.4.16
 COMPONENT_PROJECT_URL=	http://httpd.apache.org/
 COMPONENT_SRC_NAME=	httpd
-COMPONENT_SRC=		$(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:2fc18017801944cfcfde76a24f16c1276c866c2a6e512ee895f566bef9368fae
 COMPONENT_ARCHIVE_URL=	http://archive.apache.org/dist/httpd/$(COMPONENT_ARCHIVE)
@@ -36,12 +37,8 @@
 TPNO=	23618
 	
 CONFIGURE_DEFAULT_DIRS=no
-
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-ASLR_MODE = $(ASLR_ENABLE)
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL=0
 
@@ -53,7 +50,7 @@
 COMPONENT_PREP_ACTION +=($(CP) mod_auth_gss/mod_auth_gss.html $(@D)/docs/manual/mod);
 COMPONENT_PREP_ACTION +=(cd $(@D); autoreconf);
 
-CONFIGURE_PREFIX =	/usr/apache2/2.4
+CONFIGURE_PREFIX =	$(USRDIR)/apache2/2.4
 
 CONFIGURE_OPTIONS +=	--enable-layout=Solaris
 CONFIGURE_OPTIONS +=	--enable-mpms-shared=all
@@ -62,28 +59,19 @@
 CONFIGURE_OPTIONS +=	--enable-cgi
 CONFIGURE_OPTIONS +=	--enable-suexec
 CONFIGURE_OPTIONS +=	--with-suexec-caller=webservd
-CONFIGURE_OPTIONS +=	--with-apr=/usr/apr/1.5/bin/$(MACH64)/apr-1-config
-CONFIGURE_OPTIONS +=	--with-apr-util=/usr/apr-util/1.5/bin/$(MACH64)/apu-1-config
+CONFIGURE_OPTIONS +=	--with-apr=$(USRDIR)/apr/1.5/bin/$(MACH64)/apr-1-config
+CONFIGURE_OPTIONS +=	--with-apr-util=$(USRDIR)/apr-util/1.5/bin/$(MACH64)/apu-1-config
 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS +=	LTFLAGS="--silent --tag=CC"
 
-PATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
+PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
+else
+PATH=$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
 endif
 
 COMPONENT_POST_INSTALL_ACTION += ($(KSH93) Solaris/customization.sh $(PROTO_DIR))
 
-configure:	$(CONFIGURE_64)
-
-build: $(BUILD_64)
-
-install: $(INSTALL_64)
-
-test: $(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
 REQUIRED_PACKAGES += library/apr-15
 REQUIRED_PACKAGES += library/apr-util-15
 REQUIRED_PACKAGES += library/apr-util-15/apr-ldap
@@ -99,7 +87,6 @@
 REQUIRED_PACKAGES += runtime/perl-522
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
 REQUIRED_PACKAGES += system/library/security/gss
 REQUIRED_PACKAGES += system/network
--- a/components/apr-1_5/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apr-1_5/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,18 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+
+# Prefer 32-bit over 64-bit as apr has its own custom package layout.
+BUILD_BITS= 32_and_64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		apr
 COMPONENT_VERSION=	1.5.1
 COMPONENT_PROJECT_URL=	http://apr.apache.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:94b1c9d9835cc9e902838b95d62ecc9a39b698f23e3e706812ec65a78ba41af7
 COMPONENT_ARCHIVE_URL=	http://archive.apache.org/dist/apr/$(COMPONENT_ARCHIVE)
@@ -35,10 +38,7 @@
 TPNO=			20711
 
 CONFIGURE_DEFAULT_DIRS=no
-
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 # Micro version for easy libraries packaging
 MICRO_VERSION:= $(shell echo $(COMPONENT_VERSION) | awk -F. '{ print $$3 }')
@@ -46,17 +46,13 @@
 
 PATCH_LEVEL=0
 
-# CC will be used via libtool for linking (thus need to be bitness aware).
-CC+=$(CC_BITS)
-
-CONFIGURE_PREFIX=/usr/apr/1.5
+CONFIGURE_PREFIX=$(USRDIR)/apr/1.5
 
 CONFIGURE_OPTIONS +=	--enable-threads
 CONFIGURE_OPTIONS +=	--enable-other-child
 CONFIGURE_OPTIONS +=	--enable-nonportable-atomics
 CONFIGURE_OPTIONS +=	--enable-shared
 CONFIGURE_OPTIONS +=	--disable-static
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS +=	LTFLAGS="--tag=CC --silent"
 CONFIGURE_OPTIONS.32 +=	--enable-layout=Solaris
 CONFIGURE_OPTIONS.64 +=	--enable-layout=Solaris-$(MACH64)
@@ -64,7 +60,7 @@
 COMPONENT_TEST_TARGETS=	test
 
 # Some patches need configure script recreation.
-COMPONENT_PREP_ACTION += (cd $(@D); autoconf);
+COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fi);
 
 # 32 and 64 bits apr.h headers need to be merged to the final one.
 APRH=include/apr.h
@@ -79,19 +75,7 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build: $(BUILD_32_and_64)
-
-install: $(INSTALL_32_and_64)
-
-test: $(TEST_32_and_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += database/mysql-55
 REQUIRED_PACKAGES += developer/documentation-tool/doxygen
 REQUIRED_PACKAGES += shell/bash
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
--- a/components/apr-util-1_5/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/apr-util-1_5/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,18 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+
+# Prefer 32-bit over 64-bit as apr-util has its own custom package layout.
+BUILD_BITS= 32_and_64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		apr-util
 COMPONENT_VERSION=	1.5.4
 COMPONENT_PROJECT_URL=	http://apr.apache.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:976a12a59bc286d634a21d7be0841cc74289ea9077aa1af46be19d1a6e844c19
 COMPONENT_ARCHIVE_URL=	http://archive.apache.org/dist/apr/$(COMPONENT_ARCHIVE)
@@ -35,10 +38,7 @@
 TPNO=			20776
 
 CONFIGURE_DEFAULT_DIRS=no
-
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 # Micro version for easy libraries packaging
 MICRO_VERSION:= $(shell echo $(COMPONENT_VERSION) | awk -F. '{ print $$3 }')
@@ -46,24 +46,24 @@
 
 PATCH_LEVEL=0
 
-CONFIGURE_PREFIX=/usr/apr-util/1.5
+CONFIGURE_PREFIX=$(USRDIR)/apr-util/1.5
 
-CONFIGURE_OPTIONS +=	--with-mysql=/usr/mysql/5.5
-CONFIGURE_OPTIONS +=	--with-expat=/usr
-CONFIGURE_OPTIONS +=	--with-sqlite3=/usr
+CONFIGURE_OPTIONS +=	--with-mysql=$(USRDIR)/mysql/5.5
+CONFIGURE_OPTIONS +=	--with-expat=$(USRDIR)
+CONFIGURE_OPTIONS +=	--with-sqlite3=$(USRDIR)
 CONFIGURE_OPTIONS +=	--with-ldap=ldap_r-2.4
-CONFIGURE_OPTIONS +=	--with-ldap-include=/usr/include/openldap
+CONFIGURE_OPTIONS +=	--with-ldap-include=$(USRINCDIR)/openldap
 CONFIGURE_OPTIONS +=	--without-odbc
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS.32 +=	--enable-layout=Solaris
 CONFIGURE_OPTIONS.64 +=	--enable-layout=Solaris-$(MACH64)
-CONFIGURE_OPTIONS.32 +=	--with-apr=/usr/apr/1.5/bin/apr-1-config
-CONFIGURE_OPTIONS.64 +=	--with-apr=/usr/apr/1.5/bin/$(MACH64)/apr-1-config
-CONFIGURE_OPTIONS.32 +=	MYSQL_CONFIG=/usr/mysql/5.5/bin/$(MACH32)/mysql_config
+CONFIGURE_OPTIONS.32 +=	--with-apr=$(USRDIR)/apr/1.5/bin/apr-1-config
+CONFIGURE_OPTIONS.64 +=	--with-apr=$(USRDIR)/apr/1.5/bin/$(MACH64)/apr-1-config
+CONFIGURE_OPTIONS.32 +=	MYSQL_CONFIG=$(USRDIR)/mysql/5.5/bin/$(MACH32)/mysql_config
 
-PATH=$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
+PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
+else
+PATH=$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
 endif
 
 COMPONENT_TEST_TARGETS= test
@@ -74,21 +74,10 @@
           docs/doxygen.conf | doxygen - ;
 
 # Some patches need configure script recreation.
-COMPONENT_PREP_ACTION += (cd $(@D); autoconf);
+COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fi);
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build: $(BUILD_32_and_64)
-
-install: $(INSTALL_32_and_64)
-
-test: $(TEST_32_and_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += database/mysql-55
 REQUIRED_PACKAGES += database/mysql-55/library
 REQUIRED_PACKAGES += database/sqlite-3
@@ -97,5 +86,4 @@
 REQUIRED_PACKAGES += library/expat
 REQUIRED_PACKAGES += library/openldap
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/asciidoc/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/asciidoc/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,56 +20,44 @@
 #
 
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		asciidoc
 COMPONENT_VERSION=	8.6.8
 COMPONENT_PROJECT_URL=	http://www.methods.co.nz/asciidoc/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:ffb67f59dccaf6f15db72fcd04fdf21a2f9b703d31f94fcd0c49a424a9fcfbc4
 COMPONENT_ARCHIVE_URL=	 http://downloads.sourceforge.net/project/$(COMPONENT_NAME)/$(COMPONENT_NAME)/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/asciidoc
 
 TPNO=			14505
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL = 0
 
 # AsciiDoc configuration and data files belong in /usr/share, not /etc based
 # on discussion from ARC pre-review.
 #
-CONFIGURE_OPTIONS +=    --sysconfdir=/usr/share
+CONFIGURE_OPTIONS +=    --sysconfdir=$(USRSHAREDIR)
 
 # pkgdepend doesn't like the first line of a Python script to be:
 # '#!/usr/bin/env python' so turn it into '#!/usr/bin/python$(PYTHON_VERSION)'
 #
 COMPONENT_POST_INSTALL_ACTION += \
         $(GSED) -i -e 's?env python?python$(PYTHON_VERSION)?' \
-                $(PROTOUSRBINDIR64)/asciidoc.py;
+                $(PROTOUSRBINDIR)/asciidoc.py;
 COMPONENT_POST_INSTALL_ACTION += \
         $(GSED) -i -e 's?env python?python$(PYTHON_VERSION)?' \
-                $(PROTOUSRBINDIR64)/a2x.py;
+                $(PROTOUSRBINDIR)/a2x.py;
 
 COMPONENT_PRE_CONFIGURE_ACTION = \
         ($(CLONEY) $(SOURCE_DIR) $(@D))
 
-ASLR_MODE = $(ASLR_ENABLE)
-
 # common targets
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
 # Tests require image/graphviz to be installed.  Some tests also want to run
 # programs which are not automatically available on Solaris (latex, abc2ly
 # and lilypad), so these tests will output messages of the form:
@@ -116,10 +104,6 @@
 	python$(PYTHON_VERSION) ./testasciidoc.py run
 COMPONENT_SYSTEM_TEST_TARGETS =
 
-test:           $(TEST_64)
-
-system-test:    configure $(SYSTEM_TEST_64)
-
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += library/libxslt
 REQUIRED_PACKAGES += web/browser/lynx
--- a/components/asciidoc/asciidoc.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/asciidoc/asciidoc.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -35,8 +35,8 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2013/268
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/a2x.py path=usr/bin/a2x
-file usr/bin/$(MACH64)/asciidoc.py path=usr/bin/asciidoc
+file usr/bin/a2x.py path=usr/bin/a2x
+file usr/bin/asciidoc.py path=usr/bin/asciidoc
 file path=usr/share/asciidoc/asciidoc.conf
 file path=usr/share/asciidoc/dblatex/asciidoc-dblatex.sty
 file path=usr/share/asciidoc/dblatex/asciidoc-dblatex.xsl
--- a/components/aspell/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/aspell/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,20 +18,19 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-COMPILER =		gcc
-
+BUILD_BITS= 64_and_32
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		aspell
 COMPONENT_VERSION=	0.60.6.1
 COMPONENT_PROJECT_URL=	http://aspell.net/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1
-COMPONENT_ARCHIVE_URL=	ftp://ftp.gnu.org/gnu/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
 
 COMPONENT_NAME_1=	aspell6-en
 COMPONENT_VERSION_1=	7.1-0
@@ -42,16 +41,13 @@
 COMPONENT_ARCHIVE_URL_1= ftp://ftp.gnu.org/gnu/$(COMPONENT_NAME)/dict/en/$(COMPONENT_ARCHIVE_1)
 SOURCE_DIR_1=		$(COMPONENT_DIR)/$(COMPONENT_SRC_1)
 
-COMPONENT_BUGDB=	utility/aspell
-
 TPNO=			23575
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-ASPELL_BIN_DIR.32 =	$(PROTOUSRBINDIR)
-ASPELL_BIN_DIR.64 =	$(PROTOUSRBINDIR64)
+ASPELL_BIN_DIR.32 =	$(PROTOUSRBINDIR)/$(MACH32)
+ASPELL_BIN_DIR.64 =	$(PROTOUSRBINDIR)
 ASPELL_BIN_DIR =	$(ASPELL_BIN_DIR.$(BITS))
 
 ASPELL_LIB_DIR.32 =	$(PROTOUSRLIBDIR)
@@ -74,28 +70,14 @@
 		PATH="$(ASPELL_BIN_DIR):$(PATH)" \
 		$(GMAKE) install);
 
-CXX +=			$(CC_BITS)
-CC +=			$(CC_BITS)
-
 CONFIGURE_ENV +=	LD_OPTIONS="$(LD_OPTIONS)"
 
 CLEAN_PATHS +=		$(SOURCE_DIR_1)
 PKG_PROTO_DIRS +=	$(SOURCE_DIR_1)
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
 REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += $(PERL_PKG)
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/aspell/aspell.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/aspell/aspell.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -35,10 +35,10 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2015/228
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/aspell path=usr/bin/aspell
-file usr/bin/$(MACH64)/aspell-import path=usr/bin/aspell-import
-file usr/bin/$(MACH64)/run-with-aspell path=usr/bin/run-with-aspell
-file usr/bin/$(MACH64)/word-list-compress path=usr/bin/word-list-compress
+file path=usr/bin/aspell
+file path=usr/bin/aspell-import
+file path=usr/bin/run-with-aspell
+file path=usr/bin/word-list-compress
 file path=usr/include/aspell.h
 file path=usr/include/pspell/pspell.h
 file path=usr/lib/$(MACH64)/aspell-0.60/ccpp.amf
--- a/components/augeas/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/augeas/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,38 +18,30 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-COMPILER = gcc
-
+BUILD_BITS= 64
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		augeas
 COMPONENT_VERSION=	1.3.0
 COMPONENT_PROJECT_URL=	http://www.augeas.net/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:80763031af76515a8ea66013ddc3c466742a15d2e907c7c8e2e3b7410262e2af
 COMPONENT_ARCHIVE_URL=	http://download.augeas.net/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/augeas
 
 TPNO=	21660
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-CONFIGURE_BINDIR.64 =	$(CONFIGURE_PREFIX)/bin
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PRE_CONFIGURE_ACTION = \
        ($(CLONEY) $(SOURCE_DIR) $(@D))
 
-CONFIGURE_PREFIX    =	/usr
 CONFIGURE_OPTIONS  +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS  +=	--disable-dependency-tracking
-CONFIGURE_OPTIONS  +=	CFLAGS="$(CFLAGS)"
 
 COMPONENT_TEST_ARGS = -k
 COMPONENT_TEST_TRANSFORMS += \
@@ -65,11 +57,10 @@
         '-e "/PASS/p" ' \
         '-e "/FAIL/p" '
 
+# XXX why does this coredump without the workaround?
 # Fixes coredump in gnulib-test/test-localename test
 CONFIGURE_OPTIONS  +=           ac_cv_func_newlocale=no
 
-ASLR_MODE = $(ASLR_ENABLE)
-
 # Needed for "gmake test" to work.
 # SHELLOPTS is exported via make-rules/shared-macros.mk,
 # causing the braceexpand option to be set.
@@ -79,16 +70,6 @@
 # other than "test." 
 unexport SHELLOPTS
 
-# common targets
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += library/readline
--- a/components/autoconf/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/autoconf/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,45 +22,25 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= NO_ARCH
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		autoconf
 COMPONENT_VERSION=	2.69
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/autoconf/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/autoconf/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/autoconf
 
 TPNO=			22294
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # with ksh93 as the configure shell, all tests pass
-CONFIG_SHELL=/bin/ksh93
-
-CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS  +=		PERL="$(PERL)"
-CONFIGURE_OPTIONS  +=		M4=/usr/gnu/bin/m4
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
+CONFIG_SHELL=$(BINDIR)/ksh93
 
-# common targets
-configure:	$(CONFIGURE_NO_ARCH)
-
-build:		$(BUILD_NO_ARCH)
-
-install:	$(INSTALL_NO_ARCH)
-
-test:		$(TEST_NO_ARCH)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
+CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
+CONFIGURE_OPTIONS += PERL="$(PERL)"
+CONFIGURE_OPTIONS += M4="$(GNUBIN)/m4"
 
 REQUIRED_PACKAGES += developer/macro/gnu-m4
 REQUIRED_PACKAGES += $(PERL_PKG)
--- a/components/autogen/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/autogen/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,35 +18,33 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+# Normally, 64-bit binaries are preferred over 32-bit ones, but we prefer
+# 32-bit for this component to keep the historical defaults used by autogen for
+# 32-bit and 64-bit.
+BUILD_BITS= 32_and_64
 # built in SFW with gcc and builds cleanly now only with gcc
-COMPILER =	gcc
-
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		autogen
 COMPONENT_VERSION=	5.16.2
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/autogen/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:aa51f5adbf49c2cb48a7d6de3dbab15b89e0a04e7152195fe6fb3380e05c4991
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/autogen/rel$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/autogen
 
 TPNO=			11805
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+# Tests need to be built.
+SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_32_and_64)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # build target is incorrect without this 
 COMPONENT_PRE_CONFIGURE_ACTION =        ($(CLONEY) $(SOURCE_DIR) $(@D))
 
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-
 # strip the environment or install target fails
 ENV +=	-i
 
@@ -74,29 +72,14 @@
 	'-e "/FAIL/p" ' \
 	'-e "/passed/p" '
 
-COMPONENT_SYSTEM_TEST_ENV +=	CLexe=/usr/bin/columns
-COMPONENT_SYSTEM_TEST_ENV +=	GDexe=/usr/bin/getdefs
-COMPONENT_SYSTEM_TEST_ENV +=	AGexe=/usr/bin/autogen
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(TEST_32_and_64)
-
-# Tests need to be built.
-system-test:	build $(SYSTEM_TEST_32_and_64)
-
+COMPONENT_SYSTEM_TEST_ENV +=	CLexe=$(USRBINDIR)/columns
+COMPONENT_SYSTEM_TEST_ENV +=	GDexe=$(USRBINDIR)/getdefs
+COMPONENT_SYSTEM_TEST_ENV +=	AGexe=$(USRBINDIR)/autogen
 
 REQUIRED_PACKAGES += library/gmp
 REQUIRED_PACKAGES += library/guile
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += shell/bash
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc-3-runtime
 REQUIRED_PACKAGES += system/library/gcc-45-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
--- a/components/automake/automake-1.10/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/automake/automake-1.10/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,42 +22,20 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= NO_ARCH
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		automake
 COMPONENT_VERSION=	1.10
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/automake/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:d92c77acdc3b132ff6b2de06a1321654a556defa21b7dd3e8d4829434ed64e8e
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/pub/gnu/automake/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/automake
 
 TPNO=			6149
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-CONFIGURE_OPTIONS  +=	--infodir=/usr/share/$(COMPONENT_NAME)-$(COMPONENT_VERSION)/info
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS  +=		PERL="$(PERL)"
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-# common targets
-configure:	$(CONFIGURE_NO_ARCH)
-
-build:		$(BUILD_NO_ARCH)
-
-install:	$(INSTALL_NO_ARCH)
-
-test:		$(TEST_NO_ARCH)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
+CONFIGURE_OPTIONS  += --infodir=$(USRSHAREDIR)/$(COMPONENT_NAME)-$(COMPONENT_VERSION)/info
+CONFIGURE_OPTIONS  += PERL="$(PERL)"
 
 REQUIRED_PACKAGES += $(PERL_PKG)
 REQUIRED_PACKAGES += shell/ksh93
--- a/components/automake/automake-1.11.2/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/automake/automake-1.11.2/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,42 +22,21 @@
 #
 # Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= NO_ARCH
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		automake
 COMPONENT_MAJMIN_VERS=	1.11
 COMPONENT_VERSION=	1.11.2
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:c339e3871d6595620760725da61de02cf1c293af8a05b14592d6587ac39ce546
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/pub/gnu/automake/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/automake
 
 TPNO=			7253
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-CONFIGURE_OPTIONS  +=	--infodir=/usr/share/$(COMPONENT_NAME)-$(COMPONENT_MAJMIN_VERS)/info
-CONFIGURE_OPTIONS  +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS  +=	PERL="$(PERL)"
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-# common targets
-configure:	$(CONFIGURE_NO_ARCH)
-
-build:		$(BUILD_NO_ARCH)
-
-install:	$(INSTALL_NO_ARCH)
-
-test:		$(TEST_NO_ARCH)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
+CONFIGURE_OPTIONS  += --infodir=$(USRSHAREDIR)/$(COMPONENT_NAME)-$(COMPONENT_MAJMIN_VERS)/info
+CONFIGURE_OPTIONS  += PERL="$(PERL)"
 
 REQUIRED_PACKAGES += $(PERL_PKG)
 REQUIRED_PACKAGES += shell/ksh93
--- a/components/automake/automake-1.15/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/automake/automake-1.15/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,42 +22,22 @@
 #
 # Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= NO_ARCH
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		automake
 COMPONENT_VERSION=	1.15
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/pub/gnu/automake/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/automake
 
 TPNO=			21310
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-CONFIGURE_OPTIONS  +=	--infodir=/usr/share/$(COMPONENT_NAME)-$(COMPONENT_VERSION)/info
-CONFIGURE_OPTIONS  +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS  +=	PERL="$(PERL)"
-
-COMPONENT_TEST_ENV +=	-i PATH=$(GCC_ROOT)/bin:/usr/gnu/bin:/usr/bin
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-# common targets
-configure:	$(CONFIGURE_NO_ARCH)
+CONFIGURE_OPTIONS += --infodir=$(USRSHAREDIR)/$(COMPONENT_NAME)-$(COMPONENT_VERSION)/info
+CONFIGURE_OPTIONS += PERL="$(PERL)"
 
-build:		$(BUILD_NO_ARCH)
-
-install:	$(INSTALL_NO_ARCH)
-
-test:		$(TEST_NO_ARCH)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+COMPONENT_TEST_ENV += -i PATH=$(GCC_ROOT)/bin:$(GNUBIN):$(USRBINDIR)
 
 REQUIRED_PACKAGES += $(PERL_PKG)
 REQUIRED_PACKAGES += shell/ksh93
--- a/components/avahi/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/avahi/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,16 +22,14 @@
 #
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 # Override PATH set in shared-macros.mk by setting the GNU PATH as default.
-PATH=/usr/gnu/bin:/usr/bin
+PATH=$(GNUBIN):$(USRBINDIR)
 
 COMPONENT_NAME=		avahi
 COMPONENT_VERSION=	0.6.30
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=	http://www.avahi.org/
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
 	sha256:f9e4316c2339d0020726edd846d01bee0c39980906db0c247479e5807457ff1f
 COMPONENT_ARCHIVE_URL=	http://www.avahi.org/download/$(COMPONENT_ARCHIVE)
@@ -39,9 +37,6 @@
 
 TPNO=			7879
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-
 # Depends on a Python module from Desktop that is only available 32-bit in S11.
 ifeq ($(BUILD_TYPE), evaluation)
 BUILD_32_and_64=
@@ -49,19 +44,16 @@
 PUBLISH_STAMP=
 endif
 
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
-# Set the pkg... path to search files in ./files/ dir (mainly the SMF manifests are there)
-PKG_PROTO_DIRS += $(COMPONENT_DIR)
-
-CONFIGURE_BINDIR.64 =	$(CONFIGURE_PREFIX)/bin
-CONFIGURE_SBINDIR.64 =	$(CONFIGURE_PREFIX)/bin
+CONFIGURE_SBINDIR.64 =	$(CONFIGURE_BINDIR.64)
 CONFIGURE_OPTIONS	+=	--enable-shared
 CONFIGURE_OPTIONS	+=	--disable-static
-CONFIGURE_OPTIONS	+=	--sysconfdir=/etc
+CONFIGURE_OPTIONS	+=	--sysconfdir=$(ETCDIR)
 CONFIGURE_OPTIONS	+=	--with-avahi-user=daemon
 CONFIGURE_OPTIONS	+=	--with-avahi-group=other
-CONFIGURE_OPTIONS	+=	--localstatedir=/var/avahi
+CONFIGURE_OPTIONS	+=	--localstatedir=$(VARDIR)/avahi
 CONFIGURE_OPTIONS	+=	--with-distro=none
 CONFIGURE_OPTIONS	+=	--disable-gtk3
 CONFIGURE_OPTIONS	+=	--disable-pygtk
@@ -78,9 +70,7 @@
 CONFIGURE_OPTIONS.64	+=	--enable-doxygen-man
 CONFIGURE_OPTIONS.32	+=	--disable-doxygen-man
 CONFIGURE_OPTIONS	+=	CPP="$(CC) -E"
-CONFIGURE_OPTIONS	+=	CFLAGS="$(CFLAGS)"
 LDFLAGS	+=	-ldns_sd
-CONFIGURE_OPTIONS	+=	LDFLAGS="$(LDFLAGS)"
 CONFIGURE_OPTIONS	+=	PYTHON=$(PYTHON.$(PYTHON_VERSION))
 CONFIGURE_OPTIONS	+=	am_cv_python_pythondir="$(PYTHON_VENDOR_PACKAGES)"
 CONFIGURE_OPTIONS	+=	am_cv_python_pyexecdir="$(PYTHON_VENDOR_PACKAGES)"
@@ -94,7 +84,7 @@
 COMPONENT_BUILD_ENV += CC="$(CC)"
 COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)"
 COMPONENT_BUILD_ENV += LDFLAGS="$(LDFLAGS)"
-$(BUILD_32_and_64): PATH = $(SPRO_VROOT)/bin:/usr/gnu/bin:/usr/bin
+$(BUILD_32_and_64): PATH = $(SPRO_VROOT)/bin:$(GNUBIN):$(USRBINDIR)
 COMPONENT_POST_INSTALL_ACTION += \
  ( $(PYTHON.$(PYTHON_VERSION)) -m compileall $(PROTO_DIR)/$(PYTHON_VENDOR_PACKAGES) )
 
@@ -106,17 +96,6 @@
 $(BUILD_32):	COMPONENT_BUILD_TARGETS		+=	SUBDIRS="$(SUBDIRS)"
 $(INSTALL_32):	COMPONENT_INSTALL_TARGETS	+=	SUBDIRS="$(SUBDIRS)"
 
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
 REQUIRED_PACKAGES += library/desktop/gtk2
 REQUIRED_PACKAGES += library/expat
 REQUIRED_PACKAGES += library/glib2
@@ -125,6 +104,5 @@
 REQUIRED_PACKAGES += service/network/dns/mdns
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/dbus
 REQUIRED_PACKAGES += system/library/libdbus
--- a/components/bash/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bash/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,33 +18,33 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		bash
 COMPONENT_VERSION=	4.3
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/bash/
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH = \
     sha256:afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/bash/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/bash
 
 TPNO=			21712
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-BASH_PATCHLEVEL=$(shell grep -h "define PATCHLEVEL" $(COMPONENT_DIR)/patches/bash* | nawk '{print $$NF}' | sort -n | tail -1)
+# Avoid running configure again during the build due to patches to
+# configure-related files by running autoconf before we run configure.
+COMPONENT_PREP_ACTION += (cd $(@D); autoconf)
+
+BASH_PATCHLEVEL=$(shell grep -h "define PATCHLEVEL" $(COMPONENT_DIR)/patches/bash* | $(NAWK) '{print $$NF}' | sort -n | tail -1)
 IPS_COMPONENT_VERSION = $(COMPONENT_VERSION).$(BASH_PATCHLEVEL)
 PATCH_LEVEL = 0
 
 PKG_PROTO_DIRS += $(COMPONENT_DIR)/Solaris
 
-# Enable C99 mode + -Xc for it's additional warnings.
+# Enable C99 mode + -Xc for its additional warnings.
 studio_C99MODE = -Xc $(studio_C99_ENABLE)
 
 # Use the maximum number of registers on sparc since we have no libraries
@@ -62,12 +62,15 @@
 
 CFLAGS += $(XPG6MODE)
 CFLAGS += $(CPP_C99_EXTENDED_MATH)
-CFLAGS += -I/usr/include/ncurses
+CFLAGS += -I$(USRINCDIR)/ncurses
 
 # configure checks for some functions, but doesn't seem to want to link in
 # the required libraries for them. We avoid linking with libthread.so.1
 # just because we pass -mt, by explicitly passing -lc.
-LIBS =	-lc -lsocket -lgen
+LIBS =	-lc -lgen
+ifeq ($(OS_VERSION),5.11)
+LIBS +=	-lsocket
+endif
 
 # -z redlocsym -- let's shrink the SHT_SYMTAB as much as we can
 LDFLAGS =	$(LD_Z_REDLOCSYM)
@@ -97,53 +100,68 @@
 # The bash test harness needs the GNU userland utilities
 TEST_PATH = "PATH=$(BUILD_DIR_64):$(GNUBIN):$(USRBINDIR)"
 
-CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"
+# This avoids the need to patch configure or other files for these dependencies.
+ifeq ($(OS_VERSION), 5.11)
+CONFIGURE_ENV += LD_OPTIONS="-lc -lm -lgen -lsocket -lnsl -lresolv $(LD_Z_IGNORE)"
+else
+CONFIGURE_ENV += LD_OPTIONS="-lc -lm -lgen -lresolv $(LD_Z_IGNORE)"
+endif
+
 CONFIGURE_ENV +=	LIBS="$(LIBS)"
 
-CONFIGURE_OPTIONS  +=		--localstatedir=/var
-CONFIGURE_OPTIONS  += 		--enable-alias
-CONFIGURE_OPTIONS  += 		--enable-arith-for-command
-CONFIGURE_OPTIONS  += 		--enable-array-variables
-CONFIGURE_OPTIONS  += 		--enable-bang-history
-CONFIGURE_OPTIONS  += 		--enable-brace-expansion
-CONFIGURE_OPTIONS  += 		--enable-casemod-attributes
-CONFIGURE_OPTIONS  += 		--enable-casemod-expansions
-CONFIGURE_OPTIONS  += 		--enable-command-timing
-CONFIGURE_OPTIONS  += 		--enable-cond-command
-CONFIGURE_OPTIONS  += 		--enable-cond-regexp
-CONFIGURE_OPTIONS  += 		--enable-coprocesses
-CONFIGURE_OPTIONS  += 		--enable-debugger
-CONFIGURE_OPTIONS  += 		--enable-directory-stack
-CONFIGURE_OPTIONS  += 		--enable-disabled-builtins
-CONFIGURE_OPTIONS  += 		--enable-dparen-arithmetic
-CONFIGURE_OPTIONS  += 		--enable-extended-glob
-CONFIGURE_OPTIONS  += 		--enable-help-builtin
-CONFIGURE_OPTIONS  += 		--enable-history
-CONFIGURE_OPTIONS  += 		--enable-job-control
-CONFIGURE_OPTIONS  += 		--enable-multibyte
-CONFIGURE_OPTIONS  += 		--enable-net-redirections
-CONFIGURE_OPTIONS  += 		--enable-process-substitution
-CONFIGURE_OPTIONS  += 		--enable-progcomp
-CONFIGURE_OPTIONS  += 		--enable-prompt-string-decoding
-CONFIGURE_OPTIONS  += 		--enable-readline
-CONFIGURE_OPTIONS  += 		--enable-restricted
-CONFIGURE_OPTIONS  += 		--enable-select
-CONFIGURE_OPTIONS  += 		--enable-separate-helpfiles
-CONFIGURE_OPTIONS  += 		--enable-single-help-strings
-CONFIGURE_OPTIONS  += 		--disable-strict-posix-default
-CONFIGURE_OPTIONS  += 		--enable-usg-echo-default=yes
-CONFIGURE_OPTIONS  += 		--enable-xpg-echo-default=yes
-CONFIGURE_OPTIONS  += 		--enable-mem-scramble
-CONFIGURE_OPTIONS  += 		--disable-profiling
-CONFIGURE_OPTIONS  += 		--enable-static-link
-CONFIGURE_OPTIONS  += 		--enable-largefile
-CONFIGURE_OPTIONS  += 		--enable-nls
-CONFIGURE_OPTIONS  += 		--with-bash-malloc=yes
-CONFIGURE_OPTIONS  += 		--with-curses
-CONFIGURE_OPTIONS  += 		--with-installed-readline=no
-CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
+# Ignore tgetent() checks in configure and use libncurses on Solaris.
+CONFIGURE_ENV += ac_cv_func_tgetent=yes
+CONFIGURE_ENV += ac_cv_lib_termcap_tgetent=no
+CONFIGURE_ENV += ac_cv_lib_curses_tgetent=no
+CONFIGURE_ENV += ac_cv_lib_ncurses_tgetent=yes
+CONFIGURE_ENV += bash_cv_termcap_lib=libncurses
+
+# bash will trigger an autoconf during the build; so apply above again
+# XXX just apply configure_env?
+# COMPONENT_BUILD_ENV += $(CONFIGURE_ENV)
 
+CONFIGURE_OPTIONS += --disable-profiling
+CONFIGURE_OPTIONS += --disable-strict-posix-default
+CONFIGURE_OPTIONS += --enable-alias
+CONFIGURE_OPTIONS += --enable-arith-for-command
+CONFIGURE_OPTIONS += --enable-array-variables
+CONFIGURE_OPTIONS += --enable-bang-history
+CONFIGURE_OPTIONS += --enable-brace-expansion
+CONFIGURE_OPTIONS += --enable-casemod-attributes
+CONFIGURE_OPTIONS += --enable-casemod-expansions
+CONFIGURE_OPTIONS += --enable-command-timing
+CONFIGURE_OPTIONS += --enable-cond-command
+CONFIGURE_OPTIONS += --enable-cond-regexp
+CONFIGURE_OPTIONS += --enable-coprocesses
+CONFIGURE_OPTIONS += --enable-debugger
+CONFIGURE_OPTIONS += --enable-directory-stack
+CONFIGURE_OPTIONS += --enable-disabled-builtins
+CONFIGURE_OPTIONS += --enable-dparen-arithmetic
+CONFIGURE_OPTIONS += --enable-extended-glob
+CONFIGURE_OPTIONS += --enable-help-builtin
+CONFIGURE_OPTIONS += --enable-history
+CONFIGURE_OPTIONS += --enable-job-control
+CONFIGURE_OPTIONS += --enable-largefile
+CONFIGURE_OPTIONS += --enable-mem-scramble
+CONFIGURE_OPTIONS += --enable-multibyte
+CONFIGURE_OPTIONS += --enable-net-redirections
+CONFIGURE_OPTIONS += --enable-nls
+CONFIGURE_OPTIONS += --enable-process-substitution
+CONFIGURE_OPTIONS += --enable-progcomp
+CONFIGURE_OPTIONS += --enable-prompt-string-decoding
+CONFIGURE_OPTIONS += --enable-readline
+CONFIGURE_OPTIONS += --enable-restricted
+CONFIGURE_OPTIONS += --enable-select
+CONFIGURE_OPTIONS += --enable-separate-helpfiles
+CONFIGURE_OPTIONS += --enable-single-help-strings
+CONFIGURE_OPTIONS += --enable-static-link
+CONFIGURE_OPTIONS += --enable-usg-echo-default=yes
+CONFIGURE_OPTIONS += --enable-xpg-echo-default=yes
+CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
+CONFIGURE_OPTIONS += --localstatedir=$(VARDIR)
+CONFIGURE_OPTIONS += --with-bash-malloc=yes
+CONFIGURE_OPTIONS += --with-curses
+CONFIGURE_OPTIONS += --with-installed-readline=no
 COMPONENT_TEST_DIR =		$(BUILD_DIR_64)
 COMPONENT_TEST_ENV =		- $(TEST_PATH)
 
@@ -152,23 +170,12 @@
 # avoid permission issues for other users running these tests
 COMPONENT_POST_TEST_ACTION =	rm -f /tmp/xx
 
-ASLR_MODE=$(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build: $(BUILD_64)
-
-install: $(INSTALL_64)
+COMPONENT_POST_INSTALL_ACTION += \
 	( cd $(PROTOUSRSHAREDIR)/locale ; \
 	    cp -Rp "en@boldquot" en ; \
 	    cp -Rp "en@boldquot" en_CA ; \
 	    cp -Rp "en@boldquot" en_GB )
 
-test:	$(TEST_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 
--- a/components/bash/bash.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bash/bash.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -38,8 +38,8 @@
 file etc.bash.bashrc path=etc/bash/bashrc.example
 file etc.bash.inputrc path=etc/bash/inputrc.example
 file etc.skel.bashrc path=etc/skel/.bashrc
-file usr/bin/$(MACH64)/bash path=usr/bin/bash
-file usr/bin/$(MACH64)/bashbug path=usr/bin/bashbug
+file path=usr/bin/bash
+file path=usr/bin/bashbug
 #
 link path=usr/bin/rbash target=./bash
 link path=usr/gnu/bin/sh target=../../bin/bash
--- a/components/bash/patches/solaris-009.configure.patch	Wed Mar 30 10:16:56 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-# Solaris-specific ./configure stuff.
-# 1. We need to link bash with -lget.
-# 2. It's a release build, therefore we really don't want debugging
-# 3. We really want to use ncurses because bash is very compatible
-# with it.
---- configure	2014-02-11 07:38:00.000000000 -0800
-+++ configure	2015-04-02 10:48:06.744812618 -0700
-@@ -1,4 +1,4 @@
--#! /bin/sh
-+#!/bin/bash
- # From configure.ac for Bash 4.3, version 4.063.
- # Guess values for system-dependent variables and create Makefiles.
- # Generated by GNU Autoconf 2.69 for bash 4.3-release.
-@@ -15,6 +15,8 @@
- ## M4sh Initialization. ##
- ## -------------------- ##
- 
-+export LD_OPTIONS="-lc -lm -lgen -lsocket -lnsl -lresolv -lncurses -z ignore"
-+
- # Be more Bourne compatible
- DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-@@ -277,7 +279,7 @@
- fi
- fi
- fi
--SHELL=${CONFIG_SHELL-/bin/sh}
-+SHELL=${CONFIG_SHELL-/bin/bash}
- export SHELL
- # Unset more variables known to interfere with behavior of common tools.
- CLICOLOR_FORCE= GREP_OPTIONS=
-@@ -4015,7 +4017,7 @@
-   ac_save_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-    ac_cv_prog_cc_g=no
--   CFLAGS="-g"
-+   CFLAGS=""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
-@@ -4046,7 +4048,7 @@
- 
- else
-   ac_c_werror_flag=$ac_save_c_werror_flag
--	 CFLAGS="-g"
-+	 CFLAGS=""
- 	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
-@@ -4074,13 +4076,13 @@
-   CFLAGS=$ac_save_CFLAGS
- elif test $ac_cv_prog_cc_g = yes; then
-   if test "$GCC" = yes; then
--    CFLAGS="-g -O2"
-+    CFLAGS=""
-   else
--    CFLAGS="-g"
-+    CFLAGS=""
-   fi
- else
-   if test "$GCC" = yes; then
--    CFLAGS="-O2"
-+    CFLAGS=""
-   else
-     CFLAGS=
-   fi
-@@ -4922,8 +4924,8 @@
- 
- 
- if test -z "$CFLAGS"; then
--	AUTO_CFLAGS="-g ${GCC+-O2}"
--	AUTO_LDFLAGS="-g ${GCC+-O2}"
-+	AUTO_CFLAGS=""
-+	AUTO_LDFLAGS=""
- else
- 	AUTO_CFLAGS= AUTO_LDFLAGS=
- fi
-@@ -4951,7 +4953,7 @@
- 		STATIC_LD="-static"
- 		case "$host_os" in
- 		solaris2*)	;;
--		*)		LDFLAGS="$LDFLAGS -static" ;;	# XXX experimental
-+		*)		LDFLAGS="$LDFLAGS" ;;	# XXX experimental
- 		esac
- 	fi
- fi
-@@ -4970,7 +4972,7 @@
- 	CC_FOR_BUILD=${CC_FOR_BUILD-"gcc"}
- 	CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""}
- 	LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
--	CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD="-g"}
-+	CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD=""}
- 	LIBS_FOR_BUILD=${LIBS_FOR_BUILD-""}
- fi
- 
-@@ -5148,9 +5150,14 @@
- int
- main ()
- {
-+  #if defined(sun) || defined(__sun) || defined(__sun__)
-+  #error "we want to use libcurses."
-+  return 255;
-+  #else
- return tgetent ();
-   ;
-   return 0;
-+  #endif
- }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
-@@ -5187,9 +5194,14 @@
- int
- main ()
- {
-+    #if defined(sun) || defined(__sun) || defined(__sun__)
-+    #error "we want to use libcurses."
-+    return 255;
-+    #else
- return tgetent ();
-   ;
-   return 0;
-+#endif
- }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
-@@ -5815,7 +5827,7 @@
-   $as_echo_n "(cached) " >&6
- else
-   cat >conftest.make <<\_ACEOF
--SHELL = /bin/sh
-+SHELL = /bin/bash
- all:
- 	@echo '@@@%%%=$(MAKE)=@@@%%%'
- _ACEOF
-@@ -5846,8 +5858,8 @@
- esac
- 
- case "$host_os" in
--opennt*|interix*)	MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
--*)			MAKE_SHELL=/bin/sh ;;
-+opennt*|interix*)	MAKE_SHELL="$INTERIX_ROOT/bin/bash" ;;
-+*)			MAKE_SHELL=/bin/bash ;;
- esac
- 
- 
-@@ -6509,7 +6521,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -6523,7 +6535,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
-@@ -6620,7 +6632,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -6634,7 +6646,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
-@@ -6691,7 +6703,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -6705,7 +6717,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
-@@ -7538,7 +7550,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -7646,7 +7658,7 @@
- else
- 
-     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
--    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-+    ${CONFIG_SHELL-/bin/bash} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-     . ./conftest.sh
-     rm -f ./conftest.sh
-     acl_cv_rpath=done
-@@ -12590,7 +12602,7 @@
- exit 69
- ' >conftest
- chmod u+x conftest
--(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1)
-+(SHELL=/bin/bash; export SHELL; ./conftest >/dev/null 2>&1)
- if test $? -ne 69; then
-    ac_cv_sys_interpreter=yes
- else
-@@ -15728,9 +15740,14 @@
- int
- main ()
- {
-+#if defined(sun) || defined(__sun) || defined(__sun__)
-+#error "we want to use libcurses."
-+return 255;
-+#else
- return tgetent ();
-   ;
-   return 0;
-+#endif
- }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
-@@ -15783,7 +15800,7 @@
- TERMCAP_LIB=
- TERMCAP_DEP=
- else
--TERMCAP_LIB=-lcurses
-+TERMCAP_LIB=/usr/lib/64/libcurses.so.1
- TERMCAP_DEP=
- fi
- 
-@@ -15918,7 +15935,9 @@
- solaris2.5*)	LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;;
- solaris2.8*)	LOCAL_CFLAGS=-DSOLARIS  ;;
- solaris2.9*)	LOCAL_CFLAGS=-DSOLARIS  ;;
--solaris2.10*)	LOCAL_CFLAGS=-DSOLARIS  ;;
-+solaris2.10*)	LOCAL_CFLAGS="-DSOLARIS -lsocket -lnsl -lgen" ;;
-+solaris2.11*)	LOCAL_CFLAGS="-DSOLARIS -lsocket -lnsl -lgen -lncurses" ;;
-+solaris2.12*)	LOCAL_CFLAGS="-DSOLARIS -lsocket -lnsl -lgen -lncurses" ;;
- solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
- lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
- linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
-@@ -15970,7 +15989,7 @@
- then
- 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking shared object configuration for loadable builtins" >&5
- $as_echo_n "checking shared object configuration for loadable builtins... " >&6; }
--	eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
-+	eval `${CONFIG_SHELL-/bin/bash} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
- 
- 
- 
--- a/components/bcc/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bcc/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,9 +22,8 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-COMPILER =	gcc
-
+BUILD_BITS= 64
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		bcc
@@ -35,16 +34,18 @@
 COMPONENT_ARCHIVE_HASH=	\
     sha256:52ed4980c0e4b68d2624aadb0ceb0339cb3fd8dd7c2175419d4f77a451846cbe
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/bcc
 
 TPNO=			8334
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
+INSTALL_TARGET= build
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
+
+# Fix 64-bit linking via compiler.
+LDFLAGS += "$(CC_BITS)"
 
 COMPONENT_PRE_CONFIGURE_ACTION = ($(CLONEY) $(SOURCE_DIR) $(@D))
-CC += $(CC_BITS)
 
 # Create the Makefile before we build
 COMPONENT_PRE_BUILD_ACTION = (cd $(@D) ; CC="$(CC)" $(GMAKE) make.fil)
@@ -55,15 +56,6 @@
 COMPONENT_BUILD_ARGS += VERSION="$(COMPONENT_VERSION)"
 COMPONENT_BUILD_ARGS += TOPDIR="$(@D)"
 COMPONENT_BUILD_ARGS += CC="$(CC)"
+COMPONENT_BUILD_ARGS += CFLAGS="$(CFLAGS)"
+COMPONENT_BUILD_ARGS += LDFLAGS="$(LDFLAGS)"
 COMPONENT_BUILD_TARGETS = bcc86 as86 ld86 ar86
-
-
-# common targets
-install build:		$(BUILD_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
--- a/components/beanshell/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/beanshell/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,16 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		beanshell
 COMPONENT_VERSION=	2.0b4
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=	http://www.beanshell.org/
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:a6f02b46796ed6b6a212cfc2d17e4797212db3206e21a3f4959adb60bddfff5f
 # This should come from http://www.beanshell.org/ however they do not
@@ -36,15 +37,12 @@
 # more attention at the google code repository of late.
 COMPONENT_ARCHIVE_URL=	$(EXTERNAL_ARCHIVE_MIRROR)/$(SOURCE_ARCHIVE)
 
-COMPONENT_BUGDB=	utility/beanshell
-
 IPS_COMPONENT_VERSION=	2.0
 
 TPNO=			6200
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/ant.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= ant
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_BUILD_ARGS +=	-Ddist-dir=${PROTO_DIR}
 COMPONENT_BUILD_ARGS +=	-Djavadoc-dir=${PROTO_DIR}
@@ -56,19 +54,6 @@
 # associated beanshell.p5m file.
 PUBLISH_TRANSFORMS += solaris-transform
 # Needed to pick up scripts/bsh and bshcommands-bshdoc.xml
-PKG_PROTO_DIRS += $(COMPONENT_DIR) 
 PKG_PROTO_DIRS += $(BUILD_DIR_32)
 
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-# common targets
-build:		$(BUILD_32)
-
-install:	build
-
-test:	$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += shell/ksh93
--- a/components/berkeleydb/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/berkeleydb/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,7 +22,7 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 PATH=$(SPRO_VROOT)/bin:/usr/bin
@@ -31,17 +31,12 @@
 COMPONENT_VERSION=	5.3.21
 COMPONENT_PROJECT_URL=	http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html
 COMPONENT_SRC_NAME=	db
-COMPONENT_SRC=		$(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:ddd92a930317df92021054c03992392db9ea5cddba43bef8920d392a82114fb8
 COMPONENT_ARCHIVE_URL=	http://download.oracle.com/berkeley-db/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	database/berkeley
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PRE_CONFIGURE_ACTION = \
         ($(CLONEY) $(SOURCE_DIR) $(@D))
@@ -67,27 +62,23 @@
 CONFIGURE_SCRIPT = dist/configure
 
 # adding to the C++ compiler because libtool appears to strip it from CXXFLAGS
-CXX +=	$(studio_NORUNPATH)
+CXX +=	$($(COMPILER)_NORUNPATH)
 
 # we need to enable large file support and build PIC for our shared libraries
 CFLAGS += $(CPP_LARGEFILES) $(CC_PIC)
 CXXFLAGS += $(CPP_LARGEFILES)
 
-CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
-
 # BerkeleyDB < 6 does not support Java 8. Java 7 is EOL & removed.
 CONFIGURE_OPTIONS += --disable-java
-CONFIGURE_OPTIONS += --disable-jdbc 
-
-CONFIGURE_OPTIONS += --includedir=/usr/include
+CONFIGURE_OPTIONS += --disable-jdbc
+CONFIGURE_OPTIONS += --includedir=$(USRINCDIR)
 CONFIGURE_OPTIONS += --enable-shared
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --enable-cxx
 CONFIGURE_OPTIONS += --enable-sql
 CONFIGURE_OPTIONS += --enable-sql_codegen
 CONFIGURE_OPTIONS += --enable-tcl
-CONFIGURE_OPTIONS += --with-tcl=/usr/lib
+CONFIGURE_OPTIONS += --with-tcl=$(USRLIBDIR)
 CONFIGURE_OPTIONS += --enable-dbm
 CONFIGURE_OPTIONS += $(configure_test)
 
@@ -95,30 +86,17 @@
 
 $(SKIP_TEST_AT_TOP_LEVEL)
 
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
-
 $(BUILD_DIR)/%/.tested: configure_test= --enable-test
 
 # Do not apply the standard licence transforms for this component.
 LICENSE_TRANSFORMS =
 
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-		$(CP) berkeleydb.license $(PROTOUSRDIR)/docs/LICENSE
-
-test:		$(TEST_32_and_64) 
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+COMPONENT_POST_INSTALL_ACTION += \
+	$(CP) berkeleydb.license $(PROTOUSRDIR)/docs/LICENSE
 
 # By default "gmake test" runs standard tests, takes ~2 days per $(BITS).
 RUN=run_std
 
 
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/c++-runtime
--- a/components/berkeleydb/berkeleydb.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/berkeleydb/berkeleydb.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -36,36 +36,36 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2010/300
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/db_archive path=usr/bin/$(MACH32)/db_archive
-file usr/bin/db_checkpoint path=usr/bin/$(MACH32)/db_checkpoint
-file usr/bin/db_deadlock path=usr/bin/$(MACH32)/db_deadlock
-file usr/bin/db_dump path=usr/bin/$(MACH32)/db_dump
-file usr/bin/db_hotbackup path=usr/bin/$(MACH32)/db_hotbackup
-file usr/bin/db_load path=usr/bin/$(MACH32)/db_load
-file usr/bin/db_log_verify path=usr/bin/$(MACH32)/db_log_verify
-file usr/bin/db_printlog path=usr/bin/$(MACH32)/db_printlog
-file usr/bin/db_recover path=usr/bin/$(MACH32)/db_recover
-file usr/bin/db_replicate path=usr/bin/$(MACH32)/db_replicate
-file usr/bin/db_sql_codegen path=usr/bin/$(MACH32)/db_sql_codegen
-file usr/bin/db_stat path=usr/bin/$(MACH32)/db_stat
-file usr/bin/db_upgrade path=usr/bin/$(MACH32)/db_upgrade
-file usr/bin/db_verify path=usr/bin/$(MACH32)/db_verify
-file usr/bin/dbsql path=usr/bin/$(MACH32)/dbsql
-file usr/bin/$(MACH64)/db_archive path=usr/bin/db_archive
-file usr/bin/$(MACH64)/db_checkpoint path=usr/bin/db_checkpoint
-file usr/bin/$(MACH64)/db_deadlock path=usr/bin/db_deadlock
-file usr/bin/$(MACH64)/db_dump path=usr/bin/db_dump
-file usr/bin/$(MACH64)/db_hotbackup path=usr/bin/db_hotbackup
-file usr/bin/$(MACH64)/db_load path=usr/bin/db_load
-file usr/bin/$(MACH64)/db_log_verify path=usr/bin/db_log_verify
-file usr/bin/$(MACH64)/db_printlog path=usr/bin/db_printlog
-file usr/bin/$(MACH64)/db_recover path=usr/bin/db_recover
-file usr/bin/$(MACH64)/db_replicate path=usr/bin/db_replicate
-file usr/bin/$(MACH64)/db_sql_codegen path=usr/bin/db_sql_codegen
-file usr/bin/$(MACH64)/db_stat path=usr/bin/db_stat
-file usr/bin/$(MACH64)/db_upgrade path=usr/bin/db_upgrade
-file usr/bin/$(MACH64)/db_verify path=usr/bin/db_verify
-file usr/bin/$(MACH64)/dbsql path=usr/bin/dbsql
+file path=usr/bin/$(MACH32)/db_archive
+file path=usr/bin/$(MACH32)/db_checkpoint
+file path=usr/bin/$(MACH32)/db_deadlock
+file path=usr/bin/$(MACH32)/db_dump
+file path=usr/bin/$(MACH32)/db_hotbackup
+file path=usr/bin/$(MACH32)/db_load
+file path=usr/bin/$(MACH32)/db_log_verify
+file path=usr/bin/$(MACH32)/db_printlog
+file path=usr/bin/$(MACH32)/db_recover
+file path=usr/bin/$(MACH32)/db_replicate
+file path=usr/bin/$(MACH32)/db_sql_codegen
+file path=usr/bin/$(MACH32)/db_stat
+file path=usr/bin/$(MACH32)/db_upgrade
+file path=usr/bin/$(MACH32)/db_verify
+file path=usr/bin/$(MACH32)/dbsql
+file path=usr/bin/db_archive
+file path=usr/bin/db_checkpoint
+file path=usr/bin/db_deadlock
+file path=usr/bin/db_dump
+file path=usr/bin/db_hotbackup
+file path=usr/bin/db_load
+file path=usr/bin/db_log_verify
+file path=usr/bin/db_printlog
+file path=usr/bin/db_recover
+file path=usr/bin/db_replicate
+file path=usr/bin/db_sql_codegen
+file path=usr/bin/db_stat
+file path=usr/bin/db_upgrade
+file path=usr/bin/db_verify
+file path=usr/bin/dbsql
 file path=usr/include/db.h
 file path=usr/include/db_cxx.h
 file path=usr/include/dbsql.h
--- a/components/bind/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bind/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,16 +18,17 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		bind
 COMPONENT_VERSION=	9.6-ESV-R11
 HUMAN_VERSION=		$(COMPONENT_VERSION)-P6
 IPS_COMPONENT_VERSION=	9.6.3.11.6
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_PROJECT_URL=	http://www.isc.org/software/bind/
 
 # hash from: sha256sum $(COMPONENT_ARCHIVE) | sed 's/\(.[^ ]*\).*/sha256:\1/'
@@ -39,9 +40,7 @@
 
 TPNO=			25905
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 # Specify "configure" options and features.
 # FYI, The configure options are displayed by 'named -V'.
@@ -53,9 +52,9 @@
 CONFIGURE_OPTIONS +=	--disable-openssl-version-check
 CONFIGURE_OPTIONS +=	--with-pkcs11
 # - Use xml2-config found uder /usr without checking its version.
-CONFIGURE_OPTIONS +=	--with-libxml2=/usr
-CONFIGURE_OPTIONS +=	--enable-threads=yes
-CONFIGURE_OPTIONS +=	--enable-devpoll=yes
+CONFIGURE_OPTIONS +=	--with-libxml2=$(USRDIR)
+CONFIGURE_OPTIONS +=	--enable-threads
+CONFIGURE_OPTIONS +=	--enable-devpoll
 # - Enabled fixed [order] resource-record sets for backward compatibility.
 # - Requires more memory to store the sets so is not the default.
 CONFIGURE_OPTIONS +=	--enable-fixed-rrset
@@ -68,18 +67,14 @@
 CONFIGURE_BINDIR.32 =	$(CONFIGURE_SBINDIR.32)
 CONFIGURE_BINDIR.64 =	$(CONFIGURE_SBINDIR.32)
 CONFIGURE_SBINDIR.64 =	$(CONFIGURE_SBINDIR.32)
-CONFIGURE_OPTIONS +=	--sysconfdir=/etc
-CONFIGURE_OPTIONS +=	--localstatedir=/var
+CONFIGURE_OPTIONS +=	--sysconfdir=$(ETCDIR)
+CONFIGURE_OPTIONS +=	--localstatedir=$(VARDIR)
 CONFIGURE_OPTIONS +=	--with-randomdev=/dev/random
-CONFIGURE_OPTIONS +=	--with-gssapi=/usr
+CONFIGURE_OPTIONS +=	--with-gssapi=$(USRDIR)
 
 # Compiler and compiler options:
 # - configure will add "-mt" to CC which is already set in CFLAGS, so override.
 CONFIGURE_OPTIONS +=	CC="$(CC)"
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
 
 # Test configuration / helper targets:
 COMPONENT_TEST_MASTER = \
@@ -167,16 +162,6 @@
 # Common Command line targets
 .PHONY: configure build install test system-test
 
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:	$(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 # Package dependencies
 # Created by 'gmake REQUIRED_PACKAGES', manually verified.
 REQUIRED_PACKAGES += library/libxml2
@@ -186,5 +171,4 @@
 REQUIRED_PACKAGES += service/security/kerberos-5
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/security/gss
--- a/components/binutils/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/binutils/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,28 +18,27 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-COMPILER=gcc
-
+# At the moment, we build both 32-bit and 64-bit versions of binutils, but only
+# deliver the 32-bit binaries and libraries.
+BUILD_BITS= 32_and_64
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		binutils
 COMPONENT_VERSION=	2.25.1
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/binutils/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
 COMPONENT_ARCHIVE_HASH=	\
 	sha256:b5b14added7d78a8d1ca70b5cb75fef57ce2197264f4f5835326b0df22ac9f22
 COMPONENT_BUGDB=	utility/gnu-binutils
 
 TPNO=			23923
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(TEST_32)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 PATCH_LEVEL := 0
 
@@ -60,12 +59,8 @@
 CXXFLAGS += -D_REENTRANT $(CPP_LARGEFILES) $(CPP_POSIX)
 CPPFLAGS += -D_REENTRANT $(CPP_LARGEFILES) $(CPP_POSIX)
 
-CONFIGURE_PREFIX =	/usr/gnu
+CONFIGURE_PREFIX =	$(USRDIR)/gnu
 
-CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV +=	CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_ENV +=	CPPFLAGS="$(CPPFLAGS)"
-CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"
 CONFIGURE_ENV +=	LD_OPTIONS="$(LD_OPTIONS)"
 CONFIGURE_ENV +=	CCLD="$(CC) $(CFLAGS) $(LDFLAGS)"
 CONFIGURE_ENV +=	LIBS="$(LIBS)"
@@ -73,37 +68,15 @@
 
 CONFIGURE_OPTIONS +=	--mandir=$(CONFIGURE_MANDIR)
 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS +=	--enable-64-bit-bfd=yes
-CONFIGURE_OPTIONS +=    --enable-gold=no
-CONFIGURE_OPTIONS +=    --enable-plugins=yes
-CONFIGURE_OPTIONS +=    --enable-nls=yes
-CONFIGURE_OPTIONS +=    --enable-host-shared=yes
-CONFIGURE_OPTIONS +=    --enable-deterministic-archives=yes
+CONFIGURE_OPTIONS +=    --disable-gold
 CONFIGURE_OPTIONS +=    --disable-libtool-lock
-CONFIGURE_OPTIONS +=    --enable-largefile=yes
-
-
-CONFIGURE_OPTIONS +=	CC="$(CC)"
-CONFIGURE_OPTIONS +=	CXX="$(CXX)"
-CONFIGURE_OPTIONS +=    CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS +=    CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_OPTIONS +=    CPPFLAGS="$(CPPFLAGS)"
-CONFIGURE_OPTIONS +=    LDFLAGS="$(LDFLAGS)"
-CONFIGURE_OPTIONS +=    LD_OPTIONS="$(LD_OPTIONS)"
-
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test: $(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
+CONFIGURE_OPTIONS +=	--enable-64-bit-bfd
+CONFIGURE_OPTIONS +=    --enable-deterministic-archives
+CONFIGURE_OPTIONS +=    --enable-host-shared
+CONFIGURE_OPTIONS +=    --enable-largefile
+CONFIGURE_OPTIONS +=    --enable-nls
+CONFIGURE_OPTIONS +=    --enable-plugins
 
 REQUIRED_PACKAGES += library/zlib
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
 REQUIRED_PACKAGES += system/library/flex-runtime
--- a/components/bison/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bison/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,27 +22,23 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 # for the tests
-COMPILER=gcc
-
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		bison
 COMPONENT_VERSION=	3.0.4
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/bison/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/pub/gnu/bison/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/bison
 
 TPNO=			24440
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(TEST_64)
+# we need to first generate the test suite
+SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 CONFIGURE_LIBDIR.32 =   $(GNULIB)
 CONFIGURE_LIBDIR.64 =   $(GNULIB)/$(MACH64)
@@ -50,8 +46,6 @@
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D))
 
-CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS  +=		M4="/usr/gnu/bin/m4"
 CONFIGURE_OPTIONS  += 		--disable-silent-rules
 
@@ -63,6 +57,8 @@
 # with, so they are 32-bit otherwise.
 CONFIGURE_OPTIONS  +=		WARN_CXXFLAGS_TEST="$(CFLAGS)"
 
+CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
+
 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
 
 # the test suite actually generates a script
@@ -103,23 +99,4 @@
     '-e "s|^rm:.*directory renamed.*$$|XXX_CC_XXX|g" ' \
     '-e "/^XXX_CC_XXX$$/d" '
 
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
-
-$(INSTALL_32):	$(INSTALL_64)
-
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(TEST_64)
-
-# we need to first generate the test suite,
-system-test:    build $(SYSTEM_TEST_64)
-
-
 REQUIRED_PACKAGES += developer/macro/gnu-m4
-REQUIRED_PACKAGES += system/library
--- a/components/bison/bison.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bison/bison.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -37,7 +37,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2007/289 value=PSARC/2015/549
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/bison path=usr/bin/bison
+file path=usr/bin/bison
 link path=usr/sfw/bin/bison target=../../bin/bison
 file path=usr/share/aclocal/bison-i18n.m4
 file path=usr/share/bison/README
--- a/components/bzip2/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bzip2/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,16 +20,14 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		bzip2
 COMPONENT_VERSION=	1.0.6
 COMPONENT_PROJECT_URL=	http://www.bzip.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
@@ -37,13 +35,10 @@
 
 TPNO=			5547
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
-include $(WS_MAKE_RULES)/lint-libraries.mk
-
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
+BUILD_STYLE= justmake
+# build does this always
+SYSTEM_TEST_TARGET= $(SYSTEM_TEST_32_and_64)
+include $(WS_MAKE_RULES)/common.mk
 
 LINT_FLAGS +=	-I.
 
@@ -55,7 +50,7 @@
 COMPONENT_BUILD_ARGS += CFLAGS="$(CFLAGS)"
 COMPONENT_INSTALL_ARGS += PREFIX=$(PROTOUSRDIR)
 
-COMPONENT_PRE_BUILD_ACTION= \
+COMPONENT_PRE_BUILD_ACTION += \
 	(cd $(@D) ; \
 	    cp ../../oldapi.c . )
 
@@ -73,23 +68,14 @@
     '-e "/^XXX_CC_XXX$$/d" '
 
 # common targets
-build:		$(BUILD_32_and_64)
-
-# override the 64 bit install and have it make a directory for the lint lib
-COMPONENT_POST_INSTALL_ACTION = $(MKDIR) $(PROTOUSRLIBDIR64)
+COMPONENT_POST_INSTALL_ACTION.32 += \
+	($(INSTALL) $(BUILD_DIR_32)/libbz2.so.1 $(PROTOUSRLIBDIR); \
+	cd $(PROTOUSRLIBDIR); rm -f libbz2.so; ln -s libbz2.so.1 libbz2.so);
 
-install:	build $(INSTALL_32_and_64)
-	$(INSTALL) $(BUILD_DIR_32)/libbz2.so.1 $(PROTOUSRLIBDIR)
-	cd $(PROTOUSRLIBDIR); rm -f libbz2.so; ln -s libbz2.so.1 libbz2.so
-	$(INSTALL) $(BUILD_DIR_64)/libbz2.so.1 $(PROTOUSRLIBDIR64)
-	cd $(PROTOUSRLIBDIR64); rm -f libbz2.so; ln -s libbz2.so.1 libbz2.so
-	$(INSTALL) $(BUILD_DIR_64)/llib-lbz2.ln $(PROTOUSRLIBDIR64)
+COMPONENT_PRE_INSTALL_ACTION.64 += $(MKDIR) $(PROTOUSRLIBDIR64);
 
-# build does this always
-test:		$(TEST_32_and_64)
-
-system-test:	$(SYSTEM_TEST_32_and_64)
-
+COMPONENT_POST_INSTALL_ACTION.64 += \
+	($(INSTALL) $(BUILD_DIR_64)/libbz2.so.1 $(PROTOUSRLIBDIR64); \
+	cd $(PROTOUSRLIBDIR64); rm -f libbz2.so; ln -s libbz2.so.1 libbz2.so;);
 
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
--- a/components/bzip2/bzip2.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/bzip2/bzip2.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -38,15 +38,15 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/1999/555
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file build/$(MACH64)/bzip2 path=usr/bin/bunzip2
-file build/$(MACH64)/bzip2 path=usr/bin/bzcat
+hardlink path=usr/bin/bunzip2 target=./bzip2
+hardlink path=usr/bin/bzcat target=./bzip2
 link path=usr/bin/bzcmp target=./bzdiff
 file path=usr/bin/bzdiff
 link path=usr/bin/bzegrep target=./bzgrep
 link path=usr/bin/bzfgrep target=./bzgrep
 file path=usr/bin/bzgrep
-file build/$(MACH64)/bzip2 path=usr/bin/bzip2
-file build/$(MACH64)/bzip2recover path=usr/bin/bzip2recover
+file path=usr/bin/bzip2
+file path=usr/bin/bzip2recover
 link path=usr/bin/bzless target=./bzmore
 file path=usr/bin/bzmore
 file path=usr/include/bzlib.h
--- a/components/cdrtools/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cdrtools/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,34 +18,36 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=         cdrtools
 COMPONENT_VERSION=      3.01
 # Zero not allowed in front of number
 IPS_COMPONENT_VERSION=  3.1
+HUMAN_VERSION=          $(COMPONENT_VERSION)
 COMPONENT_SUBVERSION=   a22
-COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL= 	http://cdrecord.berlios.de/private/cdrecord.html 
 COMPONENT_ARCHIVE=      $(COMPONENT_SRC)$(COMPONENT_SUBVERSION).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:facd40dc66f1499dfe936e647b694bee7a12cd63afd901a35bec855d9e3600a5
 COMPONENT_ARCHIVE_URL=  ftp://ftp.berlios.de/pub/cdrecord/alpha/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/cdrtools
 
 TPNO=			6305
 
-PATH=			$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:/usr/bin
+PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR)
+else
+PATH=$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
 endif
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_INSTALL_ARGS +=  GMAKE_NOWARN=true
 COMPONENT_INSTALL_ARGS +=  CCOM=cc64
@@ -58,17 +60,4 @@
 # cdrtools doesn't work with gmake for sparc 64-bit compile.
 GMAKE = $(CCSMAKE)
 
-# Enable ASLR for this component
-ASLR_MODE =    $(ASLR_ENABLE)
-
-build:          $(BUILD_64)
-
-install:        $(INSTALL_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
--- a/components/cdrtools/cdrtools.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cdrtools/cdrtools.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -25,6 +25,7 @@
 set name=pkg.fmri \
     value=pkg:/media/cdrtools@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.summary value="CD/DVD/BluRay command line recording software"
+set name=pkg.human-version value=$(HUMAN_VERSION)
 set name=com.oracle.info.description \
     value="the cdrtools CD/DVD/BluRay recording software"
 set name=com.oracle.info.tpno value=$(TPNO)
--- a/components/check/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/check/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,32 +20,26 @@
 #
 
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		check
 COMPONENT_VERSION=	0.9.14
 COMPONENT_PROJECT_URL=	http://check.sourceforge.net/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:c272624645b1b738cf57fd5d81a3e4d9b722b99d6133ee3f3c4007d4d279840a
 COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/$(COMPONENT_NAME)/$(COMPONENT_NAME)/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/check
 
 TPNO=			19836
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_32_and_64)
+include $(WS_MAKE_RULES)/common.mk
 
 # Several tests fail when the Studio compiler is used.
 COMPILER =      gcc
 
-CC +=		$(CC_BITS)
-
 # Override tests in m4/acx_pthread.m4 that try to set obsolete/incompatible
 # flags for linking threaded code on Solaris.
 PTHREAD_CFLAGS = -D__EXTENSIONS__
@@ -73,20 +67,9 @@
 	'-e "/PASS/p" ' \
         '-e "/FAIL/p" '
 
-COMPONENT_SYSTEM_TEST_ENV =	CHECKMK_SCRIPT=/usr/bin/checkmk
+COMPONENT_SYSTEM_TEST_ENV =	CHECKMK_SCRIPT=$(USRBINDIR)/checkmk
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(TEST_32_and_64)
-
-system-test:    configure $(SYSTEM_TEST_32_and_64)
-
-REQUIRED_PACKAGES +=	system/library
 REQUIRED_PACKAGES +=	system/library/math
 REQUIRED_PACKAGES +=	text/gawk
--- a/components/check/check.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/check/check.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -34,7 +34,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2014/373
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/checkmk path=usr/bin/checkmk
+file path=usr/bin/checkmk
 file path=usr/include/check.h
 file path=usr/include/check_stdint.h
 link path=usr/lib/$(MACH64)/libcheck.so target=libcheck.so.0.0.0
--- a/components/cloog/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cloog/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,18 +18,17 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-COMPILER=gcc
-
+BUILD_BITS= 64_and_32
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cloog
 COMPONENT_VERSION=	0.18.3
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=	http://www.cloog.org/
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:460c6c740acb8cdfbfbb387156b627cf731b3837605f2ec0001d079d89c69734
 COMPONENT_ARCHIVE_URL=	http://www.bastoul.net/cloog/pages/download/$(COMPONENT_ARCHIVE)
@@ -37,13 +36,11 @@
 
 TPNO=			23800
 
-include ../../make-rules/prep.mk
-include ../../make-rules/configure.mk
-include ../../make-rules/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL := 0
 PKG_PROTO_DIRS += $(COMPONENT_DIR)/Solaris
-PATH="/usr/gnu/bin:/usr/perl5/bin:/usr/bin:/usr/sbin"
+PATH="$(GNUBIN):$(USRDIR)/perl5/bin:$(USRBINDIR):$(USRSBINDIR)"
 
 # Don't use SSE3 or SSSE3 on Intel, because it's not completely portable.
 # Do not tell GCC to assume strictly correct pointer aliasing. CLooG
@@ -79,10 +76,6 @@
 CPPFLAGS += `pkg-config --cflags libmpfr`
 CPPFLAGS += `pkg-config --cflags isl`
 
-CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV +=	CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_ENV +=	CPPFLAGS="$(CPPFLAGS)"
-CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"
 CONFIGURE_ENV +=	LD_OPTIONS="$(LD_OPTIONS)"
 CONFIGURE_ENV +=	CCLD="$(CC) $(CFLAGS) $(LDFLAGS)"
 CONFIGURE_ENV +=	LIBS="$(LIBS)"
@@ -90,7 +83,7 @@
 
 COMPONENT_BUILD_ENV += LD_OPTIONS="$(LD_OPTIONS)"
 
-CONFIGURE_OPTIONS  +=		--localstatedir=/var
+CONFIGURE_OPTIONS  +=		--localstatedir=$(VARDIR)
 CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS  +=		--enable-shared
 CONFIGURE_OPTIONS  +=		--disable-silent-rules
@@ -119,8 +112,6 @@
 COMPONENT_TEST_ENV +=	$(TEST_PATH)
 COMPONENT_TEST_ENV +=	$(TARGET_ENV)
 
-ASLR_MDOE=$(ASLR_NOT_APPLICABLE)
-
 COMPONENT_TEST_MASTER = \
         $(COMPONENT_TEST_RESULTS_DIR)/results-cloog.master
 
@@ -153,16 +144,6 @@
      '-e "s/copied $$/copied/g"'  \
      '-e "s/copied [0-9]\{1,\}\./copied/g"'
 
-build: $(BUILD_32_and_64)
-
-install: $(INSTALL_32_and_64)
-
-test: $(TEST_32_and_64)
-
-system-test:	$(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 REQUIRED_PACKAGES += library/gmp
 REQUIRED_PACKAGES += library/mpfr
 REQUIRED_PACKAGES += library/isl
-REQUIRED_PACKAGES += system/library
-
--- a/components/cloog/cloog.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cloog/cloog.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -38,7 +38,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2015/405
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/cloog path=usr/bin/cloog
+file path=usr/bin/cloog
 file path=usr/include/cloog/block.h
 file path=usr/include/cloog/clast.h
 file path=usr/include/cloog/cloog.h
--- a/components/cmake/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cmake/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -17,57 +17,49 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
+#
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
+# Currently only builds with gcc
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cmake
 COMPONENT_VERSION=	3.3.2
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:e75a178d6ebf182b048ebfe6e0657c49f0dc109779170bad7ffcb17463f2fc22
 COMPONENT_ARCHIVE_URL=	http://www.cmake.org/files/v3.3/$(COMPONENT_ARCHIVE)
 COMPONENT_PROJECT_URL=  http://www.cmake.org/
-COMPONENT_BUGDB=	utility/cmake
 
 TPNO=			25030
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+# configure in cmake does not accept many of the options set in
+# configure.mk (CC=, CXX=, --bindir, --libdir, --sbindir).
+CONFIGURE_DEFAULT_DIRS= no
+
+# expected failure for test: CTestTestUpload
+SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 # Remove undesriable /opt/csw lines from the Modules/*.cmake files.
 COMPONENT_PREP_ACTION += \
 	cd $(COMPONENT_SRC)/Modules; $(GNU_GREP) -l '/opt/csw' *.cmake | /usr/bin/xargs -I \{\} $(GSED) -i -e '/^[ ]*\/opt\/csw/d' \{\}
-# Currently only builds with gcc, and since it's C++, we'll just force it to
-# build as C++11 for ABI compatibility.
-COMPILER=gcc
+# Since it's C++, force it to build as C++11 for ABI compatibility.
 CXXFLAGS += -std=c++11
 
 # Need to remove this option from LD_OPTIONS (only affects sparc build);
 # it causes a SegFault failure in kwsys/testSystemInformation
 # when testing on sparc
-LD_MAP_NOEXBSS=
+LD_MAP_NOEXBSS.sparc=
 
 LDFLAGS +=	$($(COMPILER)_NORUNPATH)
 
 # We need these in the environment, although they are already passed
 # as CONFIGURE_OPTIONS; otherwise the correct compilers are not used
-CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"	
 CONFIGURE_ENV +=	MAKE="$(GMAKE)"	
-CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV +=	CXXFLAGS="$(CXXFLAGS)"
-
-# configure in cmake does not accept many of the options set in
-# configure.mk (CC=, CXX=, --bindir, --libdir, --sbindir). Clear those
-# out and just include the default options it does accept.
-CONFIGURE_OPTIONS =
-CONFIGURE_OPTIONS +=	--prefix=$(CONFIGURE_PREFIX)
-CONFIGURE_OPTIONS +=	--mandir=$(CONFIGURE_MANDIR)
 
 # Use system-installed third-party libraries, rather than the private
 # copies in the cmake source.
@@ -85,8 +77,6 @@
 COMPONENT_BUILD_ENV +=	CXXFLAGS="$(CXXFLAGS)"
 COMPONENT_BUILD_TARGETS =	all
 
-ASLR_MODE = $(ASLR_ENABLE)
-
 # Need C and C++ compiler locations for cmake tests
 COMPONENT_TEST_ENV += CC="$(CC)"
 COMPONENT_TEST_ENV += CXX="$(CXX)"
@@ -108,35 +98,20 @@
 COMPONENT_PRE_SYSTEM_TEST_ACTION += \
 	$(MV) $(BUILD_DIR_64)/bin $(BUILD_DIR_64)/bin-save; \
 	$(MKDIR) $(BUILD_DIR_64)/bin; cd $(BUILD_DIR_64)/bin; \
-	$(LN) -s /usr/bin/cmake; $(LN) -s /usr/bin/ctest; \
-	$(LN) -s /usr/bin/ccmake; $(LN) -s /usr/bin/cpack
+	$(LN) -s $(USRBINDIR)/cmake; $(LN) -s /usr/bin/ctest; \
+	$(LN) -s $(USRBINDIR)/ccmake; $(LN) -s /usr/bin/cpack
 
 # Restore the built binaries after system-test is done
 COMPONENT_POST_SYSTEM_TEST_ACTION += \
 	$(RM) -r $(BUILD_DIR_64)/bin; \
 	$(MV) $(BUILD_DIR_64)/bin-save $(BUILD_DIR_64)/bin
 
-
-# common targets
-
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-# expected failure: CTestTestUpload
-test:		$(TEST_64)
-
-system-test:    $(BUILD_64) $(SYSTEM_TEST_64)
-
 REQUIRED_PACKAGES += compress/bzip2
 REQUIRED_PACKAGES += compress/xz
 REQUIRED_PACKAGES += library/expat
 REQUIRED_PACKAGES += library/libarchive
 REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += library/zlib
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/common/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/common/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -29,6 +29,8 @@
 COMPONENT_NAME=		gnu-common
 COMPONENT_VERSION=	0.5.11
 COMPONENT_BUGDB=	gate-stuff/userland
+COMPONENT_SRC=
+COMPONENT_ARCHIVE=
 
 include $(WS_MAKE_RULES)/prep.mk
 
--- a/components/conflict/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/conflict/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,31 +22,29 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-BITS=64
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		conflict
 COMPONENT_VERSION=	20150705
 IPS_COMPONENT_VERSION=	0.2015.7.5
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tgz
 COMPONENT_PROJECT_URL=	http://invisible-island.net/conflict/conflict.html
 COMPONENT_ARCHIVE_HASH=	\
     sha256:30e14808768a938df139a1b76f8f7397e1b3bf46a18ceabcc8b1b1a70d5ea8a9
 COMPONENT_ARCHIVE_URL=	ftp://invisible-island.net/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/conflict
 
 TPNO=			27130
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+# We really do need to build conflict so that it can use the files in the
+# build directory. We are using the installed conflict binary to do this
+# though when we run the system tests.
+SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 # Required to configure correctly.
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D))
-CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 
 COMPONENT_TEST_DIR =	$(BUILD_DIR_64)
 COMPONENT_TEST_CMD =	./run_test.sh
@@ -64,21 +62,3 @@
 COMPONENT_SYSTEM_TEST_ENV =	CONFLICT_BIN=/usr/bin/conflict
 COMPONENT_SYSTEM_TEST_CMD =	./run_test.sh
 COMPONENT_SYSTEM_TEST_TARGETS =
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-# We really do need to build conflict so that it can use the files in the
-# build directory. We are using the installed conflict binary to do this
-# though when we run the system tests.
-system-test:    build $(SYSTEM_TEST_64)
-
-
-REQUIRED_PACKAGES += system/library
--- a/components/convmv/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/convmv/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,24 +22,20 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		convmv
 COMPONENT_VERSION=	2.0
 COMPONENT_PROJECT_URL=	http://www.j3e.de/linux/convmv/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:170cf675be1fca77868ff472e9340ca828b1463865a63d4f4b7b3bf4053db93f
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/convmv
 
 TPNO=			27095
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_STYLE= justmake
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL=0
 
@@ -49,7 +45,7 @@
 
 COMPONENT_TEST_TARGETS=		test
 COMPONENT_SYSTEM_TEST_TARGETS=	test
-COMPONENT_SYSTEM_TEST_ENV=	CONVMV=/usr/bin/convmv
+COMPONENT_SYSTEM_TEST_ENV=	CONVMV=$(USRBINDIR)/convmv
 
 # Adjust the '#!/usr/bin/perl' at the beginning of the convmv script to use
 # '#!/usr/perl5/$(PERL_VERSION)/bin/perl'
@@ -59,12 +55,6 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
 system-test:    $(SYSTEM_TEST_64)
 
 REQUIRED_PACKAGES += $(PERL_PKG)
--- a/components/coreutils/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/coreutils/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,37 +18,34 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		coreutils
 COMPONENT_VERSION=	8.25
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/coreutils/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/coreutils/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	utility/gnu-coreutils
 
 TPNO=			27001
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= install $(TEST_64)
+SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # We need the GNU grep command to configure/build.
-PATH=/usr/gnu/bin:/usr/bin
+PATH=$(GNUBIN):$(USRBINDIR)
 
 PATCH_LEVEL=		0
 
-CONFIGURE_PREFIX	 =	/usr/gnu
-CONFIGURE_OPTIONS	+=	--bindir=/usr/gnu/bin
-CONFIGURE_OPTIONS	+=	--libdir=/usr/lib
+CPPFLAGS += -I$(USRINCDIR)/gmp
+CONFIGURE_PREFIX	 =	$(USRGNUDIR)
 CONFIGURE_OPTIONS	+=	--infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS	+=	CPPFLAGS=-I/usr/include/gmp
-CONFIGURE_OPTIONS	+=	CFLAGS="$(CFLAGS)"
 
 # Recreate configure and Makefile to pick up changes in .../src/local.mk
 COMPONENT_PREP_ACTION = (cd $(@D) ; autoreconf -f && automake)
@@ -59,14 +56,6 @@
 # Always show the build and link lines for easier debugging.
 COMPONENT_BUILD_ARGS +=		V=1
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
 # Needed for "gmake test" to work successfully.
 # If SHELLOPTS is exported (as it is by the userland makefiles),
 # then all shell options get exported to child invocations of bash,
@@ -99,9 +88,4 @@
 COMPONENT_SYSTEM_TEST_ENV +=	PATH=/usr/gnu/bin:/usr/bin
 COMPONENT_SYSTEM_TEST_DIR =	$(@D)/tests
 
-test:		install $(TEST_64)
-
-system-test:    configure $(SYSTEM_TEST_64)
-
 REQUIRED_PACKAGES += library/gmp
-REQUIRED_PACKAGES += system/library
--- a/components/cppunit/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cppunit/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,48 +18,33 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-COMPILER=gcc
-
+COMPILER= gcc
+# Prefer 32-bit as only "binary" delivered is a script with embedded paths.
+BUILD_BITS= 32_and_64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cppunit
 COMPONENT_VERSION=	1.13.2
 COMPONENT_PROJECT_URL=	http://freedesktop.org/wiki/Software/cppunit/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:3f47d246e3346f2ba4d7c9e882db3ad9ebd3fcbd2e8b732f946e0e3eeb9f429f
 COMPONENT_ARCHIVE_URL=	http://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/cppunit
 
 TPNO=			20676
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 
-export PATH=$(GCC_ROOT)/bin:/usr/gnu/bin:/usr/bin
+export PATH=$(GCC_ROOT)/bin:$(GNUBIN):$(USRBINDIR)
 
-CONFIGURE_OPTIONS  +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS  +=	CXXFLAGS="$(CXXFLAGS)"
 CONFIGURE_OPTIONS  +=	--disable-static
 
 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(TEST_32_and_64)
-
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
--- a/components/cups/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cups/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,44 +20,45 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cups
 COMPONENT_VERSION=	1.4.5
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=	http://www.cups.org/
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC)-source.tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:0450d6d8e6e8af225d2a3319c848737d76473a6c7579cf97c52086d0371c0efe
 COMPONENT_ARCHIVE_URL=	http://ftp.easysw.com/pub/cups/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/cups
 
 TPNO=			17705
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-CXX +=	$(studio_NORUNPATH)
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 # don't use LD_Z_IGNORE: causes linker problems
 LD_Z_IGNORE=
 
 # 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=
+# libraries in a single build; avoid confusing it by stripping $(CC_BITS) from
+# all related flag variables.
+CONFIGURE_CPPFLAGS.stripped := $(patsubst -m32,,$(CONFIGURE_CPPFLAGS))
+CONFIGURE_CPPFLAGS= $(CONFIGURE_CPPFLAGS.stripped)
+CFLAGS.stripped := $(patsubst -m32,,$(CFLAGS))
+CFLAGS= $(CFLAGS.stripped)
+CXXFLAGS.stripped := $(patsubst -m32,,$(CXXFLAGS))
+CXXFLAGS= $(CXXFLAGS.stripped)
 
 CONFIGURE_OPTIONS +=	--localedir=$(USRSHARELOCALEDIR)
 CONFIGURE_OPTIONS +=	--sysconfdir=$(ETCDIR)
-CONFIGURE_OPTIONS +=	--localstatedir=/var
+CONFIGURE_OPTIONS +=	--localstatedir=$(VARDIR)
 CONFIGURE_OPTIONS +=	--with-fontpath=/usr/openwin/lib
-CONFIGURE_OPTIONS +=	--with-logdir=/var/log/cups
-CONFIGURE_OPTIONS +=	--with-domainsocket=/var/run/cups-socket
-CONFIGURE_OPTIONS +=	--with-smfmanifestdir=/lib/svc/manifest/application
-CONFIGURE_OPTIONS +=	--with-printcap=/etc/printers.conf
+CONFIGURE_OPTIONS +=	--with-logdir=$(VARDIR)/log/cups
+CONFIGURE_OPTIONS +=	--with-domainsocket=$(VARDIR)/run/cups-socket
+CONFIGURE_OPTIONS +=	--with-smfmanifestdir=$(LIBDIR)/svc/manifest/application
+CONFIGURE_OPTIONS +=	--with-printcap=$(ETCDIR)/printers.conf
 CONFIGURE_OPTIONS +=	--with-cups-user=lp
 CONFIGURE_OPTIONS +=	--with-cups-group=lp
 CONFIGURE_OPTIONS +=	--disable-static
@@ -90,18 +91,6 @@
 	$(TOUCH) $(PROTOETCDIR)/cups/command.types ; \
 	$(MV) $(PROTOUSRLIBDIR)/64 $(PROTOUSRLIBDIR)/$(MACH64)
 
-# common targets
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += driver/parallel/ecpp
 REQUIRED_PACKAGES += image/library/libjpeg
 REQUIRED_PACKAGES += image/library/libpng
@@ -114,7 +103,6 @@
 REQUIRED_PACKAGES += service/security/kerberos-5
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/c++-runtime
 REQUIRED_PACKAGES += system/library/libdbus
 REQUIRED_PACKAGES += system/library/math
--- a/components/curl/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/curl/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,16 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME =        curl
 COMPONENT_VERSION=      7.45.0
-COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=  http://curl.haxx.se/
-COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:02c78c8060d587422e2826f622c729189b56084bba365140f13af3d402b6cb6b
 COMPONENT_ARCHIVE_URL=  $(COMPONENT_PROJECT_URL)download/$(COMPONENT_ARCHIVE)
@@ -34,24 +35,16 @@
 
 TPNO=			25724
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-include $(WS_MAKE_RULES)/lint-libraries.mk
+include $(WS_MAKE_RULES)/common.mk
 
 PATCH_LEVEL = 0
 
-GSSAPI_LIBDIR_32 = /usr/lib
-GSSAPI_LIBDIR_64 = /usr/lib/$(MACH64)
-
 CFLAGS += $(CPP_LARGEFILES)
 CFLAGS += `pkg-config --cflags libidn`
 CPPFLAGS += `pkg-config --cflags libidn`
+CPPFLAGS += "-I/usr/include/openldap"
 
-CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS) -I/usr/include/openldap"
-
-CONFIGURE_OPTIONS += --localstatedir=/var --enable-shared --disable-static
+CONFIGURE_OPTIONS += --localstatedir=$(VARDIR) --enable-shared --disable-static
 CONFIGURE_OPTIONS += --enable-http --enable-ftp
 CONFIGURE_OPTIONS += --enable-file --enable-dict
 CONFIGURE_OPTIONS += --enable-manual --disable-libgcc
@@ -66,11 +59,11 @@
 CONFIGURE_OPTIONS += --enable-ldap --with-random=/dev/urandom
 CONFIGURE_OPTIONS += --with-ssl --with-ldap-lib=ldap_r-2.4
 CONFIGURE_OPTIONS += --with-lber-lib=lber-2.4
-CONFIGURE_OPTIONS += --with-gssapi-includes=/usr/include/gssapi
-CONFIGURE_OPTIONS += --with-gssapi-libs=$(GSSAPI_LIBDIR_$(BITS))
-CONFIGURE_OPTIONS += --with-gssapi=/usr --without-ca-bundle
-CONFIGURE_OPTIONS += --with-ca-path=/etc/openssl/certs
-CONFIGURE_OPTIONS += --with-zlib=/usr --with-libidn=/usr
+CONFIGURE_OPTIONS += --with-gssapi-includes=$(USRINCDIR)/gssapi
+CONFIGURE_OPTIONS += --with-gssapi-libs=$(USRLIB)
+CONFIGURE_OPTIONS += --with-gssapi=$(USRDIR) --without-ca-bundle
+CONFIGURE_OPTIONS += --with-ca-path=$(ETCDIR)/openssl/certs
+CONFIGURE_OPTIONS += --with-zlib=$(USRDIR) --with-libidn=$(USRDIR)
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --with-libssh2
 CONFIGURE_OPTIONS += --without-nghttp2
@@ -104,22 +97,10 @@
 
 ASLR_MODE = $(ASLR_ENABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build: $(BUILD_32_and_64)
-
-install: $(INSTALL_32_and_64)
-
-test: $(TEST_32_and_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
-
 REQUIRED_PACKAGES += library/libidn
 REQUIRED_PACKAGES += library/libssh2
 REQUIRED_PACKAGES += library/openldap
 REQUIRED_PACKAGES += library/security/openssl
 REQUIRED_PACKAGES += library/zlib
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/security/gss
--- a/components/curl/curl.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/curl/curl.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -18,7 +18,9 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
 <transform file path=usr/share/doc/curl/html/(.+)$ -> \
@@ -39,10 +41,10 @@
 set name=org.opensolaris.arc-caseid value=PSARC/2007/165 value=PSARC/2012/252 \
     value=PSARC/2013/303 value=PSARC/2014/332
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file path=usr/bin/$(MACH64)/curl
-file path=usr/bin/$(MACH64)/curl-config
-file usr/bin/$(MACH64)/curl path=usr/bin/curl
-file path=usr/bin/curl-config
+# curl-config contains embedded paths, so swap these around.
+file usr/bin/curl-config path=usr/bin/$(MACH64)/curl-config
+file path=usr/bin/curl
+file usr/bin/$(MACH32)/curl-config path=usr/bin/curl-config
 file path=usr/include/curl/curl.h
 file path=usr/include/curl/curlbuild.h
 file path=usr/include/curl/curlrules.h
--- a/components/cvs/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cvs/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,33 +18,28 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
-
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cvs
 COMPONENT_VERSION=	1.12.13
 COMPONENT_PROJECT_URL=	http://www.nongnu.org/cvs/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:78853613b9a6873a30e1cc2417f738c330e75f887afdaf7b3d0800cb19ca515e
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/non-gnu/cvs/source/feature/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/cvs
 
 TPNO=			6323
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 CFLAGS += -D__ATTRIBUTE_DISABLED
 CONFIGURE_OPTIONS  +=	--with-external-zlib
-CONFIGURE_OPTIONS  +=	CFLAGS="$(CFLAGS)"
-
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
 
 # need gnu grep
 COMPONENT_TEST_ENV += PATH=$(GNUBIN):$(PATH)
@@ -55,7 +50,7 @@
 COMPONENT_SYSTEM_TEST_DIR = $(SOURCE_DIR)/src
 COMPONENT_SYSTEM_TEST_ENV += PATH=$(GNUBIN):$(PATH)
 COMPONENT_SYSTEM_TEST_CMD = ./sanity.sh
-COMPONENT_SYSTEM_TEST_ARGS = /usr/bin/cvs
+COMPONENT_SYSTEM_TEST_ARGS = $(USRBINDIR)/cvs
 COMPONENT_SYSTEM_TEST_TARGETS =
 
 # extract just the final results
@@ -66,16 +61,4 @@
 	'-e "/^[mM]ake/d" ' \
 	'-e "/^cp.*/d" '
 
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:	$(SYSTEM_TEST_64)
-
-
 REQUIRED_PACKAGES += library/zlib
-REQUIRED_PACKAGES += system/library
--- a/components/cvs/cvs.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cvs/cvs.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -18,7 +18,9 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability committed>
@@ -33,7 +35,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2008/128
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/cvs path=usr/bin/cvs
+file path=usr/bin/cvs
 file path=usr/share/man/man1/cvs.1
 file path=usr/share/man/man5/cvs.5
 license cvs.license license=GPLv2
--- a/components/cyrus-sasl/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/cyrus-sasl/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,26 +22,22 @@
 #
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
-PATH=/usr/gnu/bin:$(SPRO_VROOT)/bin:/usr/bin
-
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):/usr/gnu/bin:$(SPRO_VROOT)/bin:/usr/bin
+PATH=$(PARFAIT_TOOLS):$(GNUBIN):$(SPRO_VROOT)/bin:$(USRBINDIR)
+else
+PATH=$(GNUBIN):$(SPRO_VROOT)/bin:$(USRBINDIR)
 endif
 
 COMPONENT_NAME=		cyrus-sasl
-
-
 #
 # If you update the COMPONENT_VERSION, you should make a corresponding change
 # in the dependency at the bottom of the openldap/openldap.p5m file.
 #
 COMPONENT_VERSION=	2.1.26
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_PROJECT_URL= ftp://ftp.cyrusimap.org/cyrus-sasl
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_PROJECT_URL=	ftp://ftp.cyrusimap.org/cyrus-sasl
 COMPONENT_ARCHIVE_HASH=	\
     sha256:8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3
 COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)/$(COMPONENT_ARCHIVE)
@@ -53,43 +49,39 @@
 
 TPNO=			21351
 
-CC += $(CC_BITS)
-
 SASL2.32 = $(USRLIBDIR)/sasl2
 SASL2.64 = $(USRLIBDIR)/sasl2/$(MACH64)
-SASL_CONFDIR = /etc/sasl
+SASL_CONFDIR = $(ETCDIR)/sasl
 PROTO_CONFDIR = $(PROTO_DIR)$(SASL_CONFDIR)
 
-include $(WS_TOP)/make-rules/prep.mk
-CONFIGURE_DEFAULT_DIRS=no
-include $(WS_TOP)/make-rules/configure.mk
-
 # Migrated from ON in S12, including stuff from system/header, so this
 # cannot be installed on an S11 box.
 ifeq ($(BUILD_TYPE), evaluation)
 PUBLISH_STAMP=
 endif
 
-include $(WS_TOP)/make-rules/ips.mk
-include $(WS_TOP)/make-rules/lint-libraries.mk
+INSTALL_TARGET=
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
-CONFIGURE_ENV +=  "CPPFLAGS=$(CPPFLAGS) -I/usr/include/openldap"
-CONFIGURE_OPTIONS += --with-cflags="$(CFLAGS)"
-CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS) -lbsm -lscf -lresolv"
-CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
+# This causes the default compilation argument to be wrong and isn't necessary.
+studio_MT=
+
+CPPFLAGS += -I$(USRINCDIR)/openldap
+LDFLAGS += -lbsm -lscf -lresolv $(CC_BITS)
 CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)
-CONFIGURE_OPTIONS += --enable-auth-sasldb=yes
+CONFIGURE_OPTIONS += --enable-auth-sasldb
 CONFIGURE_OPTIONS += --with-dblib=berkeley
 CONFIGURE_OPTIONS += --with-saslauthd=$(USRSBINDIR)/saslauthd
 CONFIGURE_OPTIONS += --with-gss_impl=seam
-CONFIGURE_OPTIONS += --with-gnu-ld=no
+CONFIGURE_OPTIONS += --without-gnu-ld
 CONFIGURE_OPTIONS.32 += --with-plugindir=$(SASL2.32)
 CONFIGURE_OPTIONS.64 += --with-plugindir=$(SASL2.64)
 CONFIGURE_OPTIONS.32 += --with-sasldir=$(SASL2.32)
 CONFIGURE_OPTIONS.64 += --with-sasldir=$(SASL2.64)
 CONFIGURE_OPTIONS += --with-ipctype=doors
 CONFIGURE_OPTIONS += --with-ldap=$(USRDIR)
-CONFIGURE_OPTIONS += --enable-sample=yes
+CONFIGURE_OPTIONS += --enable-sample
 CONFIGURE_OPTIONS += --with-configdir=$(ETCDIR)/sasl
 
 PKG_PROTO_DIRS += $(SOURCE_DIR)/doc $(COMPONENT_DIR)/Solaris
@@ -120,7 +112,7 @@
 COMPONENT_PREP_ACTION = ( cd $(@D) &&  \
 		( cd config && ln -s $(CFG_COMPILE)/compile . ) ; \
 		( cd saslauthd/config && ln -s $(CFG_COMPILE)/compile . ); \
-		$(AUTORECONF) -d -m --force -v \
+		$(AUTORECONF) -m --force -v \
 		-I $(COMPONENT_DIR)/m4   \
 		-I $(SOURCE_DIR)/cmulocal \
 		-I $(SOURCE_DIR)/config ; \
@@ -140,23 +132,17 @@
 INSTALL_32 +=	$(PROTOUSRLIBDIR)/libsasl.so.1
 INSTALL_64 +=	$(PROTOUSRLIBDIR64)/libsasl.so.1
 
-
 # common targets
-build:		$(BUILD_32_and_64)
-configure:      $(BUILD_DIR_32)/.configured $(BUILD_DIR_64)/.configured
 install:	build $(INSTALL_32_and_64)
-publish:	install
-test:		$(NO_TESTS)
-system-test:	$(SYSTEM_TESTS_NOT_IMPLEMENTED)
 
 $(BUILD_32):  	COMPONENT_POST_BUILD_ACTION = \
     $(LD) -F libsasl2.so.3 -o $(BUILD_DIR)/$(MACH32)/lib/.libs/libsasl.so.1 \
-    -G -hlibsasl.so.1 -Bdirect -z defs -M$(COMPONENT_DIR)/mapfile 
+    -G -hlibsasl.so.1 $(LD_B_DIRECT) $(LD_Z_DEFS) -M$(COMPONENT_DIR)/mapfile 
 
 $(BUILD_64):	COMPONENT_POST_BUILD_ACTION = \
      $(LD) -F libsasl2.so.3 -64 -G \
     -o $(BUILD_DIR)/$(MACH64)/lib/.libs/libsasl.so.1 \
-    -hlibsasl.so.1 -Bdirect -Wl,-zdefs -Wl,-M$(COMPONENT_DIR)/mapfile
+    -hlibsasl.so.1 $(LD_B_DIRECT) -Wl,$(LD_Z_DEFS) -Wl,-M$(COMPONENT_DIR)/mapfile
 
 $(PROTOUSRLIBDIR)/libsasl.so.1:	$(BUILD_DIR)/$(MACH32)/lib/.libs/libsasl.so.1	
 	$(CP) $< $@
@@ -165,11 +151,9 @@
 	$(CP) $< $@
 
 ASLR_MODE = $(ASLR_ENABLE)
-BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
 
 REQUIRED_PACKAGES += database/berkeleydb-5
 REQUIRED_PACKAGES += developer/build/automake-115
 REQUIRED_PACKAGES += library/openldap
 REQUIRED_PACKAGES += library/security/openssl
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/security/gss
--- a/components/daq/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/daq/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,17 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+# Prefer 32-bit as only "binary" delivered is a script with embedded paths.
+BUILD_BITS= 32_and_64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		daq
 COMPONENT_VERSION=	2.0.2
 COMPONENT_PROJECT_URL=	http://www.snort.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:d65d1e67c4994e02c3142c49a648642e780b7e3d942b4a51f605309beac269a8
 COMPONENT_ARCHIVE_URL=	http://sourceforge.net/projects/snort/files/snort/$(COMPONENT_ARCHIVE)/download
@@ -34,38 +36,18 @@
 
 TPNO=			19384
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 # Solaris should really define these. See CR #15431883 and 15537286.
 CFLAGS +=	-Du_int8_t=uint8_t
 CFLAGS +=	-Du_int16_t=uint16_t
 CFLAGS +=	-Du_int32_t=uint32_t
 
-# Set -m32 or -m64 correctly for 32 and 64 bit versions.
-CC +=		$(CC_BITS)
-
 CONFIGURE_OPTIONS +=	--disable-ipfw-module
 CONFIGURE_OPTIONS +=    --enable-static=no
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-
-ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
 
 REQUIRED_PACKAGES += developer/lexer/flex
 REQUIRED_PACKAGES += developer/parser/bison
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/libpcap
--- a/components/dejagnu/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/dejagnu/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,26 +20,20 @@
 #
 
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		dejagnu
 COMPONENT_VERSION=	1.5.3
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/dejagnu/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:099b8e364ca1d6248f8e1d32168c4b12677abff4253bbbb4a8ac8cdd321e3f19
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/dejagnu
 
 TPNO=			22219
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 COMPONENT_TEST_ENV +=	PATH="$(GNUBIN):$(PATH)"
 
@@ -53,16 +47,5 @@
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:    configure $(SYSTEM_TEST_64)
-
 REQUIRED_PACKAGES += shell/expect
 REQUIRED_PACKAGES += shell/ksh93
-
--- a/components/dejagnu/dejagnu.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/dejagnu/dejagnu.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -18,7 +18,9 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
@@ -32,7 +34,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2013/018
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/runtest path=usr/bin/runtest
+file path=usr/bin/runtest
 file path=usr/include/dejagnu.h
 file path=usr/share/dejagnu/baseboards/README
 file path=usr/share/dejagnu/baseboards/am33_2.0-libremote.exp
--- a/components/desktop/firefox/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/firefox/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -121,7 +121,7 @@
 CONFIGURE_ENV +=        CXXFLAGS='-xlibmil -xlibmopt -lCrun -lCstd -features=tmplrefstatic,no%except -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -template=no%extdef'
 # -L.../dist/lib needs to be set otherwise it will report missing libnss3.so, 
 # libssl3.so, etc, while linking.
-CONFIGURE_ENV +=        LDFLAGS="-z ignore -z interpose -B nodirect -L$(BUILD_DIR_32)/dist/lib"
+CONFIGURE_ENV +=        LDFLAGS="$(LD_Z_IGNORE) -z interpose -B nodirect -L$(BUILD_DIR_32)/dist/lib"
 
 
 CONFIGURE_ENV +=	MOZCONFIG=$(MOZCONFIG)
--- a/components/desktop/harfbuzz/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/harfbuzz/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,13 +22,15 @@
 #
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+# Prefer 32-bit over 64-bit for now.
+BUILD_BITS=32_and_64
+# For now, all things built for C++11 require gcc.
+COMPILER= gcc
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		harfbuzz
 COMPONENT_VERSION=	1.0.6
 COMPONENT_PROJECT_URL=	http://www.freedesktop.org/wiki/Software/HarfBuzz/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:f616a7fbdc78a627043f9029000bf08c0c71df59cde4143fc92a014f6a993b26
@@ -37,9 +39,6 @@
 
 TPNO=			25623
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure-32_and_64.mk
-
 # Requires newer version of gobject-introspection from Desktop, available in
 # S12 but not 11.3, so do not publish.
 ifeq ($(BUILD_TYPE), evaluation)
@@ -48,19 +47,14 @@
 PUBLISH_STAMP=
 endif
 
-include $(WS_MAKE_RULES)/common-32_and_64.mk
+include $(WS_MAKE_RULES)/common.mk
 
-# For now, all things built for C++11 require gcc.
-COMPILER = gcc
 CXXFLAGS += -std=c++11
 
 # For components using gobject-introspection, don't cache results in $HOME
 COMPONENT_BUILD_ENV += GI_SCANNER_DISABLE_CACHE=yes
 
 CONFIGURE_ENV += CC="$(CC) $(CC_BITS)"
-CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
-CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
-CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
 # Required by other components.
 CONFIGURE_OPTIONS += --enable-introspection
 # Required by other components.
@@ -72,8 +66,6 @@
 # build the API documentation
 CONFIGURE_OPTIONS += --enable-gtk-doc
 
-CONFIGURE_BINDIR.64 =   $(CONFIGURE_PREFIX)/bin
-
 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
 COMPONENT_TEST_ARGS =   -k -i
 COMPONENT_TEST_TRANSFORMS += \
@@ -86,16 +78,6 @@
         '-e "/XERROR:/p" ' \
         '-e "/ERROR:/p" '
 
-configure:      $(CONFIGURE_32_and_64)
-
-build:          $(BUILD_32_and_64)
-
-install:        $(INSTALL_32_and_64)
-
-test:           $(TEST_32_and_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 REQUIRED_PACKAGES += developer/build/autoconf
 REQUIRED_PACKAGES += developer/build/automake
 REQUIRED_PACKAGES += developer/build/gnu-make
@@ -105,7 +87,6 @@
 REQUIRED_PACKAGES += library/desktop/cairo
 REQUIRED_PACKAGES += library/glib2
 REQUIRED_PACKAGES += library/icu
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/freetype-2
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
--- a/components/desktop/libgtkspell/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/libgtkspell/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,16 +18,16 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gtkspell
 COMPONENT_VERSION=	2.0.16
 COMPONENT_PROJECT_URL=	http://gtkspell.sourceforge.net/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:8fc7dc560167b2cb7193e76aca625a152dc19b0ebf49816b78539cbb90d80d02
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)/download/$(COMPONENT_ARCHIVE)
@@ -35,9 +35,6 @@
 
 TPNO=			11953
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-
 # Was not version-lock'd in Desktop, so cannot be upgraded to.
 ifeq ($(BUILD_TYPE), evaluation)
 BUILD_32_and_64=
@@ -45,10 +42,11 @@
 PUBLISH_STAMP=
 endif
 
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 # Needed to pick up the GNU version of xgettext.
-PATH =		/usr/gnu/bin:/usr/bin
+PATH =		$(GNUBIN):$(USRBINDIR)
 
 COMPONENT_PREP_ACTION = \
 	(cd $(@D) ; \
@@ -59,21 +57,8 @@
 	automake -a -c -f ; \
 	autoconf )
 
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-
 ASLR_MODE =	$(ASLR_ENABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build:          $(BUILD_32_and_64)
-
-install:        $(INSTALL_32_and_64)
-
-test:           $(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
 REQUIRED_PACKAGES += library/desktop/gtk2
 REQUIRED_PACKAGES += library/glib2
 REQUIRED_PACKAGES += library/spell-checking/enchant
-REQUIRED_PACKAGES += system/library
--- a/components/desktop/libotr/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/libotr/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,16 +18,16 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libotr
 COMPONENT_VERSION=	4.1.0
 COMPONENT_PROJECT_URL=	http://www.cypherpunks.ca/otr/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:4fdb891940ec89d300190a98f69a9138248dcb8c8d337633fb981b8d0a9cd930
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
@@ -35,9 +35,6 @@
 
 TPNO=			21688
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-
 # Pidgin is on the do-not-publish list (depends on S12-only changes in ON &
 # Desktop), so no point publishing this without that.
 ifeq ($(BUILD_TYPE), evaluation)
@@ -46,7 +43,8 @@
 PUBLISH_STAMP=
 endif
 
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 CFLAGS +=	-I $(SOURCE_DIR)/src
 
@@ -59,21 +57,6 @@
 	automake -a -c -f ; \
 	autoconf )
 
-CONFIGURE_BINDIR.64 =   $(CONFIGURE_PREFIX)/bin
-
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-
 ASLR_MODE = $(ASLR_ENABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/security/libgcrypt
--- a/components/desktop/libspectre/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/libspectre/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,14 +22,12 @@
 #
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libspectre
 COMPONENT_VERSION=	0.2.6
 COMPONENT_PROJECT_URL=	http://libspectre.freedesktop.org
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
 	sha256:2f637c62322c8040514284c00f63a5c310a28801e7dcfbe2ba2791be4fac0dd3
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)/releases/$(COMPONENT_ARCHIVE)
@@ -37,9 +35,8 @@
 
 TPNO=			7684
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PREP_ACTION = \
 	(cd $(@D) ; \
@@ -49,8 +46,6 @@
 	automake -a -c -f ; \
 	autoconf )
 
-
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS +=	--disable-static
 CONFIGURE_OPTIONS +=	--enable-shared
 CONFIGURE_OPTIONS +=	--with-pic
@@ -60,15 +55,4 @@
 
 ASLR_MODE = $(ASLR_ENABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
 REQUIRED_PACKAGES += print/filter/ghostscript
-REQUIRED_PACKAGES += system/library
--- a/components/desktop/pidgin-otr/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/pidgin-otr/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,16 +18,16 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		pidgin-otr
 COMPONENT_VERSION=	4.0.2
 COMPONENT_PROJECT_URL=	http://www.cypherpunks.ca/otr/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:f4b59eef4a94b1d29dbe0c106dd00cdc630e47f18619fc754e5afbf5724ebac4
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
@@ -35,39 +35,22 @@
 
 TPNO=			27403
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-
 # Pidgin is on the do-not-publish list (depends on S12-only changes in ON &
 # Desktop), so no point publishing this without that.
 ifeq ($(BUILD_TYPE), evaluation)
-BUILD_32_and_64=
-INSTALL_32_and_64=
+BUILD_64=
+INSTALL_64=
 PUBLISH_STAMP=
 endif
 
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 # Need to pick up the GNU version of xgettext.
-PATH=/usr/gnu/bin:/usr/bin
+PATH=$(GNUBIN):$(USRBINDIR)
 
 CFLAGS +=		-DG_IMPLEMENT_INLINES -DG_HAVE_ISO_VARARGS
 
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
 REQUIRED_PACKAGES += communication/im/libotr
 REQUIRED_PACKAGES += communication/im/pidgin
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/security/libgcrypt
--- a/components/desktop/pidgin/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/pidgin/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,26 +18,23 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		pidgin
 COMPONENT_VERSION=	2.10.11
 COMPONENT_PROJECT_URL=	http://www.pidgin.im
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH= \
     sha256:f2ae211341fc77efb9945d40e9932aa535cdf3a6c8993fe7919fca8cc1c04007
 COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/pidgin
 
 TPNO=			21690
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-
 # Cyrus SASL is S12-only (at least for evaluation builds).
 ifeq ($(BUILD_TYPE), evaluation)
 BUILD_64=
@@ -45,11 +42,12 @@
 PUBLISH_STAMP=
 endif
 
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 # Need to pick up the Studio compiler as some Makefiles just use "cc".
 # Need to pick up the GNU version of xgettext.
-PATH=$(dir $(CC)):$(SPRO_VROOT)/bin:/usr/gnu/bin:/usr/bin
+PATH=$(dir $(CC)):$(SPRO_VROOT)/bin:$(GNUBIN):$(USRBINDIR)
 
 CFLAGS +=		-DG_IMPLEMENT_INLINES -DG_HAVE_ISO_VARARGS
 
@@ -66,21 +64,18 @@
 # Needed to get libpurple to link properly.
 LIBS += -lresolv
 CONFIGURE_ENV +=	LIBS="$(LIBS)"
-CONFIGURE_ENV +=	PKG_CONFIG_PATH=/usr/lib/64/pkgconfig/gnutls-3
+CONFIGURE_ENV +=	PKG_CONFIG_PATH=$(PKG_CONFIG_PATH.64)/gnutls-3
 
 # Version of Perl to use.
 PERL_VERSION =  5.20
 
-CONFIGURE_ENV += "ac_cv_path_perlpath=/usr/perl5/$(PERL_VERSION)/bin/perl"
+CONFIGURE_ENV += "ac_cv_path_perlpath=$(USRDIR)/perl5/$(PERL_VERSION)/bin/perl"
 
-CONFIGURE_BINDIR.64 =	$(CONFIGURE_PREFIX)/bin
-
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS +=	--enable-cyrus-sasl
 CONFIGURE_OPTIONS +=	--disable-nss
 CONFIGURE_OPTIONS +=	--enable-gnutls
-CONFIGURE_OPTIONS +=	--with-gnutls-includes=/usr/include/gnutls-3
-CONFIGURE_OPTIONS +=	--with-gnutls-libs=/usr/lib/64/gnutls-3
+CONFIGURE_OPTIONS +=	--with-gnutls-includes=$(USRINCDIR)/gnutls-3
+CONFIGURE_OPTIONS +=	--with-gnutls-libs=$(USRLIBDIR64)/gnutls-3
 CONFIGURE_OPTIONS +=	--enable-gnome-keyring
 CONFIGURE_OPTIONS +=	--disable-gevolution
 CONFIGURE_OPTIONS +=	--enable-cap
@@ -92,18 +87,6 @@
 # Always show the build and link lines for easier debugging.
 COMPONENT_BUILD_ARGS +=	V=1
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:          $(BUILD_64)
-
-install:        $(INSTALL_64)
-
-test:           $(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
 REQUIRED_PACKAGES += database/sqlite-3
 REQUIRED_PACKAGES += library/audio/gstreamer
 REQUIRED_PACKAGES += library/desktop/atk
@@ -123,7 +106,6 @@
 REQUIRED_PACKAGES += runtime/tcl-8
 REQUIRED_PACKAGES += runtime/tk-8
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/libdbus
 REQUIRED_PACKAGES += system/library/libdbus-glib
 REQUIRED_PACKAGES += system/library/math
--- a/components/desktop/poppler/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/poppler/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,14 +22,12 @@
 #
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		poppler
 COMPONENT_VERSION=	0.14.4
 COMPONENT_PROJECT_URL=	http://poppler.freedesktop.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:97c394144802e733eaec2682e06bddc4939c71ede58df045127aa94bd244c713
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE)
@@ -45,9 +43,8 @@
 COMPONENT_ARCHIVE_URL_1= $(COMPONENT_PROJECT_URL)$(COMPONENT_ARCHIVE_1)
 TPNO_POPPLER_DATA=	7744
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PREP_ACTION = \
 	(cd $(@D) ; \
@@ -59,10 +56,6 @@
 
 CXX +=			$(studio_NORUNPATH)
 
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS +=	CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_OPTIONS +=    LDFLAGS="$(LDFLAGS)"
-
 # Reduce build time dependencies since we don't ship this and can't run as an
 # automated test.
 CONFIGURE_OPTIONS +=	--disable-gtk-test
@@ -83,16 +76,6 @@
 
 ASLR_MODE = $(ASLR_ENABLE)
 
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
-system-test:	$(NO_TESTS)
-
 REQUIRED_PACKAGES += image/library/libjpeg
 REQUIRED_PACKAGES += image/library/libpng
 REQUIRED_PACKAGES += library/desktop/cairo
@@ -102,7 +85,6 @@
 REQUIRED_PACKAGES += library/lcms
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += library/zlib
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/c++-runtime
 REQUIRED_PACKAGES += system/library/fontconfig
 REQUIRED_PACKAGES += system/library/freetype-2
--- a/components/desktop/poppler/poppler.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/poppler/poppler.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -39,13 +39,13 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2012/051 value=PSARC/2016/025
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/pdffonts path=usr/bin/pdffonts
-file usr/bin/$(MACH64)/pdfimages path=usr/bin/pdfimages
-file usr/bin/$(MACH64)/pdfinfo path=usr/bin/pdfinfo
-file usr/bin/$(MACH64)/pdftohtml path=usr/bin/pdftohtml
-file usr/bin/$(MACH64)/pdftoppm path=usr/bin/pdftoppm
-file usr/bin/$(MACH64)/pdftops path=usr/bin/pdftops
-file usr/bin/$(MACH64)/pdftotext path=usr/bin/pdftotext
+file path=usr/bin/pdffonts
+file path=usr/bin/pdfimages
+file path=usr/bin/pdfinfo
+file path=usr/bin/pdftohtml
+file path=usr/bin/pdftoppm
+file path=usr/bin/pdftops
+file path=usr/bin/pdftotext
 file path=usr/include/poppler/Annot.h
 file path=usr/include/poppler/Array.h
 file path=usr/include/poppler/BuiltinFont.h
--- a/components/desktop/thunderbird/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/thunderbird/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -138,7 +138,7 @@
 CONFIGURE_ENV +=	OS_DEFINES="-D__USE_LEGACY_PROTOTYPES__"
 # -L.../dist/bin needs to be set otherwise it will report missing libnss3.so, 
 # libssl3.so, etc, while linking.
-CONFIGURE_ENV +=	LDFLAGS="-z ignore -z interpose -B nodirect -L$(BUILD_DIR_32)/dist/lib"
+CONFIGURE_ENV +=	LDFLAGS="$(LD_Z_IGNORE) -z interpose -B nodirect -L$(BUILD_DIR_32)/dist/lib"
 
 CONFIGURE_ENV +=	MOZCONFIG=$(MOZCONFIG)
 CONFIGURE_ENV +=	"CC=$(CC)"
--- a/components/desktop/xscreensaver/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/desktop/xscreensaver/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,14 +22,16 @@
 #
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS=64
+# While the tree currently builds with Studio, we need to make sure it also
+# builds with gcc when submitting patches upstream, and having both sets of
+# options in the CFLAGS below makes it easy to switch when needed.
+# COMPILER=gcc
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		xscreensaver
 COMPONENT_VERSION=	5.34
 COMPONENT_PROJECT_URL=	https://www.jwz.org/xscreensaver/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:6fff7ec4be743e5c042647ea9687dd0cdf48d1dd5e8e15098e5018bbd02e5e27
 COMPONENT_ARCHIVE_URL=	https://www.jwz.org/xscreensaver/$(COMPONENT_ARCHIVE)
@@ -37,15 +39,8 @@
 
 TPNO=			26341
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure-64.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-# While the tree currently builds with Studio, we need to make sure it also
-# builds with gcc when submitting patches upstream, and having both sets of
-# options in the CFLAGS below makes it easy to switch when needed.
-# COMPILER=gcc
-CC += $(CC_BITS)
+TEST_TARGET = $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 # Enable additional warnings, since we've modified this code a lot
 CFLAGS.studio += -v
@@ -57,11 +52,19 @@
 CFLAGS.studio += -fsimple=2 -nofstore -xlibmil -xprefetch
 CFLAGS.gcc    += -funsafe-math-optimizations
 
-# Regenerate configure after patches modify configure.in
-COMPONENT_PREP_ACTION += ( cd $(@D); autoreconf -fiv);
+# Fix 64-bit linking; compiler is used for the linking.
+LDFLAGS += $(CC_BITS)
+
+# Regenerate configure after patches modify configure.in; the automake -af
+# forces the update of the standard automake files that autoreconf will not
+# update because Makefile.am does not exist.  This is needed to ensure we have
+# a recent version of config.guess, etc. used for configure; the | true is
+# because automake will exit with an error because Makefile.am does not exist,
+# but it will update the required files.
+COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv; automake -af | true)
 
 # Need to pick up the GNU version of xgettext.
-PATH=$(GNUBIN):/usr/bin
+PATH=$(GNUBIN):$(USRBINDIR)
 
 # Libraries & programs to depend on
 CONFIGURE_OPTIONS += --with-gl=$(USRDIR)
@@ -95,7 +98,6 @@
 # Paths to install to
 APP_DEFAULTS_DIR  = $(CONFIGURE_PREFIX)/share/X11/app-defaults
 XSS_LIBDIR 	  = $(CONFIGURE_PREFIX)/lib/xscreensaver
-CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.32)
 CONFIGURE_OPTIONS += --libexecdir=$(XSS_LIBDIR)/bin
 CONFIGURE_OPTIONS += --with-hackdir=$(XSS_LIBDIR)/hacks
 CONFIGURE_OPTIONS += --with-configdir=$(XSS_LIBDIR)/config/control-center-2.0
@@ -135,15 +137,6 @@
 rm -f $(PROTO_DIR)$(XSS_LIBDIR)/hacks/webcollage-helper );
 
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:      $(CONFIGURE_64)
-build:          $(BUILD_64)
-install:        $(INSTALL_64)
-test:           $(NO_TESTS)
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += gnome/accessibility/gnome-a11y-libs
 REQUIRED_PACKAGES += gnome/config/gconf
 REQUIRED_PACKAGES += image/library/libjpeg
@@ -157,7 +150,6 @@
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += library/perl-5/xml-parser
 REQUIRED_PACKAGES += runtime/perl-512
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
 REQUIRED_PACKAGES += x11/library/libx11
 REQUIRED_PACKAGES += x11/library/libxext
--- a/components/diffstat/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/diffstat/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,14 +18,16 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		diffstat
 COMPONENT_VERSION=	1.61
 COMPONENT_PROJECT_URL=	http://invisible-island.net/diffstat/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tgz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:25359e0c27183f997b36c9202583b5dc2df390c20e22a92606af4bf7856a55ee
@@ -34,11 +36,11 @@
 
 TPNO=			27077
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
-CC += $(CC_BITS)
+# Fix 64-bit linking done via compiler.
+LDFLAGS += $(CC_BITS)
 
 COMPONENT_TEST_TRANSFORMS += \
 	'-e "/^Checking/d" '
@@ -50,21 +52,7 @@
 COMPONENT_TEST_TARGETS =
 
 COMPONENT_SYSTEM_TEST_DIR =	$(SOURCE_DIR)
-COMPONENT_SYSTEM_TEST_ENV =	PATH=/usr/bin:$(SOURCE_DIR):$(PATH)
+COMPONENT_SYSTEM_TEST_ENV =	PATH=$(USRBINDIR):$(SOURCE_DIR):$(PATH)
 COMPONENT_SYSTEM_TEST_CMD =	./testing/run_test.sh
 COMPONENT_SYSTEM_TEST_ARGS =	./testing/case*.pat
 COMPONENT_SYSTEM_TEST_TARGETS =
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:    $(SYSTEM_TEST_64)
-
-REQUIRED_PACKAGES += system/library
--- a/components/diffstat/diffstat.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/diffstat/diffstat.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -38,6 +38,6 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2008/114
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/diffstat path=usr/bin/diffstat
+file path=usr/bin/diffstat
 file path=usr/share/man/man1/diffstat.1
 license diffstat.license license=MIT
--- a/components/diffutils/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/diffutils/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,31 +22,27 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
-COMPILER=		gcc
-
+BUILD_BITS= 64
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		diffutils
 COMPONENT_VERSION=	3.3
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/diffutils/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/diffutils/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	utility/gnu-diffutils
 
 TPNO=			21995
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 COMPONENT_PREP_ACTION =		(cd $(@D) ; autoreconf -f)
 
+CONFIGURE_PREFIX= $(USRGNUDIR)
 CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
+CONFIGURE_OPTIONS  +=		--localedir=$(USRSHARELOCALEDIR)
 
 # Needed for "gmake test" to work successfully.
 # If SHELLOPTS is exported (as it is by the userland makefiles),
@@ -68,18 +64,5 @@
 COMPONENT_SYSTEM_TEST_DIR =	$(@D)/tests
 COMPONENT_SYSTEM_TEST_ENV +=	PATH="$(GNUBIN):$(PATH)"
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:    configure $(SYSTEM_TEST_64)
-
-
 REQUIRED_PACKAGES += library/libsigsegv
 REQUIRED_PACKAGES += system/library
--- a/components/diffutils/diffutils.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/diffutils/diffutils.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -40,14 +40,14 @@
 link path=usr/bin/gdiff target=../gnu/bin/diff facet.compat.gnulinks=true
 link path=usr/bin/gdiff3 target=../gnu/bin/diff3 facet.compat.gnulinks=true
 link path=usr/bin/gsdiff target=../gnu/bin/sdiff facet.compat.gnulinks=true
-file usr/bin/$(MACH64)/cmp path=usr/gnu/bin/cmp
-file usr/bin/$(MACH64)/diff path=usr/gnu/bin/diff
-file usr/bin/$(MACH64)/diff3 path=usr/gnu/bin/diff3
-file usr/bin/$(MACH64)/sdiff path=usr/gnu/bin/sdiff
-file usr/share/man/man1/cmp.1 path=usr/gnu/share/man/man1/cmp.1
-file usr/share/man/man1/diff.1 path=usr/gnu/share/man/man1/diff.1
-file usr/share/man/man1/diff3.1 path=usr/gnu/share/man/man1/diff3.1
-file usr/share/man/man1/sdiff.1 path=usr/gnu/share/man/man1/sdiff.1
+file path=usr/gnu/bin/cmp
+file path=usr/gnu/bin/diff
+file path=usr/gnu/bin/diff3
+file path=usr/gnu/bin/sdiff
+file path=usr/gnu/share/man/man1/cmp.1
+file path=usr/gnu/share/man/man1/diff.1
+file path=usr/gnu/share/man/man1/diff3.1
+file path=usr/gnu/share/man/man1/sdiff.1
 file path=usr/share/info/diffutils.info
 file path=usr/share/locale/ca/LC_MESSAGES/diffutils.mo
 file path=usr/share/locale/cs/LC_MESSAGES/diffutils.mo
--- a/components/dnsmasq/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/dnsmasq/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,13 +20,13 @@
 #
 
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 # i18n component requires GNU xgettext
-PATH=/usr/gnu/bin:/usr/bin:/usr/sbin
+PATH=$(GNUBIN):$(USRBINDIR):$(USRSBINDIR)
 
 COMPONENT_NAME=		dnsmasq
 COMPONENT_VERSION=	2.68
@@ -40,33 +40,19 @@
 
 TPNO=			16307
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-# Enable ASLR for this component
-ASLR_MODE = $(ASLR_ENABLE)
+BUILD_STYLE= justmake
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_BUILD_ENV += CC="$(CC)"
 COMPONENT_BUILD_ARGS += CC="$(CC)"
 COMPONENT_BUILD_ARGS += CFLAGS="$(CFLAGS)"
-COMPONENT_BUILD_ARGS += PREFIX="/usr"
-COMPONENT_BUILD_ARGS += LOCALEDIR="/usr/share/locale"
-COMPONENT_BUILD_ARGS += LDFLAGS="$(LDFLAGS) -m64"
+COMPONENT_BUILD_ARGS += LOCALEDIR="$(USRSHARELOCALEDIR)"
+COMPONENT_BUILD_ARGS += LDFLAGS="$(LDFLAGS) $(CC_BITS)"
 COMPONENT_BUILD_TARGETS = "all-i18n"
-COMPONENT_INSTALL_ARGS += PREFIX="/usr"
+COMPONENT_INSTALL_ARGS += PREFIX="$(USRDIR)"
+COMPONENT_INSTALL_ARGS += BINDIR="$(USRLIBDIR)/inet"
 COMPONENT_INSTALL_TARGETS = "install-i18n"
 
-# common targets
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += library/libidn
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
--- a/components/dnsmasq/dnsmasq.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/dnsmasq/dnsmasq.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -43,7 +43,7 @@
     path=etc/security/prof_attr.d/service:network:dnsmasq group=sys
 file files/dnsmasq.xml path=lib/svc/manifest/network/dnsmasq.xml
 file path=usr/lib/inet/dhcp_release
-file usr/sbin/dnsmasq path=usr/lib/inet/dnsmasq
+file path=usr/lib/inet/dnsmasq
 file path=usr/share/locale/de/LC_MESSAGES/dnsmasq.mo
 file path=usr/share/locale/es/LC_MESSAGES/dnsmasq.mo
 file path=usr/share/locale/fi/LC_MESSAGES/dnsmasq.mo
--- a/components/doxygen/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/doxygen/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,20 +18,21 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-BITS=64
+BUILD_BITS= 64
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		doxygen
 COMPONENT_VERSION=	1.8.11
 COMPONENT_PROJECT_URL=	http://www.stack.nl/~dimitri/doxygen/index.html
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).src.tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:65d08b46e48bd97186aef562dc366681045b119e00f83c5b61d05d37ea154049
 COMPONENT_ARCHIVE_URL=	http://ftp.stack.nl/pub/users/dimitri/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/doxygen
 
 # Download the manual so that we don't have to keep updating it in the gate.
 COMPONENT_ARCHIVE_1 =	$(COMPONENT_NAME)_manual-$(COMPONENT_VERSION).pdf.zip
@@ -41,16 +42,15 @@
 
 TPNO=			27457
 
-include $(WS_MAKE_RULES)/cmake.mk
-include $(WS_MAKE_RULES)/common-64.mk
-
-# Necessary to find the right gcc during build
-PATH=$(GCC_ROOT)/bin:/usr/bin
-
-COMPILER =		gcc
+BUILD_STYLE= cmake
+SYSTEM_TEST_TARGET= $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
-PATH=$(PARFAIT_TOOLS):$(GCC_ROOT)/bin:/usr/bin
+PATH=$(PARFAIT_TOOLS):$(GCC_ROOT)/bin:$(USRBINDIR)
+else
+# Necessary to find the right gcc during build
+PATH=$(GCC_ROOT)/bin:$(USRBINDIR)
 endif
 
 
@@ -90,15 +90,11 @@
 COMPONENT_SYSTEM_TEST_ARGS =	runtests.pl --doxygen /usr/bin/doxygen
 COMPONENT_SYSTEM_TEST_TARGETS =
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-install:	$(INSTALL_64)
+COMPONENT_POST_INSTALL_ACTION += \
 	cd $(PROTO_DIR) ; $(UNPACK) ../../../$(COMPONENT_ARCHIVE_1)
 
-
 REQUIRED_PACKAGES += developer/lexer/flex
 REQUIRED_PACKAGES += developer/parser/bison
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/ejabberd/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/ejabberd/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,18 +20,17 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 # for ginstall and tail -n
-PATH=/usr/gnu/bin:/usr/bin
+PATH=$(GNUBIN):$(USRBINDIR)
 
 COMPONENT_NAME=		ejabberd
 COMPONENT_VERSION=	2.1.13
 COMPONENT_PROJECT_URL=	http://www.ejabberd.im/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tgz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:a80d1c72e435da31758261cb0c04fe750ac71fc3e33a3b606123efd3b3abc86d
@@ -39,51 +38,29 @@
 COMPONENT_BUGDB=	service/ejabberd
 TPNO=                   21408
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+BUILD_DIR_64= $(BUILD_DIR)/$(MACH64)/src
+CONFIGURE_SCRIPT= $(SOURCE_DIR)/src/configure
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PREP_ACTION = \
 	(cd $(@D)/src ; PATH=$(PATH) $(AUTORECONF) -fiv)
 
-CONFIGURE_SCRIPT = $(SOURCE_DIR)/src/configure
-BUILD_DIR_64 =	$(BUILD_DIR)/$(MACH64)/src
-$(BUILD_DIR_64)/.configured:	BITS=64
-$(BUILD_DIR_64)/.built:		BITS=64
-$(BUILD_DIR_64)/.installed:	BITS=64
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(BUILD_DIR)/$(MACH64))
 
-CONFIGURE_BINDIR.64 = $(CONFIGURE_BINDIR.32)
-CONFIGURE_SBINDIR.64 = $(CONFIGURE_SBINDIR.32)
-
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS +=	LDFLAGS="$(LDFLAGS)"
 CONFIGURE_OPTIONS +=	--sysconfdir=$(ETCDIR)
 CONFIGURE_OPTIONS +=	--with-erlang=$(USRBINDIR)
-CONFIGURE_OPTIONS +=	--localstatedir=/var
+CONFIGURE_OPTIONS +=	--localstatedir=$(VARDIR)
 CONFIGURE_OPTIONS +=	--enable-odbc
 
 COMPONENT_BUILD_TARGETS = all
 
-
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
-configure:	$(CONFIGURE_64)
-
-build:	$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += library/expat
 REQUIRED_PACKAGES += library/security/openssl
 REQUIRED_PACKAGES += library/zlib
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/network
--- a/components/elinks/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/elinks/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,29 +18,27 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
 # Because the Studio compiler generates thousands of lines of warnings.
-COMPILER=gcc
-
+COMPILER= gcc
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		elinks
 COMPONENT_VERSION=	0.11.7
 COMPONENT_PROJECT_URL=	http://elinks.or.cz/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:456db6f704c591b1298b0cd80105f459ff8a1fc07a0ec1156a36c4da6f898979
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)download/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/elinks
 
 TPNO=			8340
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
 # Always show the build and link lines for easier debugging.
 COMPONENT_BUILD_ARGS +=		V=1
@@ -53,7 +51,6 @@
 CONFIGURE_OPTIONS  +=		--enable-bittorrent
 CONFIGURE_OPTIONS  +=		--enable-html-highlight
 CONFIGURE_OPTIONS  +=		--enable-256-colors
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
 
 # Use the HTML and CSS styling external test suite as referenced at
 # http://www.w3.org/2005/MWI/Tests/
@@ -74,23 +71,8 @@
 	http://www.cameronmoll.com/mobile/mkp/pg4.html
 COMPONENT_SYSTEM_TEST_TARGETS =
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-# common targets
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:    $(SYSTEM_TEST_64)
-
-
 REQUIRED_PACKAGES += compress/bzip2
 REQUIRED_PACKAGES += library/expat
 REQUIRED_PACKAGES += library/security/openssl
 REQUIRED_PACKAGES += library/zlib
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += x11/library/libx11
--- a/components/elinks/elinks.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/elinks/elinks.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -18,7 +18,9 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
+#
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 <transform file path=usr/share/doc/elinks/(.+$) -> set action.hash doc/%<1> >
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
@@ -36,7 +38,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=LSARC/2009/028
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/elinks path=usr/bin/elinks
+file path=usr/bin/elinks
 file path=usr/share/doc/elinks/bittorrent.txt
 file path=usr/share/doc/elinks/bookmarks.txt
 file path=usr/share/doc/elinks/color-model.txt
--- a/components/emacs/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/emacs/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,29 +18,27 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
 # As Solaris always has a 64-bit kernel, and 64-bit emacs can handle larger
 # files, we only build and deliver 64-bit binaries. 
-BITS=64
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		emacs
 COMPONENT_VERSION=	24.5
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/emacs/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:2737a6622fb2d9982e9c47fb6f2fb297bda42674e09db40fc9bcc0db4297c3b6
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/emacs
 
 TPNO=			23457
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+INSTALL_TARGET=
+# The upstream emacs distribution does not have tests to be run
+# from this target.
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # We patch the configure.ac file. Get the new configure generated during prep.
 COMPONENT_PREP_ACTION = (cd $(@D) ; aclocal -I m4; autoconf )
@@ -72,12 +70,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
+CONFIGURE_ENV +=	PKG_CONFIG_PATH=$(PKG_CONFIG_PATH.64)/gnutls-3
 
 # Never use xmkmf to find X11 libraries from autoconf. They are all available
 # from standard system locations, and we don't want the ld -L option that
@@ -215,18 +210,8 @@
 	$(PROTO_DIR)/usr/share/man/man1/*.gz ;
 
 # common targets
-configure:	$(CONFIGURE_64)
-
-build:          $(BUILD_64)
-
 install:	$(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed 
 
-# The upstream emacs distribution does not have tests to be run
-# from this target.
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
 # Desktop packages differ slightly between S11 & S12: list union to allow
 # for BUILD_TYPE=evaluation and normal builds.
 REQUIRED_PACKAGES += editor/gnu-emacs
@@ -251,7 +236,6 @@
 REQUIRED_PACKAGES += runtime/perl-512
 REQUIRED_PACKAGES += runtime/perl-520
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/fontconfig
 REQUIRED_PACKAGES += system/library/freetype-2
 REQUIRED_PACKAGES += system/library/math
--- a/components/enscript/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/enscript/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,20 +20,15 @@
 #
 
 #
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		enscript
 COMPONENT_VERSION=	1.6.4
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/enscript
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:45299a4db47c9c08c3649d4f62b211ae79ef5143360c264a40371a728f6ad99b
-COMPONENT_ARCHIVE_URL=  http://ftp.gnu.org/gnu/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/enscript
 
 # Ruby enscript support
 COMPONENT_ARCHIVE_1=    ruby-enscript.tar.gz
@@ -49,11 +44,7 @@
 
 TPNO=			4380
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-PATCH_LEVEL = 1
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # Get just the ruby enscript support file out of the downloaded tarball, and
 # move ruby.st and php.st into the correct directory for "gmake install".
@@ -68,30 +59,16 @@
 				   autoreconf -fiv);
 
 # Needed so that enscript can find the enscript.cfg file.
-CONFIGURE_OPTIONS +=    --sysconfdir=/etc
+CONFIGURE_OPTIONS +=    --sysconfdir=$(ETCDIR)
 
 CONFIGURE_OPTIONS +=	--with-media=Letter
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS +=	LDFLAGS="$(LDFLAGS)"
 
 COMPONENT_POST_INSTALL_ACTION = \
-	$(LN) $(PROTOUSRBINDIR)/$(MACH64)/enscript \
-		$(PROTOUSRBINDIR)/$(MACH64)/nenscript
-
-# common targets
-configure:	$(CONFIGURE_64)
-
-build:          $(BUILD_64)
-
-install:        $(INSTALL_64)
-
-test:           $(TEST_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+	$(LN) $(PROTOUSRBINDIR)/enscript \
+		$(PROTOUSRBINDIR)/nenscript
 
 
 REQUIRED_PACKAGES += runtime/perl-512
 REQUIRED_PACKAGES += runtime/perl-520
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/enscript/enscript.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/enscript/enscript.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -36,13 +36,13 @@
 set name=org.opensolaris.arc-caseid value=PSARC/2010/337
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
 file path=etc/enscript.cfg
-file usr/bin/$(MACH64)/diffpp path=usr/bin/diffpp
-file usr/bin/$(MACH64)/enscript path=usr/bin/enscript
-file usr/bin/$(MACH64)/mkafmmap path=usr/bin/mkafmmap
-file usr/bin/$(MACH64)/nenscript path=usr/bin/nenscript
-file usr/bin/$(MACH64)/over path=usr/bin/over
-file usr/bin/$(MACH64)/sliceprint path=usr/bin/sliceprint
-file usr/bin/$(MACH64)/states path=usr/bin/states
+file path=usr/bin/diffpp
+file path=usr/bin/enscript
+file path=usr/bin/mkafmmap
+file path=usr/bin/nenscript
+file path=usr/bin/over
+file path=usr/bin/sliceprint
+file path=usr/bin/states
 file docs/FAQ.html path=usr/share/doc/enscript/docs/FAQ.html facet.doc.html=true
 file path=usr/share/enscript/88591.enc
 file path=usr/share/enscript/885910.enc
--- a/components/erlang/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/erlang/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,24 +22,21 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
 # Built in SFW with gcc and builds cleanly now only with gcc
-COMPILER =	gcc
-
+BUILD_BITS= 64
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
-PATH=$(JAVA_HOME)/bin:/usr/bin
+PATH=$(JAVA_HOME)/bin:$(USRBINDIR)
 
 COMPONENT_NAME=			erlang
 COMPONENT_VERSION=		17.5
 COMPONENT_PROJECT_URL=	http://www.erlang.org/
 COMPONENT_SRC_NAME=	otp_src
 COMPONENT_SRC=		$(COMPONENT_SRC_NAME)_$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:3c28820c981b30c50df8ac2a4a238e5813454fa3ed2ad530bc7948a282846474
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)download/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/erlang
 
 # manpages
 COMPONENT_NAME_1=	otp_doc_man
@@ -63,12 +60,13 @@
 
 TPNO=			18548
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/common.mk
 
-CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS) -I/usr/include/gd2"
+# Fix 64-bit linking.
+LDFLAGS += $(CC_BITS)
+
+CPPFLAGS += "-I/usr/include/gd2"
 CONFIGURE_OPTIONS += --enable-smp-support
 CONFIGURE_OPTIONS += --enable-threads
 # The HiPE portion is a bit sensitive, and only seems to work 64-bit on
@@ -78,11 +76,6 @@
 CONFIGURE_OPTIONS += --with-ssl
 CONFIGURE_OPTIONS += --enable-dynamic-ssl-lib
 
-CONFIGURE_BINDIR.64 =   $(CONFIGURE_PREFIX)/bin
-
-CONFIGURE_OPTIONS.64 += LDFLAGS="$(LDFLAGS) -m64"
-CONFIGURE_OPTIONS.64 += LIBS="-m64"
-
 # Use cp(1) instead of cloney because erlang's 'install' target uses 'tar'
 # to copy files and our tar doesn't handle long links by default.  Between
 # the use of 'tar' and 'ld', a path adjustment wasn't an option due to the
@@ -105,29 +98,18 @@
 	'-e "s|/ldisk/tests|XXX_UID_XXX|g" ' \
 	'-e "/XXX_UID_XXX/d" '
 
-COMPONENT_SYSTEM_TEST_ENV +=		ERL_TOP=$(BUILD_DIR_64)
+COMPONENT_SYSTEM_TEST_ENV +=	ERL_TOP=$(BUILD_DIR_64)
 COMPONENT_SYSTEM_TEST_TARGETS =	tests
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:	$(BUILD_64)
-
-install:	$(INSTALL_64)
-	# remove INSTALL_PREFIX from path
+# remove INSTALL_PREFIX from path
+COMPONENT_POST_INSTALL_ACTION += \
 	$(PERL) -pi -e "s|$(PROTO_DIR)||g" \
-		$(PROTO_DIR)/usr/lib/$(MACH64)/erlang/bin/erl \
-		$(PROTO_DIR)/usr/lib/$(MACH64)/erlang/releases/RELEASES
-
-test:	$(TEST_64)
-
-system-test:	configure $(SYSTEM_TEST_64)
+		$(PROTOUSRLIBDIR64)/erlang/bin/erl \
+		$(PROTOUSRLIBDIR64)/erlang/releases/RELEASES
 
 REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += library/security/openssl
 REQUIRED_PACKAGES += library/zlib
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/fastcgi/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/fastcgi/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,15 +22,14 @@
 #
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+# Prefer 32-bit as default fastcgi target matters.
+BUILD_BITS= 32_and_64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		fastcgi
 COMPONENT_VERSION=	2.4.0
 COMPONENT_PROJECT_URL=	http://www.fastcgi.com/
 COMPONENT_SRC_NAME=	fcgi
-COMPONENT_SRC=		$(COMPONENT_SRC_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:66fc45c6b36a21bf2fbbb68e90f780cc21a9da1fffbae75e76d2b4402d3f05b9
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)dist/$(COMPONENT_ARCHIVE)
@@ -38,33 +37,14 @@
 
 TPNO=			8415
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-include $(WS_MAKE_RULES)/lint-libraries.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
-CONFIGURE_OPTIONS += --bindir=/usr/bin
+CONFIGURE_OPTIONS += --bindir=$(USRBINDIR)
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --includedir=$(CONFIGURE_INCLUDEDIR)/fastcgi
-CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS += CXXFLAGS="$(CFLAGS) $(studio_XREGS)"
-
-CXX += $(studio_NORUNPATH)
 
 COMPONENT_PREP_ACTION = (cd $(@D) ; touch NEWS AUTHORS ChangeLog ; autoreconf -if)
 
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:     $(BUILD_32_and_64)
-
-install:        $(INSTALL_32_and_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/c++-runtime
--- a/components/fetchmail/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/fetchmail/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,35 +20,28 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		fetchmail
 COMPONENT_VERSION=	6.3.22
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:09093168552119e962617f86f2713564cf6e3fe7fd32d6799aa0b87df28f1e89
 COMPONENT_ARCHIVE_URL=	http://download.berlios.de/fetchmail/$(COMPONENT_ARCHIVE)
 COMPONENT_PROJECT_URL=	http://fetchmail.berlios.de/
-COMPONENT_BUGDB=	utility/fetchmail
 
 TPNO=			8416
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS  +=		PYTHON="$(PYTHON.2.7.32)"
 CONFIGURE_OPTIONS  +=		--with-kerberos5
 CONFIGURE_OPTIONS  +=		--with-ssl
 CONFIGURE_OPTIONS  +=		--enable-NTLM
 
-ASLR_MODE = $(ASLR_ENABLE)
-
 # Change the shebang line to use Python 2.7 explicitly, and drop the
 # fixed file into /usr/bin, where our package manifest expects it.
 COMPONENT_POST_INSTALL_ACTION = \
@@ -60,19 +53,8 @@
 	'-e "s|^.*$(CC).*$$|XXX_CC_XXX|"' \
 	'-e "/^XXX_CC_XXX$$/d"'
 
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 REQUIRED_PACKAGES += library/python/tkinter-27
 REQUIRED_PACKAGES += library/security/openssl
 REQUIRED_PACKAGES += runtime/python-27
 REQUIRED_PACKAGES += service/security/kerberos-5
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
--- a/components/fetchmail/fetchmail.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/fetchmail/fetchmail.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -36,7 +36,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2008/135
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/fetchmail path=usr/bin/fetchmail
+file path=usr/bin/fetchmail
 file path=usr/bin/fetchmailconf
 file path=usr/share/locale/ca/LC_MESSAGES/fetchmail.mo
 file path=usr/share/locale/cs/LC_MESSAGES/fetchmail.mo
--- a/components/findutils/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/findutils/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -22,14 +22,11 @@
 #
 # Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		findutils
 COMPONENT_VERSION=	4.6.0
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/findutils/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
@@ -37,13 +34,9 @@
 
 TPNO=			27155
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-CONFIGURE_PREFIX =	/usr/gnu
-
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
+CONFIGURE_PREFIX =	$(USRGNUDIR)
 
 # Fixes coredump in the tests/test-localename test.
 CONFIGURE_OPTIONS  +=	ac_cv_func_newlocale=no
@@ -63,27 +56,14 @@
 	'-e "s|\(Test Run By\).*|\1|" ' \
 	'-e "s|\(Native configuration is\).*|\1|" '
 
-ASLR_MODE = $(ASLR_ENABLE)
-
-configure:	$(CONFIGURE_64)
-
-build:          $(BUILD_64)
-
-install:        $(INSTALL_64)
-
 # Needed for "gmake test" to work successfully.
 # Otherwise we see errors such as:
 # FAIL: exec-nogaps.old-O3, sh: SHELLOPTS: readonly variable
 unexport SHELLOPTS
 
-test:           $(TEST_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 
 # test dependencies:
 REQUIRED_PACKAGES += developer/versioning/cvs
 REQUIRED_PACKAGES += developer/versioning/git
 
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/findutils/findutils.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/findutils/findutils.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -41,8 +41,8 @@
 link path=usr/bin/gxargs target=../gnu/bin/xargs facet.compat.gnulinks=true
 # locate and updatedb are not being delivered, in favor of an external
 # solution to the problem.
-file usr/gnu/bin/$(MACH64)/find path=usr/gnu/bin/find
-file usr/gnu/bin/$(MACH64)/xargs path=usr/gnu/bin/xargs
+file path=usr/gnu/bin/find
+file path=usr/gnu/bin/xargs
 file path=usr/gnu/libexec/bigram
 file path=usr/gnu/libexec/code
 file path=usr/gnu/libexec/frcode
--- a/components/flex/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/flex/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,57 +20,36 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		flex
 COMPONENT_VERSION=	2.5.35
 COMPONENT_PROJECT_URL=	http://flex.sourceforge.net/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
 COMPONENT_ARCHIVE_HASH=	\
     sha256:0becbd4b2b36b99c67f8c22ab98f7f80c9860aec70f0350a0018f29a88704e7b
 COMPONENT_ARCHIVE_URL=	http://softlayer.dl.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.bz2
-COMPONENT_BUGDB=	utility/flex
 
 TPNO=			14883
 
 SONAME=libfl.so.1
-LDFLAGS = $(CC_BITS)
+LDFLAGS += $(CC_BITS)
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS  +=		CXXFLAGS="$(CXXFLAGS)"
-CONFIGURE_OPTIONS  +=		LDFLAGS="$(LDFLAGS)"
-CONFIGURE_OPTIONS  +=		M4="/usr/gnu/bin/m4"
+CONFIGURE_OPTIONS  +=		M4="$(GNUBIN)/m4"
 
 COMPONENT_BUILD_ENV +=		SONAME="$(SONAME)"
 COMPONENT_INSTALL_ENV +=	SONAME="$(SONAME)"
 
-COMPONENT_TEST_ENV +=		PATH=/usr/gnu/bin:/usr/bin
+COMPONENT_TEST_ENV +=		PATH=$(GNUBIN):$(USRBINDIR)
 
 COMPONENT_BUILD_TARGETS += $(SONAME)
 COMPONENT_INSTALL_TARGETS += $(SONAME)
 
-ASLR_MODE=$(ASLR_ENABLE)
-
-# common targets
-configure:	$(CONFIGURE_32_and_64)
-
-build:		$(BUILD_32_and_64)
-
-install:	$(INSTALL_32_and_64) 
-
-test:		$(TEST_32_and_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 REQUIRED_PACKAGES += developer/macro/gnu-m4
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/flex/flex.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/flex/flex.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -32,7 +32,7 @@
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
 set name=org.opensolaris.arc-caseid value=PSARC/2007/289
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-file usr/bin/$(MACH64)/flex path=usr/bin/flex
+file path=usr/bin/flex
 file path=usr/include/FlexLexer.h
 link path=usr/sfw/bin/flex target=../../bin/flex
 file path=usr/share/info/flex.info
--- a/components/foomatic/db-engine/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/foomatic/db-engine/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,14 +18,15 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		foomatic-db-engine
 COMPONENT_VERSION=	3.0-20080903
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:668f2020eb136359523090cc17151e6aad0c56bce0e4ae91217a9eba19eec917
 COMPONENT_ARCHIVE_URL=	$(EXTERNAL_ARCHIVE_MIRROR)/$(COMPONENT_ARCHIVE)
@@ -34,13 +35,11 @@
 
 TPNO=			6399
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)" 
 CONFIGURE_OPTIONS +=	PERL=$(PERL)
-CONFIGURE_OPTIONS +=	FILEUTIL=/bin/true
+CONFIGURE_OPTIONS +=	FILEUTIL=$(BINDIR)/true
 CONFIGURE_OPTIONS +=    --sysconfdir=$(ETCDIR)/gnu
 
 # the build system does not support building outside of the source tree
@@ -62,20 +61,6 @@
      >> $(PROTO_DIR)/$(PACKLIST).fixed ; \
  $(MV) $(PROTO_DIR)/$(PACKLIST).fixed $(PROTO_DIR)/$(PACKLIST)
 
-
-# common targets
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += library/libxml2
 REQUIRED_PACKAGES += $(PERL_PKG)
 REQUIRED_PACKAGES += shell/bash
-REQUIRED_PACKAGES += system/library
--- a/components/foomatic/db/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/foomatic/db/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,14 +18,15 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		foomatic-db
 COMPONENT_VERSION=	20080903
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:a404d1243a313259490a6a29238498c438b6e8638dafeb980ab98de347957414
 COMPONENT_ARCHIVE_URL=	$(EXTERNAL_ARCHIVE_MIRROR)/$(COMPONENT_ARCHIVE)
@@ -34,9 +35,8 @@
 
 TPNO=			6398
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PRE_CONFIGURE_ACTION = $(CLONEY) $(SOURCE_DIR) $(@D)
 
@@ -46,15 +46,3 @@
   > $(PROTO_DIR)/usr/share/foomatic/db/source/PPD/Oce/Others/IM8530_1.ppd.gz
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
-
-# common targets
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
--- a/components/foomatic/filters/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/foomatic/filters/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,14 +18,15 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 32
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		foomatic-filters
 COMPONENT_VERSION=	4.0.15
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:f5b7b67aacedec4c0294d242cbffbe0d7d3cd0fdd2b410c055e818f25ed3bc79
 COMPONENT_ARCHIVE_URL=	http://www.openprinting.org/download/foomatic/$(COMPONENT_ARCHIVE)
@@ -34,35 +35,21 @@
 
 TPNO=			8420
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
+
+CONFIGURE_BINDIR.32= $(USRLIBDIR)/lp/bin
 
 CONFIGURE_OPTIONS +=	--prefix=$(USRLIBDIR)/lp
 CONFIGURE_OPTIONS +=	--sysconfdir=$(ETCDIR)/gnu
-CONFIGURE_OPTIONS +=	--bindir=$(USRLIBDIR)/lp/bin
 CONFIGURE_OPTIONS +=	--with-echo=wecho
 CONFIGURE_OPTIONS +=	--with-file-converter="a2ps -1 -q -c -B @@--medium=@@PAGESIZE@@ -o -"
 CONFIGURE_OPTIONS +=	--with-execpath=$(USRLIBDIR)/lp/bin:$(USRBINDIR):$(BINDIR)
-CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS +=	PERL=$(PERL)
 CONFIGURE_OPTIONS +=	A2PS=$(USRBINDIR)/a2ps
 
 COMPONENT_PRE_CONFIGURE_ACTION = ($(CLONEY) $(SOURCE_DIR) $(@D))
 
-# common targets
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
 REQUIRED_PACKAGES += print/filter/a2ps
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/libdbus
 REQUIRED_PACKAGES += system/library/math
--- a/components/foomatic/fppd/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/foomatic/fppd/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,6 +18,8 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../../make-rules/shared-macros.mk
--- a/components/fping/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/fping/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,45 +20,27 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		fping
 COMPONENT_VERSION=	2.4b2_to
 IPS_COMPONENT_VERSION=	2.4.2
 COMPONENT_PROJECT_URL=	http://fping.sourceforge.net/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_NAME).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
     sha256:9f3b3ed7c9fffccefefa9af432eee7244a65592118851f75b5897814cb79b86f
 COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)download/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/fping
 
 TPNO=			5500
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+# Deliver 'sbin' binaries to 'bin'.
+CONFIGURE_SBINDIR.64= $(CONFIGURE_BINDIR.64)
+
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PRE_CONFIGURE_ACTION =  \
         ($(CLONEY) $(SOURCE_DIR) $(@D))
-
-CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-# common targets
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(NO_TESTS)
-
-system-test:    $(NO_TESTS)
-
-
-REQUIRED_PACKAGES += system/library
--- a/components/fping/fping.p5m	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/fping/fping.p5m	Wed Mar 30 13:33:31 2016 -0700
@@ -37,6 +37,6 @@
 set name=org.opensolaris.arc-caseid value=PSARC/2008/160
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
 file exec_attr path=etc/security/exec_attr.d/fping
-file usr/sbin/$(MACH64)/fping path=usr/bin/fping
+file path=usr/bin/fping
 file fping.1m path=usr/share/man/man1m/fping.1m
 license fping.license license=MIT
--- a/components/ftp-proxy/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/ftp-proxy/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		ftp-proxy
@@ -28,22 +29,12 @@
 COMPONENT_PROJECT_URL=	http://www.openbsd.org
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
+COMPONENT_ARCHIVE_SRC=	cache
 COMPONENT_ARCHIVE_HASH= sha256:372dbe0ca8c6b090842a9f0fbdd13b320dc37883137d3dc674d588448aa2d5e9
-CLEAN_PATHS +=		$(COMPONENT_SRC)
-CLOBBER_PATHS +=	$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	service/ftp-proxy
 
 TPNO=	24255
 
-#
-# Don't overwrite CFLAGS here, just add our options there.
-#
-COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS) -D_SOLARIS_ -DOBSD_COMP -lscf"
-COMPONENT_BUILD_ARGS +=	CC="$(CC)"
-
-include ../../make-rules/prep.mk
-include ../../make-rules/justmake.mk
-
 # Depends on S12-only changes in ON.
 ifeq ($(BUILD_TYPE), evaluation)
 BUILD_64=
@@ -51,20 +42,18 @@
 PUBLISH_STAMP=
 endif
 
-include ../../make-rules/ips.mk
+BUILD_STYLE= justmake
+TEST_TARGET= $(NO_TESTS)
+include $(WS_MAKE_RULES)/common.mk
+
+#
+# Don't overwrite CFLAGS here, just add our options there.
+#
+COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS) -D_SOLARIS_ -DOBSD_COMP -lscf"
 
 COMPONENT_INSTALL_ARGS +=	PREFIX=$(PROTOUSRDIR)
 COMPONENT_INSTALL_ARGS +=	MANDIR=$(PROTOUSRSHAREMANDIR)
-COMPONENT_INSTALL_ARGS +=	INSTALL=/usr/gnu/bin/install
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-# common targets
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(NO_TESTS)
+COMPONENT_INSTALL_ARGS +=	INSTALL=$(INSTALL)
 
 # Here we just download the cached source archive. In order to update
 # the cache, we have to get the sources via CVS manually and ask gatekeepers
@@ -80,4 +69,3 @@
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/core-os
 REQUIRED_PACKAGES += system/header
-REQUIRED_PACKAGES += system/library
--- a/components/gamin/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gamin/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -20,16 +20,14 @@
 #
 
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
-
+BUILD_BITS= 64_and_32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME         = gamin
 COMPONENT_VERSION      = 0.1.10
 COMPONENT_PROJECT_URL  = http://www.gnome.org/~veillard/gamin/
-COMPONENT_SRC          = $(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE      = $(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH = \
     sha256:28085f0ae8be10eab582ff186af4fb0be92cc6c62b5cc19cd09b295c7c2899a1
 COMPONENT_ARCHIVE_URL  = https://people.gnome.org/~veillard/gamin/sources/gamin-0.1.10.tar.gz
@@ -37,11 +35,7 @@
 
 TPNO                   = 9483
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
-
-ASLR_MODE = $(ASLR_ENABLE)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PREP_ACTION = (cd $(@D) ; autoreconf -if; bzip2 NEWS; bzip2 ChangeLog; bzip2 COPYING)
 
@@ -71,9 +65,6 @@
 # Where the gam_server will be located
 CONFIGURE_OPTIONS    +=      --libexecdir="$(USRLIBDIR)"
 
-# Needed for 64 bit build - adds -m64
-CONFIGURE_OPTIONS    +=      CFLAGS="$(CFLAGS)"
-
 # Direct the python packages to vendor-packages dir instead of site-packages
 COMPONENT_BUILD_ARGS +=      PYTHON_SITE_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
 
@@ -91,14 +82,5 @@
 	cp _gamin.so 64 \
 )
 
-configure:	$(CONFIGURE_32_and_64)
-
-build:          $(BUILD_32_and_64)
-
-install:        $(INSTALL_32_and_64)
-
-test:           $(TEST_32_and_64)
-
 REQUIRED_PACKAGES += library/glib2
 REQUIRED_PACKAGES += runtime/python-27
-REQUIRED_PACKAGES += system/library
--- a/components/gawk/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gawk/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,19 +18,18 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 64
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gawk
 COMPONENT_VERSION=	4.1.3
-COMPONENT_PROJECT_URL=	http://www.gnu.org/software/gawk/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.xz
 COMPONENT_ARCHIVE_HASH=	\
 	sha256:e3cf55e91e31ea2845f8338bedd91e40671fc30e4d82ea147d220e687abda625
-COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gawk/$(COMPONENT_ARCHIVE)
-COMPONENT_BUGDB=	utility/gawk
 
 # The additional gawk specific set of transforms to be applied to the
 # test results to try to normalize them.
@@ -39,35 +38,19 @@
 
 TPNO=			26217	
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+# must build tests before using
+SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-CONFIGURE_BINDIR.64 =   $(CONFIGURE_PREFIX)/bin
+# Utility executables are intentionally delivered to the 32-bit lib directory.
 CONFIGURE_LIBDIR.64 =   $(CONFIGURE_PREFIX)/lib
 
 CONFIGURE_OPTIONS	+=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS	+=	--libexecdir=$(CONFIGURE_LIBDIR.$(BITS))
-CONFIGURE_OPTIONS	+=	CFLAGS="$(CFLAGS)"
 
-COMPONENT_SYSTEM_TEST_ARGS = AWKPROG=/usr/bin/gawk
-
-ASLR_MODE = $(ASLR_ENABLE)
-
-
-configure:	$(CONFIGURE_64)
-
-build:		$(BUILD_64)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-# must build tests before using
-system-test:    build $(SYSTEM_TEST_64)
+COMPONENT_SYSTEM_TEST_ARGS = AWKPROG=$(USRBINDIR)/gawk
 
 REQUIRED_PACKAGES += library/libsigsegv
 REQUIRED_PACKAGES += library/readline
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/math
--- a/components/gcc3/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gcc3/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,18 +18,18 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 32
+# Build gcc with gcc
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
-# Build gcc with gcc
-COMPILER =	gcc
-
 COMPONENT_NAME=		gcc
 COMPONENT_VERSION=	3.4.3
 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 # unfortunately we have our own "special" tarball and not the community version, so use that.
 COMPONENT_ARCHIVE_HASH=	\
     sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
@@ -38,9 +38,8 @@
 
 TPNO=			17028
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+INSTALL_TARGET=
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 PARCH =		$(MACH:i386=i386-pc)
 GNU_ARCH =	$(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
@@ -58,16 +57,15 @@
 LD_B_DIRECT=
 
 CONFIGURE_PREFIX =	/usr/gcc/3.4
+CONFIGURE_INFODIR =	$(CONFIGURE_PREFIX)/share/info
 
-CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
-CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
+CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
+CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=$(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_ENV +=	CFLAGS="$(CFLAGS)"
+CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=$(USRBINDIR)/as
+CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=$(GNUBIN)/as
 
 COMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
 COMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
@@ -75,10 +73,6 @@
 COMPONENT_BUILD_TARGETS = bootstrap
 
 # common targets
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
 $(PROTO_DIR)/.sedded:	$(INSTALL_32)
 	(cd $(@D) ; for file in libstdc++.la libsupc++.la ; do \
 		$(MV) usr/gcc/3.4/lib/$$file usr/gcc/3.4/lib/$$file.orig ; \
@@ -90,16 +84,11 @@
 
 install:	$(PROTO_DIR)/.sedded
 
-test: $(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 
 REQUIRED_PACKAGES += developer/assembler
 REQUIRED_PACKAGES += developer/gnu-binutils
 REQUIRED_PACKAGES += developer/lexer/flex
 REQUIRED_PACKAGES += developer/parser/bison
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc-3-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/gcc45/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gcc45/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,16 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+BUILD_BITS= 32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gcc
 COMPONENT_VERSION=	4.5.2
 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:07b880faf29f3f9d9c0953717002ac29f5d061427797d2487a7c9c169e6395b3
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
@@ -39,11 +40,9 @@
 
 TPNO=			4456
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
-PATH=/usr/bin:/usr/gnu/bin:/usr/perl5/bin
+PATH=$(USRBINDIR):$(GNUBIN):/usr/perl5/bin
 
 PARCH =         $(MACH:i386=i386-pc)
 GNU_ARCH =      $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
@@ -53,6 +52,7 @@
 # This product bootstraps itself.  The gcc flags are not the same
 # as Studio flags. -O2 means different things for the two compilers
 CFLAGS=-g -O2 
+CXXFLAGS=$(CFLAGS)
 CFLAGS_FOR_BUILD=$(CFLAGS)
 
 # CC_BITS may get in the way
@@ -60,26 +60,24 @@
 
 CONFIG_SHELL = /bin/sh
 
-CONFIGURE_PREFIX = /usr/gcc/4.5
+CONFIGURE_PREFIX =	/usr/gcc/4.5
+CONFIGURE_INFODIR =	$(CONFIGURE_PREFIX)/share/info
 
-CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
+CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc"
 CONFIGURE_OPTIONS +=	--enable-shared
-CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
-CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
-CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
+CONFIGURE_OPTIONS +=	--with-gmp-include=$(USRINCDIR)/gmp
+CONFIGURE_OPTIONS +=	--with-mpfr-include=$(USRINCDIR)/mpfr
+CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=$(LD)
 
 COMPONENT_POST_UNPACK_ACTION = \
     ( cd $(COMPONENT_DIR) ; \
 	tar xf testsuite-$(COMPONENT_VERSION).tar.gz )
 
 # 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_OPTIONS +=	CFLAGS="$(CFLAGS)"
+CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=$(USRBINDIR)/as
+CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=$(GNUBIN)/as
 
 # Keep ASLR disabled (the default) for gcc 4.5; build often core dumps with ASLR
 ASLR_MODE = $(ASLR_DISABLE)
@@ -98,16 +96,6 @@
 COMPONENT_TEST_CMD =	ulimit -Ss 16384 ; $(GMAKE)
 COMPONENT_TEST_ARGS =	-k -i
 
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32) 
-
-test:		$(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 
 REQUIRED_PACKAGES += developer/assembler
 REQUIRED_PACKAGES += developer/gnu-binutils
@@ -115,7 +103,6 @@
 REQUIRED_PACKAGES += library/mpc
 REQUIRED_PACKAGES += library/mpfr
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc-45-runtime
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/gcc47/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gcc47/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,15 +18,16 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 32
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gcc
 COMPONENT_VERSION=	4.7.3
 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:34a273937eb63ee710784b65bcf9fb3cfcd79d02848f80c75f8254abd14c79c8
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
@@ -34,12 +35,10 @@
 
 TPNO=			14467
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # The GNU compiler wants the GNU utilities.
-PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin
+PATH=$(GNUBIN):$(USRBINDIR):/usr/perl5/bin
 
 PARCH =         $(MACH:i386=i386-pc)
 GNU_ARCH =      $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
@@ -68,9 +67,7 @@
 LD_MAP_NOEXDATA.i386=
 
 # /usr/lib/ld/map.noexbss  destroys SPARC
-ifeq ($(MACH),sparc)
-LD_MAP_NOEXBSS=
-endif
+LD_MAP_NOEXBSS.sparc=
 
 # for some reason the fixincludes target fails with bash on Solaris.
 CONFIG_SHELL = /bin/sh
@@ -78,27 +75,24 @@
 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
 
-CONFIGURE_PREFIX = /usr/gcc/4.7
+CONFIGURE_PREFIX =	/usr/gcc/4.7
+CONFIGURE_INFODIR =	$(CONFIGURE_PREFIX)/share/info
 
-CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
+CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc"
 CONFIGURE_OPTIONS +=	--enable-shared
-CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
-CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
-CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
+CONFIGURE_OPTIONS +=	--with-gmp-include=$(USRINCDIR)/gmp
+CONFIGURE_OPTIONS +=	--with-mpfr-include=$(USRINCDIR)/mpfr
+CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=$(LD)
 CONFIGURE_OPTIONS +=	--with-isl=no
 CONFIGURE_OPTIONS +=	--with-cloog=no
 
 CONFIGURE_ENV     += PYTHON="$(PYTHON)"
 
 # 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_OPTIONS +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS +=	CXXFLAGS="$(CXXFLAGS)"
+CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=$(USRBINDIR)/as
+CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=$(GNUBIN)/as
 
 COMPONENT_BUILD_TARGETS=bootstrap
 
@@ -115,12 +109,6 @@
 # Disable ASLR for now.
 ASLR_MODE=$(ASLR_DISABLE)
 
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
 # To ensure that all tests that are expected to pass actually
 # pass, we have to increase the stacksize limit to at least
 # 16MB. Otherwise we'll get spurious failures in the test
@@ -131,14 +119,9 @@
 COMPONENT_TEST_ARGS = -k -i
 COMPONENT_TEST_TARGETS = check check-target
 
-test:	$(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 
 REQUIRED_PACKAGES += library/gmp
 REQUIRED_PACKAGES += library/mpc
 REQUIRED_PACKAGES += library/mpfr
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/gcc48/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gcc48/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,19 +18,18 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
+BUILD_BITS= 32
+COMPILER= gcc
 export PARFAIT_BUILD=no
-
-COMPILER=gcc
-
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gcc
 COMPONENT_VERSION=	4.8.2
 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:2ea77114344a06c45dd5791275311e91d306545aa5ec9db31d24174f6965e880
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
@@ -38,12 +37,10 @@
 
 TPNO=			15448
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/gnu-component.mk
 
 # The GNU compiler wants the GNU utilities.
-PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin
+PATH=$(GNUBIN):$(USRBINDIR):/usr/perl5/bin
 
 PARCH =         $(MACH:i386=i386-pc)
 GNU_ARCH =      $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
@@ -74,9 +71,7 @@
 LD_MAP_NOEXDATA.i386=
 
 # /usr/lib/ld/map.noexbss  destroys SPARC
-ifeq ($(MACH),sparc)
-LD_MAP_NOEXBSS=
-endif
+LD_MAP_NOEXBSS.sparc=
 
 
 # for some reason the fixincludes target fails with bash on Solaris.
@@ -85,28 +80,25 @@
 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
 
-CONFIGURE_PREFIX = /usr/gcc/4.8
+CONFIGURE_PREFIX =	/usr/gcc/4.8
+CONFIGURE_INFODIR =	$(CONFIGURE_PREFIX)/share/info
 
-CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
+CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc"
 CONFIGURE_OPTIONS +=	--enable-shared
 CONFIGURE_OPTIONS +=	--with-build-config=no
-CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
-CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
-CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
+CONFIGURE_OPTIONS +=	--with-gmp-include=$(USRINCDIR)/gmp
+CONFIGURE_OPTIONS +=	--with-mpfr-include=$(USRINCDIR)/mpfr
+CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=$(LD)
 CONFIGURE_OPTIONS +=   --with-isl=no
 CONFIGURE_OPTIONS +=   --with-cloog=no
 
 CONFIGURE_ENV     += PYTHON="$(PYTHON)"
 
 # 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_OPTIONS +=	CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS +=	CXXFLAGS="$(CXXFLAGS)"
+CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=$(USRBINDIR)/as
+CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=$(GNUBIN)/as
 
 COMPONENT_BUILD_TARGETS=bootstrap
 
@@ -123,12 +115,6 @@
 # Disable ASLR for now.
 ASLR_MODE=$(ASLR_DISABLE)
 
-configure:	$(CONFIGURE_32)
-
-build:		$(BUILD_32)
-
-install:	$(INSTALL_32)
-
 # To ensure that all tests that are expected to pass actually
 # pass, we have to increase the stacksize limit to at least
 # 16MB. Otherwise we'll get spurious failures in the test
@@ -150,16 +136,11 @@
 COMPONENT_TEST_MASTER = \
 	$(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH)-$(BITS).master
 
-test:	$(TEST_32)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 
 REQUIRED_PACKAGES += library/gmp
 REQUIRED_PACKAGES += library/mpc
 REQUIRED_PACKAGES += library/mpfr
 REQUIRED_PACKAGES += shell/bash
 REQUIRED_PACKAGES += shell/ksh93
-REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/components/gcc49/Makefile	Wed Mar 30 10:16:56 2016 -0700
+++ b/components/gcc49/Makefile	Wed Mar 30 13:33:31 2016 -0700
@@ -18,19 +18,18 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 export PARFAIT_BUILD=no
-
-COMPILER=gcc
-
+BUILD_BITS= 32
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		gcc
 COMPONENT_VERSION=	4.9.3
 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH= \
     sha256:e6c63b40877bc756cc7cfe6ca98013eb15f02ec6c8c2cf68e24533ad1203aaba
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
@@ -38,19 +37,18 @@
 
 TPNO=			24017
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/configure.mk
-include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/common.mk
 
 # The GNU compiler wants the GNU utilities.
-PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin
+PATH=$(GNUBIN):$(USRBINDIR):$(USRDIR)/perl5/bin
 
 PATCH_LEVEL := 0
 ENABLE_CLOOG := 1
 
-ENABLE_CXA_ATEXIT=yes
 ifeq ($(OS_VERSION), 5.11)
   ENABLE_CXA_ATEXIT=no
+else
+  ENABLE_CXA_ATEXIT=yes
 endif
 
 PARCH =         $(MACH:i386=i386-pc)
@@ -122,42 +120,43 @@
 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
 COMPONENT_BUILD_ENV += LD_OPTIONS="$(LD_OPTIONS)"
 
-CONFIGURE_PREFIX = /usr/gcc/$(GCC_VERSION)
+CONFIGURE_PREFIX =	/usr/gcc/$(GCC_VERSION)
+CONFIGURE_INFODIR =	$(CONFIGURE_PREFIX)/share/info
 
-CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
+CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc,lto"
 CONFIGURE_OPTIONS +=	--enable-shared
-CONFIGURE_OPTIONS +=	--enable-ssp=yes
-CONFIGURE_OPTIONS +=	--enable-nls=yes
+CONFIGURE_OPTIONS +=	--enable-ssp
+CONFIGURE_OPTIONS +=	--enable-nls
 
 # --enable-largefile=yes gets canceled or reset several times by
 #  several different ./configure's. We have to re-enable it via
 #  several different patches.
-CONFIGURE_OPTIONS +=	--enable-largefile=yes
-CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
-CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
-CONFIGURE_OPTIONS +=	--with-gnu-as --with-as=/usr/gnu/bin/as
-CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
-CONFIGURE_OPTIONS +=    --enable-multilib=yes
+CONFIGURE_OPTIONS +=	--enable-largefile
+CONFIGURE_OPTIONS +=	--with-gmp-include=$(USRINCDIR)/gmp
+CONFIGURE_OPTIONS +=	--with-mpfr-include=$(USRINCDIR)/mpfr
+CONFIGURE_OPTIONS +=	--with-gnu-as --with-as=$(GNUBIN)/as
+CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=$(USRBINDIR)/ld
+CONFIGURE_OPTIONS +=    --enable-multilib
 CONFIGURE_OPTIONS +=    --enable-threads=posix
-CONFIGURE_OPTIONS +=    --enable-tls=yes
-CONFIGURE_OPTIONS +=    --enable-libstdcxx-threads=yes
-CONFIGURE_OPTIONS +=    --enable-libstdcxx-pch=no
-CONFIGURE_OPTIONS +=    --enable-libstdcxx-visibility=no
+CONFIGURE_OPTIONS +=    --enable-tls
+CONFIGURE_OPTIONS +=    --enable-libstdcxx-threads
+CONFIGURE_OPTIONS +=    --disable-libstdcxx-pch
+CONFIGURE_OPTIONS +=    --disable-libstdcxx-visibility
 
 # This needs additional linker support.
-CONFIGURE_OPTIONS +=    --enable-initfini-array=yes
+CONFIGURE_OPTIONS +=    --enable-initfini-array
 
 # VTable verification needs additional linker support.
-CONFIGURE_OPTIONS +=    --enable-vtable-verify=no
-CONFIGURE_OPTIONS +=    --enable-comdat=yes
+CONFIGURE_OPTIONS +=    --disable-vtable-verify
+CONFIGURE_OPTIONS +=    --enable-comdat
 CONFIGURE_OPTIONS +=    --enable-__cxa_atexit=$(ENABLE_CXA_ATEXIT)
-CONFIGURE_OPTIONS +=    --enable-libstdcxx-debug=yes
-CONFIGURE_OPTIONS +=    --enable-libstdcxx-threads=yes
-CONFIGURE_OPTIONS +=    --enable-c99=yes
-CONFIGURE_OPTIONS +=    --enable-long-long=yes
-CONFIGURE_OPTIONS +=    --enable-wchar_t=yes
+CONFIGURE_OPTIONS +=    --enable-libstdcxx-debug
+CONFIGURE_OPTIONS +=    --enable-libstdcxx-threads
+CONFIGURE_OPTIONS +=    --enable-c99
+CONFIGURE_OPTIONS +=    --enable-long-long
+CONFIGURE_OPTIONS +=    --enable-wchar_t
 CONFIGURE_OPTIONS +=    --with-system-zlib
 
 # We'll enable ISL and CLooG as soon as CLooG integrates and is
@@ -172,15 +171,12 @@
   CONFIGURE_OPTIONS +=    --with-cloog-include=$(CLOOGINCLUDE)
   CONFIGURE_OPTIONS +=    --with-cloog-lib=$(CLOOGLIB)
 else
-  CONFIGURE_OPTIONS +=    --with-isl=no
-  CONFIGURE_OPTIONS +=    --with-cloog=no
+  CONFIGURE_OPTIONS +=    --without-isl
+  CONFIGURE_OPTIONS +=    --without-cloog
 endif
 
-CONFIGURE_OPTIONS +=    --with-build-time-tools=/usr/gnu/bin