components/python/python27/Makefile
changeset 1246 164605dfef4e
parent 1058 34d7aaa03423
child 1303 79b691ffbda3
--- a/components/python/python27/Makefile	Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/Makefile	Tue Apr 02 15:14:34 2013 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 
 #
 include ../../../make-rules/shared-macros.mk
@@ -40,6 +40,11 @@
 include $(WS_TOP)/make-rules/ips.mk
 include $(WS_TOP)/make-rules/lint-libraries.mk
 
+# Need to preserve timestamp for Grammar files.  If the pickle files are older, 
+# Python will try to rebuild them.  
+PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.txt
+PKGSEND_PUBLISH_OPTIONS += -T \*Grammar\*.pickle
+
 # We patch auto* files, so regenerate headers and configure
 COMPONENT_PREP_ACTION = \
 	(cd $(@D) ; autoheader ; autoconf)
@@ -91,8 +96,6 @@
 CONFIGURE_OPTIONS  +=		--with-system-ffi
 CONFIGURE_OPTIONS  +=		--without-gcc
 CONFIGURE_OPTIONS  +=		--enable-ipv6
-CONFIGURE_OPTIONS  +=		ac_cv_opt_olimit_ok=no
-CONFIGURE_OPTIONS  +=		ac_cv_olimit_ok=no
 CONFIGURE_OPTIONS  +=		CPPFLAGS="$(CPPFLAGS)"
 CONFIGURE_OPTIONS  +=		LDFLAGS="$(LDFLAGS)"
 CONFIGURE_OPTIONS  +=		CFLAGS="$(CFLAGS)"
@@ -102,27 +105,39 @@
 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
-# back to the environment so that configure can still work.  configure.in and
-# pyconfig.h.in should probably be rewhacked to do this more cleanly in the
-# future.
-CONFIGURE_OPTIONS.32  +=	ac_cv_sizeof_long=4
-CONFIGURE_OPTIONS.64  +=	ac_cv_sizeof_long=8
-
 # 64 bit shared objects need to go in a 64-bit directory
 COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python2.7/lib-dynload
 
-# common targets
-build:		$(BUILD_32_and_64)
+# Setup pyconfig.h file to support 32 & 64 bit.
+# If the /usr/lib/python2.7/lib2to3/*.pickle files are older than the related
+# *.txt files in the same directory, it will rebuild them anytime you try to
+# build a Python module.  So here we also touch the pickle files to avoid this.
+#
+COMPONENT_POST_INSTALL_ACTION= \
+            (cd $(PROTOUSRDIR) ;  \
+             $(MV) include/python2.7/pyconfig.h include/python2.7/pyconfig-$(BITS).h ; \
+             $(TOUCH) lib/python2.7/lib2to3/*.pickle)
 
-$(INSTALL_32):	$(INSTALL_64)
-
+# common targets
+$(INSTALL_32):  $(INSTALL_64)
+build:		$(BUILD_32_and_64)
 install:	$(INSTALL_32_and_64)
 
+# Using "-uall,-network" ensures all tests are run except the network tests.
+# The network tests contain many expected failures when run behind a firewall.
+# The "-v" ensures verbose mode.  You can set TESTOPTS_PYTHON_TEST to a
+# particular test if you want to run just one test.  For example, run gmake with
+# "-k" so it continues and does both 32-bit and 64-bit tests, even if there is a
+# failure, like this:
+# $ TESTOPTS_PYTHON_TEST=test_sys gmake -k test
+# Note that when a test succeeds, the builds/*/.tested file gets created.  You
+# may need to remove these files, or run "gmake clobber" or "gmake clean"
+# between tests.
+#
+COMPONENT_TEST_ENV = EXTRATESTOPTS="-v -uall,-network $(TESTOPTS_PYTHON_TEST)"
 COMPONENT_TEST_TARGETS = test
 
-test:	$(TEST_32_and_64)
+test:				$(TEST_32_and_64)
 
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)