components/python/python27/Makefile
changeset 634 bd9c94f9f6e0
parent 609 775168282b2f
child 774 d0cbca26a17c
--- a/components/python/python27/Makefile	Tue Dec 20 10:39:45 2011 -0800
+++ b/components/python/python27/Makefile	Tue Dec 20 17:19:09 2011 -0800
@@ -54,6 +54,18 @@
 # build pic
 CFLAGS +=	$(CC_PIC)
 
+# The python build is profile-guided for studio; to see the benefits of that,
+# Python must be compiled with -xO5 and a different build target must be used.
+# Use of xprofile requires that the same options be used during compilation and
+# linking.  The targets chosen are based on Solaris 11 minimum supported system
+# requirements.
+COMPONENT_BUILD_TARGETS = profile-opt
+XPROFILE_DIR = $(BUILD_DIR_$(BITS))/.profile
+PYFLAGS.i386 = -xtarget=opteron -xarch=sse2 -xcache=generic
+PYFLAGS.sparc =
+CFLAGS += -xO5 $(PYFLAGS.$(MACH))
+LDFLAGS += -xO5 $(PYFLAGS.$(MACH))
+
 # add /usr/gnu/lib to the library search/run path
 LDFLAGS.32 = -R/usr/gnu/lib -L/usr/gnu/lib
 LDFLAGS.64 = -R/usr/gnu/lib/$(MACH64) -L/usr/gnu/lib/$(MACH64)
@@ -74,8 +86,10 @@
 CONFIGURE_OPTIONS  +=		BASECFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS  +=		LDFLAGS="$(LDFLAGS)"
 CONFIGURE_OPTIONS  +=		DFLAGS="-$(BITS)"
+CONFIGURE_OPTIONS  +=		XPROFILE_DIR="$(XPROFILE_DIR)"
 
 COMPONENT_BUILD_ENV  +=		DFLAGS="-$(BITS)"
+COMPONENT_BUILD_ENV  +=		XPROFILE_DIR="$(XPROFILE_DIR)"
 
 # patches/00-bits.patch removes some AC_CHECK_SIZEOF tests in order to
 # generate a pyconfig.h that is both 32 and 64 bit compatible.  We add this