[omniORB] Patch for supporting PYDEBUG builds in omniORBpy
Floris Bruynooghe
flub at devork.be
Wed Sep 8 00:38:01 BST 2010
Hi Duncan
On Tue, Sep 07, 2010 at 03:01:30PM +0100, Duncan Grisby wrote:
> On Mon, 2010-01-11 at 18:57 +0000, Floris Bruynooghe wrote:
>
> > > > Attached is a patch that supports PYDEBUG builds for the modules of
> > > > omniORBpy.
>
> After a small delay (!), I've finally had a chance to look at this. Now
> I look, I'm confused. None of the versions of Python I have looked at
> have a sys.pydebug flag. That's true even if I build a version of Python
> with --with-pydebug.
>
> Can you explain what's going on? Is it just a Linux packaging artifact?
> If so, I'm tempted to say that support for it should also be specific to
> Linux packaging of omniORB.
It appears sys.pydebug is a Debianism indeed, I didn't realise that.
However the convention of adding _d to shared libraries is not,
upstream python does this also for their windows builds.
I've changed the patch not to use sys.pydebug but rather use
distutils.sysconfgi.get_config_var() which actually seems like a
better thing to use (in fact it might be better to use then the
sys.exec_prefix and sys.version[:3] used currently - but I left that
alone to keep the patch as minimal as possible).
So please find attached the better version of this patch.
Regards
Floris
--
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org
-------------- next part --------------
Description: Enable building for debug builds of python
This allows one to build the modules for pydebug builds in the same
tree as the normal build by following normal distutils filename
convetions for pydebug extension modules (adding _d to the name).
Forwarded: http://www.omniorb-support.com/pipermail/omniorb-list/2010-January/030475.html
Author: Floris Bruynooghe <flub at devork.be>
Last-Update: 2010-08-09
--- a/examples/embed/dir.mk
+++ b/examples/embed/dir.mk
@@ -16,8 +16,11 @@
CXXDEBUGFLAGS = -g
PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')
PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
+PYINCBASE := $(shell $(PYTHON) -c 'import distutils.sysconfig, os.path; print os.path.basename(distutils.sysconfig.get_config_var("INCLUDEPY"))')
+PY_SHAREDLIB_SUFFIX := $(shell $(PYTHON) -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_var("SHLIB_EXT")')
+
PYINCDIR := $(PYPREFIX)/include
-PYINCFILE := "<python$(PYVERSION)/Python.h>"
+PYINCFILE := "<$(PYINCBASE)/Python.h>"
DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE)
endif
@@ -26,9 +29,9 @@
namespec := _embedmodule _ 1 0
-SharedLibraryFullNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
-SharedLibrarySoNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3
-SharedLibraryLibNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX)
+SharedLibraryFullNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3.$$4
+SharedLibrarySoNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3
+SharedLibraryLibNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX)
ifdef PythonLibraryPlatformLinkFlagsTemplate
SharedLibraryPlatformLinkFlagsTemplate = $(PythonLibraryPlatformLinkFlagsTemplate)
--- a/modules/codesets/dir.mk
+++ b/modules/codesets/dir.mk
@@ -22,9 +22,12 @@
PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')
PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
+PYINCBASE := $(shell $(PYTHON) -c 'import distutils.sysconfig, os.path; print os.path.basename(distutils.sysconfig.get_config_var("INCLUDEPY"))')
+PY_SHAREDLIB_SUFFIX := $(shell $(PYTHON) -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_var("SHLIB_EXT")')
+
PYINCDIR := $(PYPREFIX)/include
-PYINCFILE := "<python$(PYVERSION)/Python.h>"
-PYINCTHRD := "<python$(PYVERSION)/pythread.h>"
+PYINCFILE := "<$(PYINCBASE)/Python.h>"
+PYINCTHRD := "<$(PYINCBASE)/pythread.h>"
DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD)
DIR_CPPFLAGS += $(CORBA_CPPFLAGS)
@@ -43,9 +46,9 @@
SHAREDLIB_SUFFIX = $(PythonSHAREDLIB_SUFFIX)
endif
-SharedLibraryFullNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
-SharedLibrarySoNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3
-SharedLibraryLibNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX)
+SharedLibraryFullNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3.$$4
+SharedLibrarySoNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3
+SharedLibraryLibNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX)
ifdef PythonLibraryPlatformLinkFlagsTemplate
SharedLibraryPlatformLinkFlagsTemplate = $(PythonLibraryPlatformLinkFlagsTemplate)
--- a/modules/connections/dir.mk
+++ b/modules/connections/dir.mk
@@ -20,9 +20,12 @@
PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')
PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
+PYINCBASE := $(shell $(PYTHON) -c 'import distutils.sysconfig, os.path; print os.path.basename(distutils.sysconfig.get_config_var("INCLUDEPY"))')
+PY_SHAREDLIB_SUFFIX := $(shell $(PYTHON) -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_var("SHLIB_EXT")')
+
PYINCDIR := $(PYPREFIX)/include
-PYINCFILE := "<python$(PYVERSION)/Python.h>"
-PYINCTHRD := "<python$(PYVERSION)/pythread.h>"
+PYINCFILE := "<$(PYINCBASE)/Python.h>"
+PYINCTHRD := "<$(PYINCBASE)/pythread.h>"
DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD)
DIR_CPPFLAGS += $(CORBA_CPPFLAGS)
@@ -50,9 +53,9 @@
SHAREDLIB_SUFFIX = $(PythonSHAREDLIB_SUFFIX)
endif
-SharedLibraryFullNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
-SharedLibrarySoNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3
-SharedLibraryLibNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX)
+SharedLibraryFullNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3.$$4
+SharedLibrarySoNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3
+SharedLibraryLibNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX)
ifdef PythonLibraryPlatformLinkFlagsTemplate
SharedLibraryPlatformLinkFlagsTemplate = $(PythonLibraryPlatformLinkFlagsTemplate)
--- a/modules/dir.mk
+++ b/modules/dir.mk
@@ -73,9 +73,12 @@
PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')
PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
+PYINCBASE := $(shell $(PYTHON) -c 'import distutils.sysconfig, os.path; print os.path.basename(distutils.sysconfig.get_config_var("INCLUDEPY"))')
+PY_SHAREDLIB_SUFFIX := $(shell $(PYTHON) -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_var("SHLIB_EXT")')
+
PYINCDIR := $(PYPREFIX)/include
-PYINCFILE := "<python$(PYVERSION)/Python.h>"
-PYINCTHRD := "<python$(PYVERSION)/pythread.h>"
+PYINCFILE := "<$(PYINCBASE)/Python.h>"
+PYINCTHRD := "<$(PYINCBASE)/pythread.h>"
DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD)
DIR_CPPFLAGS += $(CORBA_CPPFLAGS)
@@ -94,9 +97,9 @@
SHAREDLIB_SUFFIX = $(PythonSHAREDLIB_SUFFIX)
endif
-SharedLibraryFullNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
-SharedLibrarySoNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3
-SharedLibraryLibNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX)
+SharedLibraryFullNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3.$$4
+SharedLibrarySoNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3
+SharedLibraryLibNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX)
ifdef PythonLibraryPlatformLinkFlagsTemplate
SharedLibraryPlatformLinkFlagsTemplate = $(PythonLibraryPlatformLinkFlagsTemplate)
--- a/modules/sslTP/dir.mk
+++ b/modules/sslTP/dir.mk
@@ -21,9 +21,12 @@
PYPREFIX := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')
PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
+PYINCBASE := $(shell $(PYTHON) -c 'import distutils.sysconfig, os.path; print os.path.basename(distutils.sysconfig.get_config_var("INCLUDEPY"))')
+PY_SHAREDLIB_SUFFIX := $(shell $(PYTHON) -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_var("SHLIB_EXT")')
+
PYINCDIR := $(PYPREFIX)/include
-PYINCFILE := "<python$(PYVERSION)/Python.h>"
-PYINCTHRD := "<python$(PYVERSION)/pythread.h>"
+PYINCFILE := "<$(PYINCBASE)/Python.h>"
+PYINCTHRD := "<$(PYINCBASE)/pythread.h>"
DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD)
DIR_CPPFLAGS += $(CORBA_CPPFLAGS)
@@ -45,9 +48,9 @@
SHAREDLIB_SUFFIX = $(PythonSHAREDLIB_SUFFIX)
endif
-SharedLibraryFullNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
-SharedLibrarySoNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX).$$3
-SharedLibraryLibNameTemplate = $$1$$2.$(SHAREDLIB_SUFFIX)
+SharedLibraryFullNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3.$$4
+SharedLibrarySoNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX).$$3
+SharedLibraryLibNameTemplate = $$1$$2$(PY_SHAREDLIB_SUFFIX)
ifdef PythonLibraryPlatformLinkFlagsTemplate
SharedLibraryPlatformLinkFlagsTemplate = $(PythonLibraryPlatformLinkFlagsTemplate)
More information about the omniORB-list
mailing list