[Pythonmac-SIG] progress report: building Winmodule on OSX (fwd)

Steven D. Majewski sdm7g@virginia.edu
Thu, 2 Nov 2000 00:19:54 -0500 (EST)


Oops -- that pythonmac-sig, not macpython-sig! 
Try it one more time!

---------- Forwarded message ----------
Date: Thu, 2 Nov 2000 00:17:30 -0500 (EST)
From: Steven D. Majewski <sdm7g@Virginia.EDU>
To: Jack Jansen <jack@oratrix.nl>
Cc: macpython-sig@python.org
Subject: progress report: building Winmodule on OSX


I did some of this before for one of the 2.0 betas.
After a night of hacking, I got a bit further. 
Just in case it's again days before I can get back to this
( Got to go back to some Real Work tomorrow! ) I'll post
a progress report. 

* Unpacked the MacPython 2.0 sources, copied the Mac directory
 from those sources into the (already built) Darwin/OSX build
 directory of Python2.0.  Files all have mac line endings: 
  use find and "tr '\r' '\n'" command to convert files. 

* rename the Python-2.0/Mac/Include/config.h so it doesn't get included 
  instead of the  Python-2.0/config.h 

* (previously) got latest Universal Interfaces and unpacked the CIncludes
directory in /Local/Carbon/Universal.Interfaces/CIncludes (or where-ever)
[ The headers in /System/Library/Frameworks/ are spread out in various
  frameworks and hard to find, U-I has them all in one place, as well as
  not needing to change Windows.h to MacWindows.h and other changes. ] 

* Compile Winmodule.c with:

cc -c Winmodule.c -I../../../Include -I../../Include -I../../..  
-I/Local/Carbon/Universal.Interfaces/CIncludes -DHAVE_CONFIG_H 

( Relative to the Python-2.0/Mac/Modules/win/ directory that includes
  the Python-2.0/Include/ Python-2.0/Mac/Include  Python2.0 (for config.h)
  and the Universal Interfaces includes. ) 


* had to comment out all of the PyOS_* calls in macglue.c, as well
  as PyErr_CheckSignals to avoid multiple definitions. 

  Compiled macglue with: 

cc -c macglue.c -I../Include -I../../Include 
  -I/Local/Carbon/Universal.Interfaces/CIncludes/ -I../../ -I../../Python 
  -fpascal-strings

Linked with: 
cc -bundle -undefined warning Winmodule.o -o Winmodule.so -framework 
System  -framework Carbon ../../Python/macglue.o


and what I get when I run and import Win is:

Python 2.0 (#3, 10/22/00, 12:04:10) 
[GCC Apple DevKit-based CPP 5.0] on Darwin1.2
Type "copyright", "credits" or "license" for more information.
>>> import Win
dyld: python Undefined symbols:
_GetWindowGoAwayFlag
_GrafObj_New
_QdRGB_New
_ResObj_Convert
_ResObj_New
_SIOUXSetupMenus
_mfs_GetFSSpecFSSpec
_newmfssobject

<error exits Python back to shell>


The SIOUX reference probably shouldn't be there -- need to track
that down and kill it. 

Some like _ResObj are probably other macpython "glue" routines --
need to find and compile those files. 

Some may be non-carbon MacOS calls that also need to be removed. 


( This is condensed from several iterations to find undefined or
 multiply defined symbols. ) 


---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  University of Virginia             Health Sciences Center  |---
---|  P.O. Box 10011            Charlottesville, VA  22906-0011  |---
		"All operating systems want to be unix, 
		 All programming languages want to be lisp."