[Pythonmac-SIG] Compiling Embedded Programs using autoconf et al
update
Robert White
kranki at mac.com
Sun Dec 5 16:39:52 CET 2004
This is just an update of what I have been doing to figure out how to
create a
platform-independent means of compiling programs that embed python.
Since
I am really new to most all of this, please let me know if you think I
am going in
the wrong direction.
First, I grabbed runFunc.c from python.org to use for testing and read
the embedding
and extending document. Then, since I had read the book, "GNU
Autoconf, Automake,
and Libtool", I started using it to create configure.in and appropriate
Makefile.am's.
However, I haven't gotten very far with this since it requires a little
more knowledge
than what I have accumulated to date. Well, I was thinking about going
back and
starting to use the XChat2 autoconf stuff for Python when it dawned on
me that compiling
extensions is very similar to compiling embedded programs. So, I went
back to the
"Python Cookbook" which has an example of an extension, elemlist, and
it pointed me
to the standard for installing extensions is to use distutils and
create a fairly simple
setup.py. Since "python setup.py install" seems to be cross-platform,
I created a
simple shell script from its output (using --dry-run) and used that to
compile and link
runFunc. It seems that compiling and linking extensions and embedded
programs
is very similar. (Please correct me if I am wrong on this.)
So, next I am now going thru the source for distutils with the hope
that I can learn
how to use it to generate the compile and link commands that I need for
an autoconf
setup. If it won't then I hope to create patches that will allow me to
and try to get them
implemented by the distutils team if that is possible. I do know in
looking at the
--dry-run stuff that at least for MacOSX 10.3, it knows everything that
needs to be
done and it is much simpler than trying to work with the LINKFORSHARED
variable
of sysconfig. Anyway, that it the direction that I am currently
pursuing unless someone
here indicates that that is not a good path to follow.
Thanks for your help.
BTW, I installed Darwin 7.2.1 on a spare Powerbook G4 that I have and
got the information
from sysconfig from it. I was pleased to find out that it installs
quite easily and had
python and cvs built into it.
More information about the Pythonmac-SIG
mailing list