[PyKDE] [PATCH] Building sip with MSVC.NET 2003

Miguel Lobo mlobol at gmail.com
Wed Jan 24 21:59:57 GMT 2007


>
> On 1/24/2007 8:09 PM, Miguel Lobo wrote:
>
> > I had some problems compiling sip 4.5.2 with MSVC.NET 2003.  Fortunately
> it
> > was pretty easy to solve them with a couple of changes to configure.pyand
> > siputils.py
> >
> > Please have a look at the attached patch for the changes I made.  They
> might
> > not be the optimum solution, but they work for me.
>
> Uhm, I compiled sip with .NET 2003 many times, without problems. Could
> you elaborate on what are the problems you met?
> --
> Giovanni Bajo
>

Well, if you look at the patch there are two changes.  The first one is
this:

diff -ur sip-4.5.2/configure.py sip-4.5.2-new/configure.py
--- sip-4.5.2/configure.py    Sat Dec  9 22:49:20 2006
+++ sip-4.5.2-new/configure.py    Mon Jan 22 18:16:52 2007
@@ -372,6 +373,10 @@
     if opt_platform is None:
         opt_platform = default_platform

+    if opt_platform.find("msvc") >= 0:
+        global plat_py_conf_inc_dir
+        plat_py_conf_inc_dir = sys.prefix + "\\PC"
+
     # Get the platform specific macros for building.
     macros = siputils.parse_build_macros(os.path.join("specs",
opt_platform), build_macro_names, args)

Apparently the default include directory for the pyconfig.h file was being
set to "Python-2.5\Include", when AFAICT if you compile with MSVC.NET
pyconfig.h is in "Python-2.5\PC" instead.  This was causing compile errors
because pyconfig.h could not be found.

The second change is this:

diff -ur sip-4.5.2/siputils.py sip-4.5.2-new/siputils.py
--- sip-4.5.2/siputils.py    Sat Dec  9 22:49:20 2006
+++ sip-4.5.2-new/siputils.py    Mon Jan 22 18:05:15 2007
@@ -1400,7 +1400,7 @@
         if self.static:
             if self.generator in ("MSVC", "MSVC.NET", "BMAKE"):
                 mfile.write("LIB = %s\n" % self.required_string("LIB"))
-            if self.generator == "MINGW":
+            elif self.generator == "MINGW":
                 mfile.write("AR = %s\n" % self.required_string("LIB"))
                 self._ranlib = None
             else:

This seems like an obvious bug to me.  If you are using MSVC.NET, you don't
necessarily have "ar", but if you look at the code immediately after this
change, it was trying to get the value of the AR variable from the spec.
Due to this I was getting an error while running SIP's configure.py saying
that AR was not defined.

--
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070124/655abaa3/attachment.html


More information about the PyQt mailing list