7035978 parfait support for userland bits
authorMike Sullivan <Mike.Sullivan@Oracle.COM>
Tue, 17 Apr 2012 10:40:54 -0700
changeset 774 d0cbca26a17c
parent 773 cfddc5466118
child 775 41283dc43a00
7035978 parfait support for userland bits
components/Makefile
components/cmake/Makefile
components/ghostscript/Makefile
components/gnump/Makefile
components/librsync/Makefile
components/libtorrent/Makefile
components/libusb/ugen/Makefile
components/libusb/wrapper/Makefile
components/mpc/parfait/configure.patch
components/mpfr/Makefile
components/nethack/Makefile
components/openssl/openssl-0.9.8-fips-140/Makefile
components/openssl/openssl-fips/Makefile
components/python/python26/Makefile
components/python/python27/Makefile
components/rtorrent/Makefile
components/samba/samba/Makefile
components/stdcxx/Makefile
components/subversion/Makefile
make-rules/configure.mk
make-rules/justmake.mk
make-rules/makemaker.mk
make-rules/prep.mk
make-rules/setup.py.mk
make-rules/shared-macros.mk
tools/Makefile
--- a/components/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../make-rules/shared-macros.mk
@@ -77,8 +77,10 @@
 	$(RM) components.mk depends.mk .profile
 
 clobber:	$(COMPONENT_DIRS.nosetup) clean
