blob: 9b270debd5cdd7188f1566e7a3590b138b09d1b1 [file] [log] [blame]
Fred Drake56221a72000-08-15 18:52:33 +00001Python for BeOS R5
Guido van Rossumd8eb2111998-08-04 17:57:28 +00002
3This directory contains several useful things to help you build your own
4version of Python for BeOS.
5
Guido van Rossumd8eb2111998-08-04 17:57:28 +00006What's Here?
7
Guido van Rossumfc4966b1998-12-17 18:00:33 +00008ar-fake - A shell script used by the build process to emulate a "real"
9 POSIX ar command; helps to build the Python shared library.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000010
Guido van Rossum7a5f4201999-01-12 20:30:23 +000011dl_export.h - A header defining the evil magic declaration decorations
12 required for dynamic loading.
13
Guido van Rossumd8eb2111998-08-04 17:57:28 +000014linkcc - A shell script used by the build process to build the Python
15 shared library.
16
17linkmodule - A shell script used by the build process to build the
18 shared library versions of the standard modules; you'll
19 probably need this if you want to build dynamically loaded
20 modules from the Python archives.
21
Guido van Rossumd8eb2111998-08-04 17:57:28 +000022README - This file (obviously!).
23
24README.readline-2.2 - Instructions for compiling/installing GNU readline 2.2.
25 You'll have to grab the GNU readline source code from
26 prep.ai.mit.edu:/pub/GNU or any other GNU mirror.
27
28 The Python interpreter is much nicer to work with
29 interactively if you've got readline installed. Highly
30 recommended.
31
32Compiling Your Own Version
33
Guido van Rossumfc4966b1998-12-17 18:00:33 +000034To compile your own version of Python 1.5.x for BeOS (with any luck,
35Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000036
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000371) Get the latest Python source code from ftp.python.org.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000038
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000392) Configure with:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000040
Guido van Rossum7a5f4201999-01-12 20:30:23 +000041 ./configure --verbose --prefix=/boot/home/config --with-thread
Guido van Rossumeb452321998-12-18 22:00:58 +000042
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000433) Copy Modules/Setup.in to Modules/Setup.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000044
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000454) Edit Modules/Setup to turn on all the modules you want built.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000046
Guido van Rossumd8eb2111998-08-04 17:57:28 +000047 Make sure you use _socket instead of socket for the name of the
Fred Drake56221a72000-08-15 18:52:33 +000048 socketmodule on BeOS (at least, until we get the new BONE networking).
Guido van Rossumd8eb2111998-08-04 17:57:28 +000049
Guido van Rossumfc4966b1998-12-17 18:00:33 +000050 If you want the modules to be built as shared libraries, instead of as
51 part of the Python shared library, be sure to uncomment the #*shared*
Fred Drake56221a72000-08-15 18:52:33 +000052 line. I haven't done much testing with static linking, it's not as
53 interesting.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000054
Guido van Rossum343848b1998-12-22 13:35:29 +000055 I've tried the following modules:
56
Fred Drake56221a72000-08-15 18:52:33 +000057 array audioop binascii cmath _codecs cPickle crypt cStringIO _curses
58 errno fcntl gdbm grp imageop _locale math md5 new operator parser
59 pcre posix pwd pyexpat readline regex rgbimg rotor select sha signal
60 _socket soundex _sre strop struct syslog termios time timing ucnhash
61 unicodedata zlib
Guido van Rossum7a5f4201999-01-12 20:30:23 +000062
Fred Drake56221a72000-08-15 18:52:33 +000063 Note that some of these require extra libraries that aren't supplied
64 with Python. If you don't have the extra libs (you can probably get
65 them from GeekGadgets), don't try to use these modules; they won't
66 compile.
Guido van Rossum343848b1998-12-22 13:35:29 +000067
Guido van Rossum7a5f4201999-01-12 20:30:23 +0000685) Make:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000069
Guido van Rossum7a5f4201999-01-12 20:30:23 +000070 make
Guido van Rossumd8eb2111998-08-04 17:57:28 +000071
Guido van Rossum7a5f4201999-01-12 20:30:23 +0000726) Test:
Guido van Rossumfc4966b1998-12-17 18:00:33 +000073
Guido van Rossum7a5f4201999-01-12 20:30:23 +000074 make test
Guido van Rossumd8eb2111998-08-04 17:57:28 +000075
Fred Drake56221a72000-08-15 18:52:33 +000076 test_popen2 will probably hang; it's deadlocked on a semaphore. I should
77 probably disable popen2 support... it uses fork(), and fork() doesn't mix
78 with threads on BeOS. In *THEORY* you could use it in a single-threaded
79 program, but I haven't tried.
80
81 If test_popen2 does hang, you can find the semaphore it's hung on via the
82 "ps" command. Look for python and you'll find something like this:
83
84./python -tt ../src/Lib/test/regrtest.py (team 26922) (uid 0) (gid 0)
85 39472 python sem 10 3785 1500 piperd(360526)
86./python -tt ../src/Lib/test/regrtest.py (team 26923) (uid 0) (gid 0)
87 39477 python sem 10 25 4 python lock (1)(360022)
88 ^^^^^^
89 That last number is the semaphore the fork()'d python is stuck on
90 (see how it's helpfully called "python lock (1)"? :-). You can unblock
91 that semaphore to let the tests continue using the "release" command
92 with that semaphore number. Be _very_ careful with "release" though,
93 releasing the wrong semaphore can be hazardous.
94
Guido van Rossumd8eb2111998-08-04 17:57:28 +000095 Expect the following errors:
96
Fred Drake56221a72000-08-15 18:52:33 +000097 test * skipped -- an optional feature could not be imported (you'll see
98 quite a few of these, based on what optional modules
99 you've included)
100
101 test test_fork1 skipped -- can't mix os.fork with threads on BeOS
102
103 test test_re failed -- Writing: '=== Failed incorrectly', expected:
104 "('abc', 'abc', 0, 'fou"
105
106 test test_select crashed -- select.error : (-2147459072, 'Bad file
107 descriptor')
108
109 test test_socket crashed -- exceptions.AttributeError : SOCK_RAW
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000110
111 These are all due to either partial support for certain things (like
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000112 sockets), or valid differences between systems.
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000113
Fred Drake56221a72000-08-15 18:52:33 +0000114 That test_re failure is a little worrysome though.
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000115
Guido van Rossum7a5f4201999-01-12 20:30:23 +00001167) Install:
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000117
Guido van Rossum7a5f4201999-01-12 20:30:23 +0000118 make install
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000119
Guido van Rossum7a5f4201999-01-12 20:30:23 +00001208) Enjoy!
Guido van Rossumeb452321998-12-18 22:00:58 +0000121
Fred Drake56221a72000-08-15 18:52:33 +0000122- Chris Herborth (chrish@pobox.com)
123 July 21, 2000