[PyKDE] Building SIP on MacOS 10.3.2

Stephen Schaub sschaub at bju.edu
Wed Mar 10 22:43:00 GMT 2004


I'm attempting to build SIP on Mac OS X 10.3.2 and am having difficulty. I
have successfully built Qt 3.3.1 on this machine and have tested some apps,
including the Qt designer. I have a fairly straightforward installation of
the OS X developer tools (no Fink stuff).

I downloaded SIP 4.0 rc2 and unpacked. I then ran configure.py and got the
following output:

--------------------------------------------------------------------------
[C10054:~/Documents/sip-4.0rc2] sschaub% python configure.py -l qt-mt
This is SIP 4.0rc2 for Python 2.3 on darwin.
The SIP code generator will be installed in
/System/Library/Frameworks/Python.framework/Versions/2.3/bin.
The SIP module will be installed in
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
site-packages.
The SIP header file will be installed in
/System/Library/Frameworks/Python.framework/Versions/2.3/include/
python2.3.
The default directory to install .sip files in is
/System/Library/Frameworks/Python.framework/Versions/2.3/share/sip.
Qt v3.3.1 free edition is being used.
The Qt header files are in /Developer/qt/include.
The qt-mt Qt library is in /Developer/qt/lib.
Qt's default platform/compiler configuration will be used.
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
------------------------------------------------------------------------ 

So far, so good. I ran make, and got the following:
------------------------------------------------------------------------ 
[C10054:~/Documents/sip-4.0rc2] sschaub% make
cc -c -pipe -Os -w -I. -o main.o main.c
cc -c -pipe -Os -w -I. -o transform.o transform.c
cc -c -pipe -Os -w -I. -o gencode.o gencode.c
cc -c -pipe -Os -w -I. -o heap.o heap.c
cc -c -pipe -Os -w -I. -o parser.o parser.c
cc -c -pipe -Os -w -I. -o lexer.o lexer.c
c++  -o sip main.o transform.o gencode.o heap.o parser.o lexer.o
cc -c -pipe -fPIC -Os -w -DSIP_QT_SUPPORT -DQT_NO_DEBUG
-DQT_THREAD_SUPPORT -I.
-I/System/Library/Frameworks/Python.framework/Versions/2.3/include/
python2.3 -I/Developer/qt/include -o siplib.o siplib.c
siplib.c:17: header file 'Python.h' not found
sip.h:21: header file 'Python.h' not found
.. several related error messages appeared ...
------------------------------------------------------------------------ 

A missing include file! I looked in
/System/Library/Frameworks/Python.framework/Versions/2.3
and did not find an include directory. Apparently the python
distribution included with Mac OS X 10.3 does not have include files.
So, I downloaded the python 2.3 source, created an include/python2.3
directory, and copied files from the python distribution's Include and
Mac/Include folders into it. Then, I ran make again:

------------------------------------------------------------------------ 
[C10054:~/Documents/sip-4.0rc2] sschaub% make
cc -c -pipe -Os -w -I. -o main.o main.c
cc -c -pipe -Os -w -I. -o transform.o transform.c
cc -c -pipe -Os -w -I. -o gencode.o gencode.c
cc -c -pipe -Os -w -I. -o heap.o heap.c
cc -c -pipe -Os -w -I. -o parser.o parser.c
cc -c -pipe -Os -w -I. -o lexer.o lexer.c
c++  -o sip main.o transform.o gencode.o heap.o parser.o lexer.o
cc -c -pipe -fPIC -Os -w -DSIP_QT_SUPPORT -DQT_NO_DEBUG
-DQT_THREAD_SUPPORT -I.
-I/System/Library/Frameworks/Python.framework/Versions/2.3/include/
python2.3 -I/Developer/qt/include -o siplib.o siplib.c
/System/Library/Frameworks/Python.framework/Versions/2.3/include/
python2.3/pyport.h:159: header file 'stat.h' not found
/System/Library/Frameworks/Python.framework/Versions/2.3/include/
python2.3/unicodeobject.h:118: header file 'wchar.h' not found
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode
<built-in>:1:1: no macro name given in #define directive
make[1]: *** [siplib.o] Error 1
make: *** [all] Error 2
------------------------------------------------------------------------ 

It appears that the compile configuration is attempting to #include wchar.h,
which is not available on OS X. It seems I either have the wrong header
files, or somehow certain preprocessor symbols aren't being set correctly by
the Sip Makefile.

I did try this with the latest Sip snapshot, with the same results.

I teach a Unix Programming class and hope to give my students some
exposure to building cross-platform GUI apps with Python on both Linux
and Mac OS X. Qt and Python look like a great combination! I would
appreciate any suggestions to get it working.

Stephen




More information about the PyQt mailing list