+	@cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
 	$(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
 
+
 setup:	$(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
 
 $(WS_LOGS):
@@ -104,7 +106,7 @@
 endif
 
 tools:
-	@cd ../tools ; echo "building tools..." ; $(GMAKE) setup
+	@cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup
 
 # $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
 # to pass a few things on to zone based builds
--- a/components/cmake/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/cmake/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -19,9 +19,13 @@
 # CDDL HEADER END
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
+# parfait seems to hang on libcmsysTestDynload.so.bc, so for
+# now we have to disable it.
+PARFAIT_BUILD=no
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		cmake
@@ -47,6 +51,9 @@
 # as CONFIGURE_OPTIONS; otherwise the correct compilers are not used
 CONFIGURE_ENV +=	CC="$(CC)"	
 CONFIGURE_ENV +=	CXX="$(CXX)"	
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+CONFIGURE_ENV +=	CXXFLAGS="-library=stdcxx4"	
+endif
 CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"	
 CONFIGURE_ENV +=	MAKE="$(GMAKE)"	
 
--- a/components/ghostscript/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/ghostscript/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -19,8 +19,13 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
+
+# parfait seems to spin when looking at the .bc files, so
+# for now disable it.
+PARFAIT_BUILD=no
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=         ghostscript
--- a/components/gnump/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/gnump/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -19,7 +19,7 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -41,6 +41,8 @@
 
 PATCH_LEVEL = 0
 
+CLOBBER_PATHS += libgmp.pc libgmpxx.pc
+
 CFLAGS += -features=extinl,extensions
 CFLAGS += -xustr=ascii_utf16_ushort -xcsi
 # -xthreadvar=%all: allow thread-local storage via __thread
--- a/components/librsync/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/librsync/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../make-rules/shared-macros.mk
 
@@ -40,6 +40,7 @@
 COMPONENT_ARCHIVE_1=	$(COMPONENT_SRC_1).tar.gz
 COMPONENT_ARCHIVE_HASH_1=	sha1:87b947aa4312bcf776d442abc23e142eb35c16da
 COMPONENT_ARCHIVE_URL_1=	$(EXTERNAL_ARCHIVE_MIRROR)/$(COMPONENT_ARCHIVE_1)
+CLOBBER_PATHS += $(COMPONENT_NAME_1)
 
 include ../../make-rules/prep.mk
 include ../../make-rules/configure.mk
--- a/components/libtorrent/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/libtorrent/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -23,6 +23,10 @@
 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
+# we really need to use studio, mostly because that's what
+# sigc++ uses, so we don't like that parfait is g++ in disguise
+PARFAIT_BUILD=no
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libtorrent
--- a/components/libusb/ugen/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/libusb/ugen/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../../make-rules/shared-macros.mk
 
@@ -42,6 +42,7 @@
 download:
 
 clobber:	clean
+	$(RM) $(SOURCE_DIR)/.prep
 
 # common targets
 $(SOURCE_DIR)/.prep:
@@ -56,8 +57,6 @@
 # enumerates USB devices plugged into your system
 test:		$(TEST_32_and_64)
 
-CLEAN_PATH +=	$(SOURCE_DIR)/.prep
-
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
 
 include $(WS_TOP)/make-rules/depend.mk
--- a/components/libusb/wrapper/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/libusb/wrapper/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -49,6 +49,7 @@
 download:
 
 clobber:	clean
+	$(RM) $(SOURCE_DIR)/.prep
 
 prep:	$(SOURCE_DIR)/.prep
 
@@ -59,8 +60,6 @@
 # enumerates USB devices plugged into your system
 test:		$(TEST_32_and_64)
 
-CLEAN_PATHS +=	$(SOURCE_DIR)/.prep
-
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
 
 include $(WS_TOP)/make-rules/depend.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/mpc/parfait/configure.patch	Tue Apr 17 10:40:54 2012 -0700
@@ -0,0 +1,11 @@
+--- mpc-0.9/configure.orig	Wed Jan 25 11:05:39 2012
++++ mpc-0.9/configure	Wed Jan 25 11:05:46 2012
+@@ -10989,7 +10989,7 @@
+ 
+ fi
+ 
+-for ac_header in complex.h locale.h inttypes.h stdint.h limits.h unistd.h sys/time.h
++for ac_header in locale.h inttypes.h stdint.h limits.h unistd.h sys/time.h
+ do :
+   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
--- a/components/mpfr/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/mpfr/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -19,7 +19,7 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -39,6 +39,7 @@
 include ../../make-rules/ips.mk
 include ../../make-rules/lint-libraries.mk
 
+CLOBBER_PATHS += libmpfr.pc
 PATCH_LEVEL = 0
 
 CFLAGS += -features=extinl,extensions
--- a/components/nethack/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/nethack/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -50,6 +50,9 @@
 COMPONENT_INSTALL_ARGS += CHGRP=true
 COMPONENT_INSTALL_ARGS += ROOT=$(PROTO_DIR)
 
+COMPONENT_BUILD_ENV += CC=$(CC)
+COMPONENT_INSTALL_ENV += CC=$(CC)
+
 PKG_PROTO_DIRS += $(COMPONENT_SRC)/doc
 
 # common targets
--- a/components/openssl/openssl-0.9.8-fips-140/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/openssl/openssl-0.9.8-fips-140/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../../make-rules/shared-macros.mk
 
@@ -159,6 +159,8 @@
 $(BUILD_32_and_64):	ccwrap
 build:			$(BUILD_32_and_64)
 
+CLOBBER_PATHS += ccwrap
+
 # We follow what we do for install in openssl/openssl-1.0.0 component. Please
 # see the comment in Makefile in there for more information.
 install:	$(INSTALL_32_and_64)
--- a/components/openssl/openssl-fips/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/openssl/openssl-fips/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -53,6 +53,8 @@
 FAKE_CC = cc
 FAKE_APPS = $(FAKE_ISALIST) $(FAKE_MAKE) $(FAKE_CC)
 
+CLOBBER_PATHS += $(FAKE_APPS)
+
 # Do not use $(PWD), it would not work if run from a different directory with
 # "gmake -C" as we do from openssl-0.9.8-fips-140.
 # we'll also pick up gcc if we find it in the path, so force it to
--- a/components/python/python26/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/python/python26/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../../make-rules/shared-macros.mk
 
@@ -57,7 +57,12 @@
 # requirements.
 COMPONENT_BUILD_TARGETS = profile-opt
 XPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile
-PYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic
+# the non-clang compiler we need to use for now doesn't like
+# this flag
+#ifneq   ($(strip $(PARFAIT_BUILD)),yes)
+PYFLAGS.i386 = -xtarget=opteron
+#endif
+PYFLAGS.i386 += -xarch=sse2 -xcache=generic
 PYFLAGS.sparc =
 CFLAGS += -xO5 $(PYFLAGS.$(MACH))
 LDFLAGS += -xO5 $(PYFLAGS.$(MACH))
--- a/components/python/python27/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/python/python27/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 
 #
 include ../../../make-rules/shared-macros.mk
@@ -61,7 +61,12 @@
 # requirements.
 COMPONENT_BUILD_TARGETS = profile-opt
 XPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile
-PYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic
+# the non-clang compiler we need to use for now doesn't like
+# this flag
+#ifneq   ($(strip $(PARFAIT_BUILD)),yes)
+PYFLAGS.i386 = -xtarget=opteron
+#endif
+PYFLAGS.i386 += -xarch=sse2 -xcache=generic
 PYFLAGS.sparc =
 CFLAGS += -xO5 $(PYFLAGS.$(MACH))
 LDFLAGS += -xO5 $(PYFLAGS.$(MACH))
--- a/components/rtorrent/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/rtorrent/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -23,6 +23,10 @@
 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
+# we really need to use studio, mostly because that's what
+# sigc++ uses, so we don't like that parfait is g++ in disguise
+PARFAIT_BUILD=no
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		rtorrent
--- a/components/samba/samba/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/samba/samba/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -22,6 +22,11 @@
 #
 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
+
+# parfait seems to spin when looking at the .bc files, so
+# for now disable it.
+PARFAIT_BUILD=no
+
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		samba
--- a/components/stdcxx/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/stdcxx/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,8 +18,13 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
+
+# we really need to use studio so we don't like that
+# parfait is g++ in disguise
+PARFAIT_BUILD=no
+
 include ../../make-rules/shared-macros.mk
 
 PATH=$(dir $(CC)):/usr/gnu/bin:/usr/bin
@@ -33,6 +38,8 @@
 COMPONENT_ARCHIVE_HASH=	sha1:38efa30958222b2733f22098b3db09161d2e6c8c
 COMPONENT_ARCHIVE_URL=	http://www.apache.org/dist/stdcxx/$(COMPONENT_ARCHIVE)
 
+CLOBBER_PATHS += install.sh
+
 include ../../make-rules/prep.mk
 include ../../make-rules/configure.mk
 include ../../make-rules/ips.mk
--- a/components/subversion/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/components/subversion/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -20,12 +20,12 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
 
-PATH=$(dir $(CC)):/usr/bin:/usr/gnu/bin
+PATH=$(dir $(CC)):$(SPRO_VROOT)/bin:/usr/bin:/usr/gnu/bin
 
 COMPONENT_NAME=		subversion
 COMPONENT_VERSION=	1.6.16
--- a/make-rules/configure.mk	Tue Apr 17 10:38:01 2012 -0700
+++ b/make-rules/configure.mk	Tue Apr 17 10:40:54 2012 -0700
@@ -89,6 +89,16 @@
 $(BUILD_DIR_64)/.configured:	BITS=64
 
 CONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+# parfait creates '*.bc' files which can confuse configure's
+# object/exe extension detection. which we really don't need it
+# to do anyway, so we'll just tell it what they are.
+CONFIGURE_ENV += ac_cv_objext=o
+CONFIGURE_ENV += ac_cv_exeext=""
+# this is fixed in the clang compiler but we can't use it yet
+CONFIGURE_ENV += ac_cv_header_stdbool_h=yes
+endif
+
 
 # temporarily work around some issues
 CONFIGURE_ENV += "ac_cv_func_realloc_0_nonnull=yes"
@@ -110,6 +120,9 @@
 	(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
 		$(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
 	$(COMPONENT_POST_BUILD_ACTION)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+	-$(PARFAIT) build
+endif
 	$(TOUCH) $@
 
 # install the built source into a prototype area
@@ -128,5 +141,13 @@
 	$(COMPONENT_POST_TEST_ACTION)
 	$(TOUCH) $@
 
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+parfait: install
+	-$(PARFAIT) build
+else
+parfait:
+	$(MAKE) PARFAIT_BUILD=yes parfait
+endif
+
 clean::
 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
--- a/make-rules/justmake.mk	Tue Apr 17 10:38:01 2012 -0700
+++ b/make-rules/justmake.mk	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 #
 # Rules and Macros for building opens source software that just uses their
@@ -54,6 +54,9 @@
 	(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
 		$(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
 	$(COMPONENT_POST_BUILD_ACTION)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+	-$(PARFAIT) build
+endif
 	$(TOUCH) $@
 
 # install the built source into a prototype area
@@ -64,6 +67,7 @@
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) $@
 
+
 # test the built source
 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
 	$(COMPONENT_PRE_TEST_ACTION)
@@ -72,5 +76,13 @@
 	$(COMPONENT_POST_TEST_ACTION)
 	$(TOUCH) $@
 
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+parfait: install
+	-$(PARFAIT) build
+else
+parfait:
+	$(MAKE) PARFAIT_BUILD=yes parfait
+endif
+
 clean::
 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
--- a/make-rules/makemaker.mk	Tue Apr 17 10:38:01 2012 -0700
+++ b/make-rules/makemaker.mk	Tue Apr 17 10:40:54 2012 -0700
@@ -18,14 +18,14 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 # we only do 32 bit perl for now.
 BITS=32
 
 COMMON_PERL_ENV +=	MAKE=$(GMAKE)
-COMMON_PERL_ENV +=	PATH=$(dir $(CC)):$(PATH)
+COMMON_PERL_ENV +=	PATH=$(dir $(CC)):$(SPRO_VROOT)/bin:$(PATH)
 COMMON_PERL_ENV +=	LANG=""
 COMMON_PERL_ENV +=	CC="$(CC)"
 COMMON_PERL_ENV +=	CFLAGS="$(PERL_OPTIMIZE)"
@@ -82,6 +82,9 @@
 	(cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) $(GMAKE) \
 			$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
 	$(COMPONENT_POST_TEST_ACTION)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+	-$(PARFAIT) build
+endif
 	$(TOUCH) $@
 
 clean:: 
--- a/make-rules/prep.mk	Tue Apr 17 10:38:01 2012 -0700
+++ b/make-rules/prep.mk	Tue Apr 17 10:40:54 2012 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 UNPACK =	$(WS_TOOLS)/userland-unpack
@@ -35,15 +35,29 @@
 # append filenames to PATCHES, you'll have to set $(EXTRA_PATCHES) prior to
 # inclusion.
 PATCH_DIR ?=	patches
+
+# we may need patches only for use with parfait
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+PARFAIT_PATCH_DIR =	parfait
+endif
 PATCH_PATTERN ?=	*.patch
-PATCHES =	$(shell find $(PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \
+PATCHES =	$(shell find $(PATCH_DIR) $(PARFAIT_PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \
 				2>/dev/null | sort) $(EXTRA_PATCHES)
 STAMPS =	$(PATCHES:$(PATCH_DIR)/%=$(SOURCE_DIR)/.%ed)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+STAMPS +=	$(PATCHES:$(PARFAIT_PATCH_DIR)/%=$(SOURCE_DIR)/.%ed)
+endif
 
 $(SOURCE_DIR)/.%ed:	$(PATCH_DIR)/%
 	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
 	$(TOUCH) $@
 
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+$(SOURCE_DIR)/.%ed:	$(PARFAIT_PATCH_DIR)/%
+	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
+	$(TOUCH) $@
+endif
+
 # template for download rules. add new rules with $(call download-rule, suffix)
 define download-rule
 ARCHIVES += $$(COMPONENT_ARCHIVE$(1))
--- a/make-rules/setup.py.mk	Tue Apr 17 10:38:01 2012 -0700
+++ b/make-rules/setup.py.mk	Tue Apr 17 10:40:54 2012 -0700
@@ -56,6 +56,9 @@
 		$(PYTHON.$(BITS)) ./setup.py build \
 			--build-temp $(@D:$(BUILD_DIR)/%=%))
 	$(COMPONENT_POST_BUILD_ACTION)
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+	-$(PARFAIT) $(SOURCE_DIR)/$(@D:$(BUILD_DIR)/%=%)
+endif
 	$(TOUCH) $@
 
 
@@ -90,5 +93,13 @@
 	$(COMPONENT_POST_TEST_ACTION)
 	$(TOUCH) $@
 
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+parfait: install
+	-$(PARFAIT) build
+else
+parfait:
+	$(MAKE) PARFAIT_BUILD=yes parfait
+endif
+
 clean::
 	$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
--- a/make-rules/shared-macros.mk	Tue Apr 17 10:38:01 2012 -0700
+++ b/make-rules/shared-macros.mk	Tue Apr 17 10:40:54 2012 -0700
@@ -215,11 +215,21 @@
 SPRO_ROOT =	$(BUILD_TOOLS)/SUNWspro
 SPRO_VROOT =	$(SPRO_ROOT)/sunstudio12.1
 
+PARFAIT_ROOT =	$(BUILD_TOOLS)/parfait/parfait-tools-0.5.0.1/
+PARFAIT= $(PARFAIT_ROOT)/bin/parfait
+export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc
+export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC
+export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc
+export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++
+# for now
+export PARFAIT_CLANG=0
+
 GCC_ROOT =	/usr/sfw
 
 CC.studio.32 =	$(SPRO_VROOT)/bin/cc
 CXX.studio.32 =	$(SPRO_VROOT)/bin/CC
 
+
 CC.studio.64 =	$(SPRO_VROOT)/bin/cc
 CXX.studio.64 =	$(SPRO_VROOT)/bin/CC
 
@@ -229,8 +239,6 @@
 CC.gcc.64 =	$(GCC_ROOT)/bin/gcc
 CXX.gcc.64 =	$(GCC_ROOT)/bin/g++
 
-CC =		$(CC.$(COMPILER).$(BITS))
-CXX =		$(CXX.$(COMPILER).$(BITS))
 
 lint.32 =	$(SPRO_VROOT)/bin/lint -m32
 lint.64 =	$(SPRO_VROOT)/bin/lint -m64
@@ -247,6 +255,22 @@
 PYTHON.2.7.VENDOR_PACKAGES.64 = /usr/lib/python2.7/vendor-packages/64
 PYTHON.2.7.VENDOR_PACKAGES = $(PYTHON.2.7.VENDOR_PACKAGES.$(BITS))
 
+ifeq   ($(strip $(PARFAIT_BUILD)),yes)
+CC.studio.32 =	$(WS_TOOLS)/parfait/cc
+CXX.studio.32 =	$(WS_TOOLS)/parfait/CC
+CC.studio.64 =	$(WS_TOOLS)/parfait/cc
+CXX.studio.64 =	$(WS_TOOLS)/parfait/CC
+CC.gcc.32 =	$(WS_TOOLS)/parfait/gcc
+CXX.gcc.32 =	$(WS_TOOLS)/parfait/g++
+CC.gcc.64 =	$(WS_TOOLS)/parfait/gcc
+CXX.gcc.64 =	$(WS_TOOLS)/parfait/g++
+LD =		$(WS_TOOLS)/parfait/ld
+endif
+
+CC =		$(CC.$(COMPILER).$(BITS))
+CXX =		$(CXX.$(COMPILER).$(BITS))
+
+
 PYTHON_VENDOR_PACKAGES.32 = /usr/lib/python$(PYTHON_VERSION)/vendor-packages
 PYTHON_VENDOR_PACKAGES.64 = /usr/lib/python$(PYTHON_VERSION)/vendor-packages/64
 PYTHON_VENDOR_PACKAGES = $(PYTHON_VENDOR_PACKAGES.$(BITS))
@@ -612,7 +636,7 @@
 COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
 
 # declare these phony so that we avoid filesystem conflicts.
-.PHONY:	prep build install publish test clean clobber
+.PHONY:	prep build install publish test clean clobber parfait
 
 # If there are no tests to execute
 NO_TESTS =	test-nothing
--- a/tools/Makefile	Tue Apr 17 10:38:01 2012 -0700
+++ b/tools/Makefile	Tue Apr 17 10:40:54 2012 -0700
@@ -18,13 +18,34 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../make-rules/shared-macros.mk
 
-download setup prep build install publish validate:	time-$(MACH32).so \
-							time-$(MACH64).so
+download setup prep build install publish \
+validate:	links time-$(MACH32).so time-$(MACH64).so
+
+# generate wrappers for parfait. we need to generate them
+# with the correct compiler variables from the common makefiles because
+# some things reset the environment which causes lovely infinite
+# loops
+links:
+	$(MKDIR) parfait
+	@for i in cc CC gcc g++ ld ; do \
+		$(MKDIR) parfait ; \
+		$(RM) parfait/$$i ; \
+		echo "#!/bin/ksh" > parfait/$$i ; \
+		echo "IFS=" >> parfait/$$i ; \
+		echo "export PARFAIT_NATIVESUNCC=$(SPRO_VROOT)/bin/cc" >> parfait/$$i ; \
+		echo "export PARFAIT_NATIVESUNCXX=$(SPRO_VROOT)/bin/CC" >> parfait/$$i ; \
+		echo "export PARFAIT_NATIVEGCC=$(GCC_ROOT)/bin/gcc" >> parfait/$$i ; \
+		echo "export PARFAIT_NATIVEGXX=$(GCC_ROOT)/bin/g++" >> parfait/$$i ; \
+		echo "export PARFAIT_CLANG="$(PARFAIT_CLANG) >> parfait/$$i ; \
+		echo "exec" $(PARFAIT_ROOT)/bin/parfait-$$i '$$*' >> parfait/$$i ; \
+		chmod +x parfait/$$i ; \
+	done
+
 
 time-$(MACH64).o:			BITS=64
 time-$(MACH32).o time-$(MACH64).o:	CFLAGS += -Kpic
@@ -36,7 +57,9 @@
 	$(LD) -G -o $@ $<
 
 clean:
-	$(RM) time-*.o
+	$(RM) time-*.o time*.bc
 
 clobber:	clean
-	$(RM) time-*.so
+	$(RM) time-*.so python/pkglint/*.pyc
+	$(RM) -r parfait
+