18617452 SIZEOF_WCHAR_T undefined in pyconfig.h on 11.2 s11-update
authorJohn Beck <John.Beck@Oracle.COM>
Fri, 18 Apr 2014 16:06:16 -0700
branchs11-update
changeset 3087 a8a55bae43f3
parent 3085 73315e7681d6
child 3088 3f570a6d19b9
18617452 SIZEOF_WCHAR_T undefined in pyconfig.h on 11.2 18468472 ctypes fails for python 2.7
components/python/python26/patches/Python26-05-isalibs.patch
components/python/python27/patches/20-ctypes-util-find-library.patch
--- a/components/python/python26/patches/Python26-05-isalibs.patch	Fri Apr 18 12:06:50 2014 -0700
+++ b/components/python/python26/patches/Python26-05-isalibs.patch	Fri Apr 18 16:06:16 2014 -0700
@@ -421,28 +421,3 @@
  	hp*|HP*) if test "$GCC" = yes;
  		 then CCSHARED="-fPIC";
  		 else CCSHARED="+z";
[email protected]@ -3383,12 +3341,6 @@
- wchar_h="no"
- )
- 
--# 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([
[email protected]@ -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)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python27/patches/20-ctypes-util-find-library.patch	Fri Apr 18 16:06:16 2014 -0700
@@ -0,0 +1,41 @@
+This patch comes from upstream: http://bugs.python.org/issue5289
+If we ever upgrade to 2.7.4 or later, it will no longer be needed.
+
+--- Python-2.7.3/Lib/ctypes/util.py~
++++ Python-2.7.3/Lib/ctypes/util.py
[email protected]@ -180,6 +180,35 @@ elif os.name == "posix":
+             res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
+             return res[-1]
+ 
++    elif sys.platform == "sunos5":
++
++        def _findLib_crle(name, is64):
++            if not os.path.exists('/usr/bin/crle'):
++                return None
++
++            if is64:
++                cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
++            else:
++                cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
++
++            for line in os.popen(cmd).readlines():
++                line = line.strip()
++                if line.startswith('Default Library Path (ELF):'):
++                    paths = line.split()[4]
++
++            if not paths:
++                return None
++
++            for dir in paths.split(":"):
++                libfile = os.path.join(dir, "lib%s.so" % name)
++                if os.path.exists(libfile):
++                    return libfile
++
++            return None
++
++        def find_library(name, is64 = False):
++            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
++
+     else:
+ 
+         def _findSoname_ldconfig(name):