2000-08-15 18:52:33 +00:00
|
|
|
Python for BeOS R5
|
1998-08-04 17:57:28 +00:00
|
|
|
|
|
|
|
This directory contains several useful things to help you build your own
|
|
|
|
version of Python for BeOS.
|
|
|
|
|
|
|
|
What's Here?
|
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
ar-fake - A shell script used by the build process to emulate a "real"
|
|
|
|
POSIX ar command; helps to build the Python shared library.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
dl_export.h - A header defining the evil magic declaration decorations
|
|
|
|
required for dynamic loading.
|
|
|
|
|
1998-08-04 17:57:28 +00:00
|
|
|
linkcc - A shell script used by the build process to build the Python
|
|
|
|
shared library.
|
|
|
|
|
|
|
|
linkmodule - A shell script used by the build process to build the
|
|
|
|
shared library versions of the standard modules; you'll
|
|
|
|
probably need this if you want to build dynamically loaded
|
|
|
|
modules from the Python archives.
|
|
|
|
|
|
|
|
README - This file (obviously!).
|
|
|
|
|
|
|
|
README.readline-2.2 - Instructions for compiling/installing GNU readline 2.2.
|
|
|
|
You'll have to grab the GNU readline source code from
|
|
|
|
prep.ai.mit.edu:/pub/GNU or any other GNU mirror.
|
|
|
|
|
|
|
|
The Python interpreter is much nicer to work with
|
|
|
|
interactively if you've got readline installed. Highly
|
|
|
|
recommended.
|
|
|
|
|
|
|
|
Compiling Your Own Version
|
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
To compile your own version of Python 1.5.x for BeOS (with any luck,
|
|
|
|
Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
1) Get the latest Python source code from ftp.python.org.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
2) Configure with:
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
./configure --verbose --prefix=/boot/home/config --with-thread
|
1998-12-18 22:00:58 +00:00
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
3) Copy Modules/Setup.in to Modules/Setup.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
4) Edit Modules/Setup to turn on all the modules you want built.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
Make sure you use _socket instead of socket for the name of the
|
2000-08-15 18:52:33 +00:00
|
|
|
socketmodule on BeOS (at least, until we get the new BONE networking).
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1998-12-17 18:00:33 +00:00
|
|
|
If you want the modules to be built as shared libraries, instead of as
|
|
|
|
part of the Python shared library, be sure to uncomment the #*shared*
|
2000-08-15 18:52:33 +00:00
|
|
|
line. I haven't done much testing with static linking, it's not as
|
|
|
|
interesting.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1998-12-22 13:35:29 +00:00
|
|
|
I've tried the following modules:
|
|
|
|
|
2000-08-15 18:52:33 +00:00
|
|
|
array audioop binascii cmath _codecs cPickle crypt cStringIO _curses
|
|
|
|
errno fcntl gdbm grp imageop _locale math md5 new operator parser
|
|
|
|
pcre posix pwd pyexpat readline regex rgbimg rotor select sha signal
|
|
|
|
_socket soundex _sre strop struct syslog termios time timing ucnhash
|
|
|
|
unicodedata zlib
|
1999-01-12 20:30:23 +00:00
|
|
|
|
2000-08-15 18:52:33 +00:00
|
|
|
Note that some of these require extra libraries that aren't supplied
|
|
|
|
with Python. If you don't have the extra libs (you can probably get
|
|
|
|
them from GeekGadgets), don't try to use these modules; they won't
|
|
|
|
compile.
|
1998-12-22 13:35:29 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
5) Make:
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
make
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
6) Test:
|
1998-12-18 22:00:58 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
make test
|
1998-08-04 17:57:28 +00:00
|
|
|
|
2000-08-15 18:52:33 +00:00
|
|
|
test_popen2 will probably hang; it's deadlocked on a semaphore. I should
|
|
|
|
probably disable popen2 support... it uses fork(), and fork() doesn't mix
|
|
|
|
with threads on BeOS. In *THEORY* you could use it in a single-threaded
|
|
|
|
program, but I haven't tried.
|
|
|
|
|
|
|
|
If test_popen2 does hang, you can find the semaphore it's hung on via the
|
|
|
|
"ps" command. Look for python and you'll find something like this:
|
|
|
|
|
|
|
|
./python -tt ../src/Lib/test/regrtest.py (team 26922) (uid 0) (gid 0)
|
|
|
|
39472 python sem 10 3785 1500 piperd(360526)
|
|
|
|
./python -tt ../src/Lib/test/regrtest.py (team 26923) (uid 0) (gid 0)
|
|
|
|
39477 python sem 10 25 4 python lock (1)(360022)
|
|
|
|
^^^^^^
|
|
|
|
That last number is the semaphore the fork()'d python is stuck on
|
|
|
|
(see how it's helpfully called "python lock (1)"? :-). You can unblock
|
|
|
|
that semaphore to let the tests continue using the "release" command
|
|
|
|
with that semaphore number. Be _very_ careful with "release" though,
|
|
|
|
releasing the wrong semaphore can be hazardous.
|
|
|
|
|
1998-08-04 17:57:28 +00:00
|
|
|
Expect the following errors:
|
|
|
|
|
2000-08-15 18:52:33 +00:00
|
|
|
test * skipped -- an optional feature could not be imported (you'll see
|
|
|
|
quite a few of these, based on what optional modules
|
|
|
|
you've included)
|
|
|
|
|
|
|
|
test test_fork1 skipped -- can't mix os.fork with threads on BeOS
|
|
|
|
|
|
|
|
test test_re failed -- Writing: '=== Failed incorrectly', expected:
|
|
|
|
"('abc', 'abc', 0, 'fou"
|
|
|
|
|
|
|
|
test test_select crashed -- select.error : (-2147459072, 'Bad file
|
|
|
|
descriptor')
|
|
|
|
|
|
|
|
test test_socket crashed -- exceptions.AttributeError : SOCK_RAW
|
1998-08-04 17:57:28 +00:00
|
|
|
|
|
|
|
These are all due to either partial support for certain things (like
|
1998-12-17 18:00:33 +00:00
|
|
|
sockets), or valid differences between systems.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
2000-08-15 18:52:33 +00:00
|
|
|
That test_re failure is a little worrysome though.
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
7) Install:
|
1998-08-04 17:57:28 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
make install
|
1998-12-18 22:00:58 +00:00
|
|
|
|
1999-01-12 20:30:23 +00:00
|
|
|
8) Enjoy!
|
1998-08-04 17:57:28 +00:00
|
|
|
|
2000-08-15 18:52:33 +00:00
|
|
|
- Chris Herborth (chrish@pobox.com)
|
|
|
|
July 21, 2000
|