--- a/components/python/python26/Makefile Thu Mar 03 12:21:51 2011 -0800
+++ b/components/python/python26/Makefile Fri Mar 04 13:19:22 2011 -0800
@@ -35,6 +35,19 @@
include $(WS_TOP)/make-rules/configure.mk
include $(WS_TOP)/make-rules/ips.mk
+# We patch auto* files, so regenerate headers and configure
+COMPONENT_PREP_ACTION = \
+ (cd $(@D) ; autoheader ; autoconf)
+
+# This seems horribly wrong, but these defines break the ability to build c99
+# compliant modules or with gcc.
+COMPONENT_POST_CONFIGURE_ACTION = \
+ (cd $(@D) ; \
+ perl -pi -e 's/(^\#define _POSIX_C_SOURCE.*)/\/* $$1 *\//' pyconfig.h ; \
+ perl -pi -e 's/^(\#define _XOPEN_SOURCE.*)/\/* $$1 *\//' pyconfig.h ; \
+ perl -pi -e 's/^(\#define _XOPEN_SOURCE_EXTENDED.*)/\/* $$1 *\//' \
+ pyconfig.h)
+
#
# Until the fix for "17858 pkgdepend generate hurls on some python modules" is
# generally installed on our build systems, we need to skip the dependency
@@ -46,14 +59,20 @@
# we don't want to leak $(CC_BITS) into BASECFLAGS as it causes problems with
# python-config
-CC += $(CC_BITS)
+CC += $(CFLAGS)
C99MODE=
CPPFLAGS += -IPython
+# so we find the ncurses headers
+CPPFLAGS += -I/usr/include/ncurses
+# enable large files how they did in JDS
+CPPFLAGS += -D_LARGEFILE64_SOURCE
# libffi for _ctypes
CPPFLAGS += $(shell pkg-config --cflags-only-I libffi)
+CCFLAGS += -norunpath -compat=5
+
CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
CONFIGURE_OPTIONS += --enable-shared
CONFIGURE_OPTIONS += --disable-static
@@ -62,6 +81,10 @@
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)"
+CONFIGURE_OPTIONS += CXX="$(CCC)"
+CONFIGURE_OPTIONS += CXXFLAGS="$(CCFLAGS)"
CONFIGURE_OPTIONS += DFLAGS="-$(BITS)"
COMPONENT_BUILD_ENV += DFLAGS="-$(BITS)"
--- a/components/python/python26/patches/Python26-03-distutils-pycc.patch Thu Mar 03 12:21:51 2011 -0800
+++ b/components/python/python26/patches/Python26-03-distutils-pycc.patch Fri Mar 04 13:19:22 2011 -0800
@@ -1,7 +1,7 @@
diff --git Python-2.6.4/Lib/distutils/sysconfig.py Python-2.6.4/Lib/distutils/sysconfig.py
--- Python-2.6.4/Lib/distutils/sysconfig.py
+++ Python-2.6.4/Lib/distutils/sysconfig.py
-@@ -166,16 +166,10 @@
+@@ -166,16 +166,12 @@
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SO')
@@ -17,6 +17,8 @@
- cpp = cc + " -E" # not always
+ # On Solaris, we must always use pycc/pyCC, which will then look up
+ # $CC and $CXX
++ cc = '/usr/lib/python2.6/pycc'
++ cxx = '/usr/lib/python2.6/pyCC'
+ cpp = cc + " -E"
+
if 'LDFLAGS' in os.environ:
--- a/components/python/python26/patches/Python26-11-dlpi.patch Thu Mar 03 12:21:51 2011 -0800
+++ b/components/python/python26/patches/Python26-11-dlpi.patch Fri Mar 04 13:19:22 2011 -0800
@@ -1128,14 +1128,14 @@
+ PyObject *list = (PyObject *)arg;
+
+ if ((list == NULL) || !PyList_Check(list))
-+ return (_B_FALSE);
++ return (B_FALSE);
+
+ linkname = Py_BuildValue("s", name);
+ if (PyList_Append(list, linkname) == -1)
-+ return (_B_TRUE);
++ return (B_TRUE);
+
+ Py_DECREF(linkname);
-+ return (_B_FALSE);
++ return (B_FALSE);
+}
+
+PyDoc_STRVAR(listlink_doc,
--- a/components/python/python26/python-26.p5m Thu Mar 03 12:21:51 2011 -0800
+++ b/components/python/python26/python-26.p5m Fri Mar 04 13:19:22 2011 -0800
@@ -1618,7 +1618,7 @@
file path=usr/lib/python2.6/pty.py
file path=usr/lib/python2.6/pty.pyc
link path=usr/lib/python2.6/pyCC target=pycc
-file path=usr/lib/python2.6/pycc
+file path=usr/lib/python2.6/pycc mode=0555
file path=usr/lib/python2.6/py_compile.py
file path=usr/lib/python2.6/py_compile.pyc
file path=usr/lib/python2.6/pyclbr.py