[PyKDE] Building SIP + PyQt [3.2rc3] on Mac OS X

SNYDER, BARRON F (AIT) bs1535 at sbc.com
Thu Apr 25 16:58:00 BST 2002


Thanks Dimitri! You've documented the build process and problems very well!
I appreciate your efforts. (And yours too Ludger!)

Hopefully we can get these last issues straightened out soon and start using
these great tools on OS X!

Barron

-----Original Message-----
From: Dimitri Papadopoulos 
Sent: Thursday, April 25, 2002 8:07 AM
To: pykde at mats.gmd.de
Subject: [PyKDE] Building SIP + PyQt [3.2rc3] on Mac OS X


Hi,

For those interested, this describes how to build SIP+PyQt on
Mac OS X using the following:

Mac OS X 10.1.3
	I understand 10.1 is suggested by Trolltech: 
	http://www.trolltech.com/developer/platforms/osx.html

December 2001 Mac OS X Developer Tools

SIP 3.2rc3
	
http://www.riverbankcomputing.co.uk/download/snapshots/sip-3.2rc1.tar.gz
	Note that SIP 3.1 has a minor bug that results in a linker
	error.
	SIP 3.2rc1 fixes that issue, I suggest you use SIP 3.2rc3.

PyQt 3.2rc3 for Mac OS X
	
http://www.riverbankcomputing.co.uk/download/snapshots/PyQt-3.2rc2-Qt-3.0.2-
MacX.tar.gz
	Note that PyQt 3.1 does not disable some X11-only functions
	and has some problems with casting "unsigned long" to "void*",
	and that PyQt 3.2rc1 calls other functions declared in the
	Qt headers but no implemented in the Qt/Mac library.
	PyQt 3.2rc2 fixes all these issues.
	PyQt 3.2rc3 has some problems I describe below.
	I suggest you wait for PyQt 3.2rc4.

Qt/Mac evaluation version
	http://www.trolltech.com/products/qt/evaluate.html

Python for Mac OS X
	http://fink.sourceforge.net/pdb/package.php/python
	There are two versions of Python for Mac OS X:
	* the above Python for Mac OS X which can be run
	  from the command line
	* the traditional MacPython that knows nothing of
	  command lines and UNIX
	Because MacPython cannot be called from the command
	line and I couldn't even identify a Python executable,
	and because PyQt requires the Python executable to be
	indetified using the --with-python=FILE option, we
	were not able to configure PyQt with MacPython.
	See also paragraph "MacOS X command-line interpreter"
	on this page:
	http://www.cwi.nl/~jack/macpython.html
	I suggest you use Python for Mac OS X from Fink.



Provided you're using SIP 3.2rc3 and PyQt 3.2rc3, these are the
pending issues I'm aware of when building SIP and PyQt on Mac OS X:

A) You'll see warnings of the kind described in 
   	http://mats.gmd.de/pipermail/pykde/2002-April/002540.html
   	http://mats.gmd.de/pipermail/pykde/2002-April/002555.html
   and end with:
   	cpp-precomp: warning: errors during smart preprocessing,
  	retrying in basic mode
   These warnings can be safely ignored. They're the result of
   a harmless compiler bug:
   	http://www.wxwindows.org/faqmac.htm#smarterrors

B) There seems to be a bug in the autoconf build system that's
   used to build PyQt. As a result the libtool file generated
   in the top-level directory after running configure is broken.
   After running configure, please find the line beginning with
   archive_cmds="\$nonopt \$(test \\"x\$module\\" = xyes
   and change to
   archive_cmds="\$nonopt \$(test \"x\$module\" = xyes
   If you forget this, the build system will build *.dylib
   shared libraries instead of *.so modules or bundles.

C) A bug was introduced in PyQt 3.2rc3, it has already been
   reported to the
   mailing list by Ludger Humbert <humbert at hagen.de> and was
   also reproduced here:

c++ -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/include/python2.2 
-I/usr/local/qt/include -DQT_THREAD_SUPPORT -I/usr/X11R6/include 
-fno-exceptions -O2 -c qtcmodule.cpp  -fno-common -DPIC -o qtcmodule.lo
qobject.sip: In function `struct PyObject * PyQtGetQObjectPythonClass(const 
QObject *)':
qobject.sip:655: ANSI C++ forbids declaration `sipStringTypeClassMap' with
no 
type
qobject.sip:655: parse error before `['
qobject.sip: At top level:
qobject.sip:859: ANSI C++ forbids declaration `cls' with no type
qobject.sip:859: conflicting types for `int cls'
qobject.sip:857: previous declaration as `struct PyObject * cls'
qobject.sip:859: `qobj' was not declared in this scope

   I'm not sure how to fix this right now.



OK, that said, here's how to build SIP:
1) First "configure", depending on how Python is set up:
   	./configure
   	./configure --with-python=/sw/bin/python
   	./configure --with-python=/usr/local/python-2.2.1/bin/python
2) Then fix the libtool script in the top-level directory as described
   in issue B above.
3) Then "make".
4) Then "make install". You should probably be root for that. In any
   case that's how I work here.

The same for building PyQt:
1) First "configure", depending on how Python and Qt are set up:
   	./configure -with-qtdir=/usr/local/qt --with-python=/sw/bin/python
2) Then fix the libtool script in the top-level directory as described
   in issue B above.
3) Then "make".
   You'll hit issue C here. I don't know how to fix this for now.

Dimitri




More information about the PyQt mailing list