15799279 - Some Python 2.6 and 2.7 "gmake test" tests fail
15713641 - Unexpected shebang in /usr/lib/python2.6/test/test_pep263.py
15620181 - pyCC injects CC pro incompatible flags
RTI: 373415
--- a/components/python/python26/Makefile Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python26/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
@@ -39,6 +39,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)
@@ -85,8 +90,6 @@
CONFIGURE_OPTIONS += --enable-shared
CONFIGURE_OPTIONS += --with-system-ffi
CONFIGURE_OPTIONS += --without-gcc
-CONFIGURE_OPTIONS += ac_cv_opt_olimit_ok=no
-CONFIGURE_OPTIONS += ac_cv_olimit_ok=no
CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
CONFIGURE_OPTIONS += CCSHARED="$(CC_PIC)"
@@ -97,19 +100,39 @@
COMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
COMPONENT_BUILD_ENV += XPROFILE_DIR="$(XPROFILE_DIR)"
-COMPONENT_TEST_TARGETS = test
-
# 64 bit shared objects need to go in a 64-bit directory
COMPONENT_INSTALL_ARGS.64 += DESTSHARED=$(CONFIGURE_PREFIX)/lib/python2.6/lib-dynload
+# Setup pyconfig.h file to support 32 & 64 bit.
+# If the /usr/lib/python2.6/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.6/pyconfig.h include/python2.6/pyconfig-$(BITS).h ; \
+ $(TOUCH) lib/python2.6/lib2to3/*.pickle)
+
# common targets
+$(INSTALL_32): $(INSTALL_64)
build: $(BUILD_32_and_64)
-
-$(INSTALL_32): $(INSTALL_64)
-
install: $(INSTALL_32_and_64)
-test: $(TEST_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)
BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/files/pyconfig.h Tue Apr 02 15:14:34 2013 -0700
@@ -0,0 +1,5 @@
+#ifdef _LP64
+#include <pyconfig-64.h>
+#else
+#include <pyconfig-32.h>
+#endif
--- a/components/python/python26/patches/Python26-05-isalibs.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python26/patches/Python26-05-isalibs.patch Tue Apr 02 15:14:34 2013 -0700
@@ -1,3 +1,7 @@
+This patch ensures that 64-bit shared objects are in a subdirectory named
+"64". Note that changes to the Lib/distutils/tests/test_build_ext.py avoids
+running tests that fail due to this patch.
+
diff --git Python-2.6.4/Lib/distutils/command/build_ext.py Python-2.6.4/Lib/distutils/command/build_ext.py
--- Python-2.6.4/Lib/distutils/command/build_ext.py
+++ Python-2.6.4/Lib/distutils/command/build_ext.py
@@ -178,271 +182,82 @@
#ifdef MS_WINDOWS
#include <windows.h>
-diff --git Python-2.6.4/configure.in Python-2.6.4/configure.in
---- Python-2.6.4/configure.in
-+++ Python-2.6.4/configure.in
-@@ -17,8 +17,44 @@
- AH_TOP([
- #ifndef Py_PYCONFIG_H
- #define Py_PYCONFIG_H
-+
- ])
- AH_BOTTOM([
-+
-+#include <sys/isa_defs.h>
-+
-+/*
-+ * Python originally defined these statically, which prevents a 32-64 python
-+ * from working at all.
-+ */
-+
-+#define SIZEOF_SHORT 2
-+#define SIZEOF_INT 4
-+#define SIZEOF_LONG_LONG 8
-+#define SIZEOF_FPOS_T 8
-+#define SIZEOF_OFF_T 8
-+#define SIZEOF_PTHREAD_T 4
-+
-+#ifdef _LP64
-+#define SIZEOF_LONG 8
-+#define SIZEOF_UINTPTR_T 8
-+#define SIZEOF_VOID_P 8
-+#define SIZEOF_TIME_T 8
-+#define SIZEOF_SIZE_T 8
-+#define SIZEOF_LONG_DOUBLE 16
-+#else
-+#define SIZEOF_LONG 4
-+#define SIZEOF_UINTPTR_T 4
-+#define SIZEOF_VOID_P 4
-+#define SIZEOF_TIME_T 4
-+#define SIZEOF_SIZE_T 4
-+#if defined(__i386)
-+#define SIZEOF_LONG_DOUBLE 12
-+#else
-+#define SIZEOF_LONG_DOUBLE 16
-+#endif
-+#endif
-+
- /* Define the macros needed if on a UnixWare 7.x system. */
- #if defined(__USLC__) && defined(__SCO_VERSION__)
- #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
-@@ -65,6 +101,26 @@
-
- define_xopen_source=yes
+--- Python-2.6.8/Lib/distutils/tests/test_build_ext.py-orig 2012-12-19 13:05:48.515214566 -0800
++++ Python-2.6.8/Lib/distutils/tests/test_build_ext.py 2012-12-19 13:06:57.350118059 -0800
+@@ -266,7 +266,6 @@ class BuildExtTestCase(support.TempdirMa
+ self.assertEquals(os.path.splitext(so_file)[-1],
+ sysconfig.get_config_var('SO'))
+ so_dir = os.path.dirname(so_file)
+- self.assertEquals(so_dir, other_tmp_dir)
+ cmd.compiler = None
+ cmd.inplace = 0
+ cmd.run()
+@@ -275,7 +275,6 @@ class BuildExtTestCase(support.TempdirMa
+ self.assertEquals(os.path.splitext(so_file)[-1],
+ sysconfig.get_config_var('SO'))
+ so_dir = os.path.dirname(so_file)
+- self.assertEquals(so_dir, cmd.build_lib)
-+# AC_CHECK_SIZEOF without the AC_DEFINE_UNQUOTED
-+AC_DEFUN([PY_CHECK_SIZEOF],
-+[AS_LITERAL_IF([$1], [],
-+ [AC_FATAL([$0: requires literal arguments])])dnl
-+AC_CHECK_TYPE([$1], [], [], [$3])
-+AC_CACHE_CHECK([size of $1], AS_TR_SH([ac_cv_sizeof_$1]),
-+[if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
-+ # The cast to unsigned long works around a bug in the HP C Compiler
-+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-+ # This bug is HP SR number 8606223364.
-+ _AC_COMPUTE_INT([(long) (sizeof ($1))],
-+ [AS_TR_SH([ac_cv_sizeof_$1])],
-+ [AC_INCLUDES_DEFAULT([$3])],
-+ [AC_MSG_FAILURE([cannot compute sizeof ($1), 77])])
-+else
-+ AS_TR_SH([ac_cv_sizeof_$1])=0
-+fi])dnl
-+])# PY_CHECK_SIZEOF
-+
- # Arguments passed to configure.
- AC_SUBST(CONFIG_ARGS)
- CONFIG_ARGS="$ac_configure_args"
-@@ -1436,14 +1492,10 @@
+ # inplace = 0, cmd.package = 'bar'
+ build_py = cmd.get_finalized_command('build_py')
+@@ -283,7 +283,6 @@ class BuildExtTestCase(support.TempdirMa
+ path = cmd.get_ext_fullpath('foo')
+ # checking that the last directory is the build_dir
+ path = os.path.split(path)[0]
+- self.assertEquals(path, cmd.build_lib)
- # Sizes of various common basic types
- # ANSI C requires sizeof(char) == 1, so no need to check it
--AC_CHECK_SIZEOF(int, 4)
--AC_CHECK_SIZEOF(long, 4)
--AC_CHECK_SIZEOF(void *, 4)
- AC_CHECK_SIZEOF(short, 2)
- AC_CHECK_SIZEOF(float, 4)
- AC_CHECK_SIZEOF(double, 8)
--AC_CHECK_SIZEOF(fpos_t, 4)
--AC_CHECK_SIZEOF(size_t, 4)
-+AC_CHECK_SIZEOF(short)
- AC_CHECK_SIZEOF(pid_t, 4)
-
- AC_MSG_CHECKING(for long long support)
-@@ -1453,9 +1505,6 @@
- have_long_long=yes
- ])
- AC_MSG_RESULT($have_long_long)
--if test "$have_long_long" = yes ; then
--AC_CHECK_SIZEOF(long long, 8)
--fi
+ # inplace = 1, cmd.package = 'bar'
+ cmd.inplace = 1
+@@ -297,7 +297,6 @@ class BuildExtTestCase(support.TempdirMa
+ # checking that the last directory is bar
+ path = os.path.split(path)[0]
+ lastdir = os.path.split(path)[-1]
+- self.assertEquals(lastdir, 'bar')
- AC_MSG_CHECKING(for long double support)
- have_long_double=no
-@@ -1463,10 +1512,6 @@
- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
- have_long_double=yes
- ])
--AC_MSG_RESULT($have_long_double)
--if test "$have_long_double" = yes ; then
--AC_CHECK_SIZEOF(long double, 12)
--fi
-
- AC_MSG_CHECKING(for _Bool support)
- have_c99_bool=no
-@@ -1480,106 +1525,25 @@
- fi
-
- AC_CHECK_TYPES(uintptr_t,
-- [AC_CHECK_SIZEOF(uintptr_t, 4)],
-+ [],
- [], [#ifdef HAVE_STDINT_H
- #include <stdint.h>
- #endif])
-
+ def test_ext_fullpath(self):
+ ext = sysconfig.get_config_vars()['SO']
+@@ -309,14 +309,12 @@ class BuildExtTestCase(support.TempdirMa
+ curdir = os.getcwd()
+ wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
+ path = cmd.get_ext_fullpath('lxml.etree')
+- self.assertEquals(wanted, path)
--# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
--AC_MSG_CHECKING(size of off_t)
--AC_CACHE_VAL(ac_cv_sizeof_off_t,
--[AC_TRY_RUN([#include <stdio.h>
-+PY_CHECK_SIZEOF(off_t,4,[
-+#include <stdio.h>
-+#include <stdlib.h>
- #include <sys/types.h>
--main()
--{
-- FILE *f=fopen("conftestval", "w");
-- if (!f) exit(1);
-- fprintf(f, "%d\n", sizeof(off_t));
-- exit(0);
--}],
--ac_cv_sizeof_off_t=`cat conftestval`,
--ac_cv_sizeof_off_t=0,
--ac_cv_sizeof_off_t=4)
--])
--AC_MSG_RESULT($ac_cv_sizeof_off_t)
--AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
--[The number of bytes in an off_t.])
--
--AC_MSG_CHECKING(whether to enable large file support)
--if test "$have_long_long" = yes
--then
--if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
-- "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
-- AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
-- [Defined to enable large file support when an off_t is bigger than a long
-- and long long is available and at least as big as an off_t. You may need
-- to add some flags for configuration and compilation to enable this mode.
-- (For Solaris and Linux, the necessary defines are already defined.)])
-- AC_MSG_RESULT(yes)
--else
-- AC_MSG_RESULT(no)
--fi
--else
-- AC_MSG_RESULT(no)
--fi
--
--# AC_CHECK_SIZEOF() doesn't include <time.h>.
--AC_MSG_CHECKING(size of time_t)
--AC_CACHE_VAL(ac_cv_sizeof_time_t,
--[AC_TRY_RUN([#include <stdio.h>
--#include <time.h>
--main()
--{
-- FILE *f=fopen("conftestval", "w");
-- if (!f) exit(1);
-- fprintf(f, "%d\n", sizeof(time_t));
-- exit(0);
--}],
--ac_cv_sizeof_time_t=`cat conftestval`,
--ac_cv_sizeof_time_t=0,
--ac_cv_sizeof_time_t=4)
- ])
--AC_MSG_RESULT($ac_cv_sizeof_time_t)
--AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
--[The number of bytes in a time_t.])
--
+ # building lxml.etree not inplace
+ cmd.inplace = 0
+ cmd.build_lib = os.path.join(curdir, 'tmpdir')
+ wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
+ path = cmd.get_ext_fullpath('lxml.etree')
+- self.assertEquals(wanted, path)
+
+ # building twisted.runner.portmap not inplace
+ build_py = cmd.get_finalized_command('build_py')
+@@ -325,13 +325,11 @@ class BuildExtTestCase(support.TempdirMa
+ path = cmd.get_ext_fullpath('twisted.runner.portmap')
+ wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
+ 'portmap' + ext)
+- self.assertEquals(wanted, path)
--# if have pthread_t then define SIZEOF_PTHREAD_T
--ac_save_cc="$CC"
--if test "$ac_cv_kpthread" = "yes"
--then CC="$CC -Kpthread"
--elif test "$ac_cv_kthread" = "yes"
--then CC="$CC -Kthread"
--elif test "$ac_cv_pthread" = "yes"
--then CC="$CC -pthread"
--fi
--AC_MSG_CHECKING(for pthread_t)
--have_pthread_t=no
--AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
--AC_MSG_RESULT($have_pthread_t)
--if test "$have_pthread_t" = yes ; then
-- # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
-- AC_MSG_CHECKING(size of pthread_t)
-- AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
-- [AC_TRY_RUN([#include <stdio.h>
--#include <pthread.h>
-- main()
-- {
-- FILE *f=fopen("conftestval", "w");
-- if (!f) exit(1);
-- fprintf(f, "%d\n", sizeof(pthread_t));
-- exit(0);
-- }],
-- ac_cv_sizeof_pthread_t=`cat conftestval`,
-- ac_cv_sizeof_pthread_t=0,
-- ac_cv_sizeof_pthread_t=4)
-- ])
-- AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
-- AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
-- [The number of bytes in a pthread_t.])
--fi
--CC="$ac_save_cc"
-+AC_MSG_CHECKING(whether to enable large file support)
-+AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
-+[Defined to enable large file support when an off_t is bigger than a long
-+ and long long is available and at least as big as an off_t. You may need
-+ to add some flags for configuration and compilation to enable this mode.
-+ (For Solaris and Linux, the necessary defines are already defined.)])
-+AC_MSG_RESULT(yes)
+ # building twisted.runner.portmap inplace
+ cmd.inplace = 1
+ path = cmd.get_ext_fullpath('twisted.runner.portmap')
+ wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
+- self.assertEquals(wanted, path)
- AC_MSG_CHECKING(for --enable-toolbox-glue)
- AC_ARG_ENABLE(toolbox-glue,
-@@ -1873,12 +1837,6 @@
- if test -z "$CCSHARED"
- then
- case $ac_sys_system/$ac_sys_release in
-- SunOS*) if test "$GCC" = yes;
-- then CCSHARED="-fPIC";
-- elif test `uname -p` = sparc;
-- then CCSHARED="-xcode=pic32";
-- else CCSHARED="-Kpic";
-- fi;;
- hp*|HP*) if test "$GCC" = yes;
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
-@@ -3383,12 +3341,6 @@
- wchar_h="no"
- )
+ def test_build_ext_inplace(self):
+ etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c')
+@@ -346,7 +346,6 @@ class BuildExtTestCase(support.TempdirMa
+ ext = sysconfig.get_config_var("SO")
+ wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
+ path = cmd.get_ext_fullpath('lxml.etree')
+- self.assertEquals(wanted, path)
--# determine wchar_t size
--if test "$wchar_h" = yes
--then
-- AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
--fi
--
- AC_MSG_CHECKING(for UCS-4 tcl)
- have_ucs4_tcl=no
- AC_TRY_COMPILE([
-@@ -3419,6 +3371,11 @@
- ac_cv_wchar_t_signed=no,
- ac_cv_wchar_t_signed=yes)])
- AC_MSG_RESULT($ac_cv_wchar_t_signed)
-+
-+ PY_CHECK_SIZEOF(wchar_t, 4, [
-+ #include <wchar.h>
-+ #include <stdlib.h>
-+ ])
- fi
-
- AC_MSG_CHECKING(what type to use for unicode)
+ def test_setuptools_compat(self):
+ try:
+@@ -379,7 +379,6 @@ class BuildExtTestCase(support.TempdirMa
+ ext_name = os.path.join('UpdateManager', 'fdsend')
+ ext_path = cmd.get_ext_fullpath(ext_name)
+ wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' + ext)
+- self.assertEquals(ext_path, wanted)
+
+ def test_build_ext_path_cross_platform(self):
+ if sys.platform != 'win32':
--- a/components/python/python26/patches/Python26-07-dtrace.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python26/patches/Python26-07-dtrace.patch Tue Apr 02 15:14:34 2013 -0700
@@ -1,3 +1,7 @@
+This patch adds Python dtrace support. Note it is necessary to modify
+test_sys.py to add an integer to the frameobject structure size since this
+patch adds "int f_calllineno" to the structure, so this test does not fail.
+
diff --git Python-2.6.4/Include/frameobject.h Python-2.6.4/Include/frameobject.h
--- Python-2.6.4/Include/frameobject.h
+++ Python-2.6.4/Include/frameobject.h
@@ -414,3 +418,14 @@
+#pragma D attributes Private/Private/Common provider python function
+#pragma D attributes Evolving/Evolving/Common provider python name
+#pragma D attributes Evolving/Evolving/Common provider python args
+--- Python-2.6.8/Lib/test/test_sys.py-orig 2012-12-13 06:54:26.954676255 -0800
++++ Python-2.6.8/Lib/test/test_sys.py 2012-12-13 06:54:37.809978034 -0800
+@@ -587,7 +587,7 @@ class SizeofTest(unittest.TestCase):
+ nfrees = len(x.f_code.co_freevars)
+ extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
+ ncells + nfrees - 1
+- check(x, size(vh + '12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
++ check(x, size(vh + '12P4i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
+ # function
+ def func(): pass
+ check(func, size(h + '9P'))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-28-pep263.patch Tue Apr 02 15:14:34 2013 -0700
@@ -0,0 +1,10 @@
+Backported this code change from Python 2.7 to avoid a test failure.
+
+--- Python-2.6.8/Lib/test/test_pep263.py-orig 2012-12-19 13:33:11.257595413 -0800
++++ Python-2.6.8/Lib/test/test_pep263.py 2012-12-19 13:33:17.715857751 -0800
+@@ -1,3 +1,5 @@
++# -*- coding: koi8-r -*-
++
+ #!/usr/bin/python2.6
+
+ import unittest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-29-ossaudiodev.patch Tue Apr 02 15:14:34 2013 -0700
@@ -0,0 +1,59 @@
+This patch is needed to make Python understand it can build the OSS plugin.
+Some OSS ioctls are not supported on Solaris, so they are commented out.
+
+--- Python-2.6.8/Modules/ossaudiodev.c-orig 2012-12-20 12:18:06.404742520 -0600
++++ Python-2.6.8/Modules/ossaudiodev.c 2012-12-20 12:21:01.352610160 -0600
+@@ -1038,6 +1038,7 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SOUND_MIXER_MONITOR);
+ #endif
+
++#ifndef __sun
+ /* Expose all the ioctl numbers for masochists who like to do this
+ stuff directly. */
+ _EXPORT_INT(m, SNDCTL_COPR_HALT);
+@@ -1050,6 +1051,7 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
+ _EXPORT_INT(m, SNDCTL_COPR_WCODE);
+ _EXPORT_INT(m, SNDCTL_COPR_WDATA);
++#endif
+ #ifdef SNDCTL_DSP_BIND_CHANNEL
+ _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
+ #endif
+@@ -1071,8 +1073,12 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF);
+ #endif
+ _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER);
++#ifdef SNDCTL_DSP_MAPINBUF
+ _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF);
++#endif
++#ifdef SNDCTL_DSP_MAPOUTBUF
+ _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF);
++#endif
+ _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK);
+ _EXPORT_INT(m, SNDCTL_DSP_POST);
+ #ifdef SNDCTL_DSP_PROFILE
+@@ -1092,6 +1098,7 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_DSP_STEREO);
+ _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
+ _EXPORT_INT(m, SNDCTL_DSP_SYNC);
++#ifndef __sun
+ _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
+ _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
+ _EXPORT_INT(m, SNDCTL_MIDI_INFO);
+@@ -1133,4 +1140,5 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_TMR_STOP);
+ _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
+ _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);
++#endif
+ }
+--- Python-2.6.8/setup.py-orig 2012-12-20 12:18:00.466612795 -0600
++++ Python-2.6.8/setup.py 2012-12-20 12:18:54.828151818 -0600
+@@ -1518,7 +1518,7 @@ class PyBuildExt(build_ext):
+ else:
+ missing.append('linuxaudiodev')
+
+- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
++ if platform in ('sunos5', 'linux2', 'freebsd4', 'freebsd5', 'freebsd6',
+ 'freebsd7', 'freebsd8'):
+ exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
+ else:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-30-pycc.patch Tue Apr 02 15:14:34 2013 -0700
@@ -0,0 +1,13 @@
+This fixes CR #15620181. Makes pycc work with Sun Studio.
+
+--- Python-2.6.8/pycc-orig 2013-01-23 12:09:28.026626781 -0800
++++ Python-2.6.8/pycc 2013-01-23 12:09:47.765962711 -0800
+@@ -150,7 +150,7 @@ extra_flags=
+
+ is_gcc=no
+
+-$CC --version >/dev/null 2>&1 && is_gcc=yes
++$CC --version 2>/dev/null | /usr/xpg4/bin/grep -q GCC && is_gcc=yes
+
+ if [ "$is_gcc" = yes ]; then
+ for flag in "${@}"; do
--- a/components/python/python26/python-26.p5m Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python26/python-26.p5m Tue Apr 02 15:14:34 2013 -0700
@@ -146,7 +146,9 @@
file path=usr/include/python2.6/pgenheaders.h
file path=usr/include/python2.6/py_curses.h
file path=usr/include/python2.6/pyarena.h
-file path=usr/include/python2.6/pyconfig.h
+file files/pyconfig.h path=usr/include/python2.6/pyconfig.h
+file path=usr/include/python2.6/pyconfig-32.h
+file path=usr/include/python2.6/pyconfig-64.h
file path=usr/include/python2.6/pydebug.h
file path=usr/include/python2.6/pyerrors.h
file path=usr/include/python2.6/pyexpat.h
@@ -648,6 +650,7 @@
file path=usr/lib/python2.6/lib-dynload/64/mmap.so
file path=usr/lib/python2.6/lib-dynload/64/nis.so
file path=usr/lib/python2.6/lib-dynload/64/operator.so
+file path=usr/lib/python2.6/lib-dynload/64/ossaudiodev.so
file path=usr/lib/python2.6/lib-dynload/64/parser.so
file path=usr/lib/python2.6/lib-dynload/64/privileges.so
file path=usr/lib/python2.6/lib-dynload/64/pyexpat.so
@@ -717,6 +720,7 @@
file path=usr/lib/python2.6/lib-dynload/mmap.so
file path=usr/lib/python2.6/lib-dynload/nis.so
file path=usr/lib/python2.6/lib-dynload/operator.so
+file path=usr/lib/python2.6/lib-dynload/ossaudiodev.so
file path=usr/lib/python2.6/lib-dynload/parser.so
file path=usr/lib/python2.6/lib-dynload/privileges.so
file path=usr/lib/python2.6/lib-dynload/pyexpat.so
--- 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)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python27/files/pyconfig.h Tue Apr 02 15:14:34 2013 -0700
@@ -0,0 +1,5 @@
+#ifdef _LP64
+#include <pyconfig-64.h>
+#else
+#include <pyconfig-32.h>
+#endif
--- a/components/python/python27/patches/00-bits.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/patches/00-bits.patch Tue Apr 02 15:14:34 2013 -0700
@@ -12,131 +12,6 @@
AC_REVISION($Revision$)
AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
-@@ -35,6 +35,41 @@
- #define Py_PYCONFIG_H
- ])
- AH_BOTTOM([
-+
-+#include <sys/isa_defs.h>
-+
-+/*
-+ * Python originally defined these statically, which prevents a 32-64 python
-+ * from working at all.
-+ */
-+
-+#define SIZEOF_SHORT 2
-+#define SIZEOF_INT 4
-+#define SIZEOF_LONG_LONG 8
-+#define SIZEOF_FPOS_T 8
-+#define SIZEOF_OFF_T 8
-+#define SIZEOF_PTHREAD_T 4
-+
-+#ifdef _LP64
-+#define SIZEOF_LONG 8
-+#define SIZEOF_UINTPTR_T 8
-+#define SIZEOF_VOID_P 8
-+#define SIZEOF_TIME_T 8
-+#define SIZEOF_SIZE_T 8
-+#define SIZEOF_LONG_DOUBLE 16
-+#else
-+#define SIZEOF_LONG 4
-+#define SIZEOF_UINTPTR_T 4
-+#define SIZEOF_VOID_P 4
-+#define SIZEOF_TIME_T 4
-+#define SIZEOF_SIZE_T 4
-+#if defined(__i386)
-+#define SIZEOF_LONG_DOUBLE 12
-+#else
-+#define SIZEOF_LONG_DOUBLE 16
-+#endif
-+#endif
-+
- /* Define the macros needed if on a UnixWare 7.x system. */
- #if defined(__USLC__) && defined(__SCO_VERSION__)
- #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
-@@ -1474,13 +1509,13 @@
- # Sizes of various common basic types
- # ANSI C requires sizeof(char) == 1, so no need to check it
- AC_CHECK_SIZEOF(int, 4)
--AC_CHECK_SIZEOF(long, 4)
--AC_CHECK_SIZEOF(void *, 4)
-+dnl AC_CHECK_SIZEOF(long, 4)
-+dnl AC_CHECK_SIZEOF(void *, 4)
- AC_CHECK_SIZEOF(short, 2)
- AC_CHECK_SIZEOF(float, 4)
- AC_CHECK_SIZEOF(double, 8)
- AC_CHECK_SIZEOF(fpos_t, 4)
--AC_CHECK_SIZEOF(size_t, 4)
-+dnl AC_CHECK_SIZEOF(size_t, 4)
- AC_CHECK_SIZEOF(pid_t, 4)
-
- AC_MSG_CHECKING(for long long support)
-@@ -1501,9 +1536,9 @@
- have_long_double=yes
- ],[])
- AC_MSG_RESULT($have_long_double)
--if test "$have_long_double" = yes ; then
--AC_CHECK_SIZEOF(long double, 12)
--fi
-+dnl if test "$have_long_double" = yes ; then
-+dnl AC_CHECK_SIZEOF(long double, 12)
-+dnl fi
-
- AC_MSG_CHECKING(for _Bool support)
- have_c99_bool=no
-@@ -1517,7 +1552,7 @@
- fi
-
- AC_CHECK_TYPES(uintptr_t,
-- [AC_CHECK_SIZEOF(uintptr_t, 4)],
-+ [],
- [], [#ifdef HAVE_STDINT_H
- #include <stdint.h>
- #endif
-@@ -1534,8 +1569,8 @@
- AC_MSG_CHECKING(whether to enable large file support)
- if test "$have_long_long" = yes
- then
--if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
-- "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
-+dnl if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
-+dnl "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
- AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
- [Defined to enable large file support when an off_t is bigger than a long
- and long long is available and at least as big as an off_t. You may need
-@@ -1542,21 +1577,21 @@
- to add some flags for configuration and compilation to enable this mode.
- (For Solaris and Linux, the necessary defines are already defined.)])
- AC_MSG_RESULT(yes)
-+dnl else
-+dnl AC_MSG_RESULT(no)
-+dnl fi
- else
- AC_MSG_RESULT(no)
- fi
--else
-- AC_MSG_RESULT(no)
--fi
-
--AC_CHECK_SIZEOF(time_t, [], [
--#ifdef HAVE_SYS_TYPES_H
--#include <sys/types.h>
--#endif
--#ifdef HAVE_TIME_H
--#include <time.h>
--#endif
--])
-+dnl AC_CHECK_SIZEOF(time_t, [], [
-+dnl #ifdef HAVE_SYS_TYPES_H
-+dnl #include <sys/types.h>
-+dnl #endif
-+dnl #ifdef HAVE_TIME_H
-+dnl #include <time.h>
-+dnl #endif
-+dnl ])
-
- # if have pthread_t then define SIZEOF_PTHREAD_T
- ac_save_cc="$CC"
@@ -1906,12 +1941,6 @@
if test -z "$CCSHARED"
then
--- a/components/python/python27/patches/05-dtrace.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/patches/05-dtrace.patch Tue Apr 02 15:14:34 2013 -0700
@@ -1,3 +1,7 @@
+This patch adds Python dtrace support. Note it is necessary to modify
+test_sys.py to add an integer to the frameobject structure size since this
+patch adds "int f_calllineno" to the structure, so this test does not fail.
+
--- Python-2.7.1/Makefile.pre.in.~1~ Thu Oct 14 06:37:30 2010
+++ Python-2.7.1/Makefile.pre.in Mon Jul 18 14:53:46 2011
@@ -198,6 +198,7 @@
@@ -414,3 +418,14 @@
+#pragma D attributes Private/Private/Common provider python function
+#pragma D attributes Evolving/Evolving/Common provider python name
+#pragma D attributes Evolving/Evolving/Common provider python args
+--- Python-2.7.3/Lib/test/test_sys.py-orig 2012-12-13 06:50:00.472682534 -0800
++++ Python-2.7.3/Lib/test/test_sys.py 2012-12-13 06:50:20.099858756 -0800
+@@ -645,7 +645,7 @@ class SizeofTest(unittest.TestCase):
+ nfrees = len(x.f_code.co_freevars)
+ extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
+ ncells + nfrees - 1
+- check(x, size(vh + '12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
++ check(x, size(vh + '12P4i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
+ # function
+ def func(): pass
+ check(func, size(h + '9P'))
--- a/components/python/python27/patches/06-ucred.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/patches/06-ucred.patch Tue Apr 02 15:14:34 2013 -0700
@@ -1,3 +1,5 @@
+This patch provides Python ucred support.
+
diff --git Python-2.6.4/Modules/ucred.c Python-2.6.4/Modules/ucred.c
new file mode 100644
--- /dev/null
@@ -415,7 +417,7 @@
--- /dev/null 2011-02-12 03:14:16.000000000 -0600
+++ Python-2.6.4/Lib/test/ucredtest.py 2011-01-20 13:52:42.945657919 -0600
@@ -0,0 +1,45 @@
-+#!/usr/bin/python2.6
++#!/usr/bin/python2.7
+
+import ucred
+import os
--- a/components/python/python27/patches/07-dlpi.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/patches/07-dlpi.patch Tue Apr 02 15:14:34 2013 -0700
@@ -1,3 +1,5 @@
+This patch provides Python dlpi support.
+
diff --git Python-2.6.4/Modules/dlpimodule.c Python-2.6.4/Modules/dlpimodule.c
new file mode 100644
--- /dev/null
@@ -1229,7 +1231,7 @@
--- /dev/null 2011-02-12 03:13:26.000000000 -0600
+++ Python-2.6.4/Lib/test/dlpitest.py 2011-01-20 13:52:42.895865414 -0600
@@ -0,0 +1,96 @@
-+#!/usr/bin/python2.6
++#!/usr/bin/python2.7
+
+import dlpi
+import sys
--- a/components/python/python27/patches/09-rbac.patch Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/patches/09-rbac.patch Tue Apr 02 15:14:34 2013 -0700
@@ -1,3 +1,5 @@
+This patch provides Python RBAC support.
+
diff --git Python-2.6.4/Modules/authattr.c Python-2.6.4/Modules/authattr.c
new file mode 100644
--- /dev/null
@@ -1283,7 +1285,7 @@
--- /dev/null 2011-02-12 03:13:57.000000000 -0600
+++ Python-2.6.4/Lib/test/privrbactest.py 2011-01-20 13:52:42.862305331 -0600
@@ -0,0 +1,289 @@
-+#!/usr/bin/python2.6
++#!/usr/bin/python2.7
+#
+# CDDL HEADER START
+#
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python27/patches/16-ossaudiodev.patch Tue Apr 02 15:14:34 2013 -0700
@@ -0,0 +1,59 @@
+This patch is needed to make Python understand it can build the OSS plugin.
+Some OSS ioctls are not supported on Solaris, so they are commented out.
+
+--- Python-2.7.3/Modules/ossaudiodev.c-orig 2012-12-20 12:26:23.028233427 -0600
++++ Python-2.7.3/Modules/ossaudiodev.c 2012-12-20 12:26:33.130986175 -0600
+@@ -1044,6 +1044,7 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SOUND_MIXER_MONITOR);
+ #endif
+
++#ifndef __sun
+ /* Expose all the ioctl numbers for masochists who like to do this
+ stuff directly. */
+ _EXPORT_INT(m, SNDCTL_COPR_HALT);
+@@ -1056,6 +1057,7 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
+ _EXPORT_INT(m, SNDCTL_COPR_WCODE);
+ _EXPORT_INT(m, SNDCTL_COPR_WDATA);
++#endif
+ #ifdef SNDCTL_DSP_BIND_CHANNEL
+ _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
+ #endif
+@@ -1077,8 +1079,12 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF);
+ #endif
+ _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER);
++#ifdef SNDCTL_DSP_MAPINBUF
+ _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF);
++#endif
++#ifdef SNDCTL_DSP_MAPOUTBUF
+ _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF);
++#endif
+ _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK);
+ _EXPORT_INT(m, SNDCTL_DSP_POST);
+ #ifdef SNDCTL_DSP_PROFILE
+@@ -1098,6 +1104,7 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_DSP_STEREO);
+ _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
+ _EXPORT_INT(m, SNDCTL_DSP_SYNC);
++#ifndef __sun
+ _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
+ _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
+ _EXPORT_INT(m, SNDCTL_MIDI_INFO);
+@@ -1139,4 +1146,5 @@ initossaudiodev(void)
+ _EXPORT_INT(m, SNDCTL_TMR_STOP);
+ _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
+ _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);
++#endif
+ }
+--- Python-2.7.3/setup.py-orig 2012-12-20 12:26:17.244961277 -0600
++++ Python-2.7.3/setup.py 2012-12-20 12:27:23.938119947 -0600
+@@ -1509,7 +1509,7 @@ class PyBuildExt(build_ext):
+ else:
+ missing.append('linuxaudiodev')
+
+- if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
++ if (platform in ('sunos5', 'linux2', 'freebsd4', 'freebsd5', 'freebsd6',
+ 'freebsd7', 'freebsd8')
+ or platform.startswith("gnukfreebsd")):
+ exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
--- a/components/python/python27/python-27.p5m Tue Apr 02 08:43:27 2013 -0700
+++ b/components/python/python27/python-27.p5m Tue Apr 02 15:14:34 2013 -0700
@@ -171,7 +171,9 @@
file path=usr/include/python2.7/py_curses.h
file path=usr/include/python2.7/pyarena.h
file path=usr/include/python2.7/pycapsule.h
-file path=usr/include/python2.7/pyconfig.h
+file files/pyconfig.h path=usr/include/python2.7/pyconfig.h
+file path=usr/include/python2.7/pyconfig-32.h
+file path=usr/include/python2.7/pyconfig-64.h
file path=usr/include/python2.7/pyctype.h
file path=usr/include/python2.7/pydebug.h
file path=usr/include/python2.7/pyerrors.h
@@ -699,6 +701,7 @@
file path=usr/lib/python2.7/lib-dynload/64/mmap.so
file path=usr/lib/python2.7/lib-dynload/64/nis.so
file path=usr/lib/python2.7/lib-dynload/64/operator.so
+file path=usr/lib/python2.7/lib-dynload/64/ossaudiodev.so
file path=usr/lib/python2.7/lib-dynload/64/parser.so
file path=usr/lib/python2.7/lib-dynload/64/privileges.so
file path=usr/lib/python2.7/lib-dynload/64/pyexpat.so
@@ -765,6 +768,7 @@
file path=usr/lib/python2.7/lib-dynload/mmap.so
file path=usr/lib/python2.7/lib-dynload/nis.so
file path=usr/lib/python2.7/lib-dynload/operator.so
+file path=usr/lib/python2.7/lib-dynload/ossaudiodev.so
file path=usr/lib/python2.7/lib-dynload/parser.so
file path=usr/lib/python2.7/lib-dynload/privileges.so
file path=usr/lib/python2.7/lib-dynload/pyexpat.so