[PyKDE] sipdistutils: setup include paths
Giovanni Bajo
rasky at develer.com
Thu Dec 15 18:00:11 GMT 2005
Phil,
while using sipdistutils as part of a larger building system, I realized
that there is a bug in the current version: the include path for the
compiler are not setup properly, so it either won't find "sip.h" while
compiling, or use whichever version is installed in the standard Python
path, which might or might not be the one matching sipconfig.
This patch fixes the problem. May you apply it for the next snapshot?
--
Giovanni Bajo
-------------- next part --------------
diff -c -p -F^def -r1.1 sipdistutils.py
*** sip-snapshot-20051130/sipdistutils.py 14 Dec 2005 18:44:02 -0000 1.1
--- sip-snapshot-20051130/sipdistutils.py 15 Dec 2005 17:58:46 -0000
*************** class build_ext (distutils.command.build
*** 35,44 ****
--- 35,56 ----
import sipconfig
cfg = sipconfig.Configuration()
return cfg.sip_bin
+
+ def _sip_inc_dir(self):
+ import sipconfig
+ cfg = sipconfig.Configuration()
+ return cfg.sip_inc_dir
def swig_sources (self, sources, extension=None):
if not self.extensions:
return
+
+ # Add the SIP include directory to the include path
+ if extension is not None:
+ extension.include_dirs.append(self._sip_inc_dir())
+ else:
+ # pre-2.4 compatibility
+ self.include_dirs.append(self._sip_inc_dir())
# Create the temporary directory if it does not exist already
if not os.path.isdir(self.build_temp):
More information about the PyQt
mailing list