Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 1 | Python for BeOS R5 |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 2 | |
| 3 | This directory contains several useful things to help you build your own |
| 4 | version of Python for BeOS. |
| 5 | |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 6 | What's Here? |
| 7 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 8 | ar-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 Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 11 | dl_export.h - A header defining the evil magic declaration decorations |
| 12 | required for dynamic loading. |
| 13 | |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 14 | linkcc - A shell script used by the build process to build the Python |
| 15 | shared library. |
| 16 | |
| 17 | linkmodule - 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 Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 22 | README - This file (obviously!). |
| 23 | |
| 24 | README.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 | |
| 32 | Compiling Your Own Version |
| 33 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 34 | To compile your own version of Python 1.5.x for BeOS (with any luck, |
| 35 | Python 1.5.2 and later will compile "out of the box" on BeOS), try this: |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 36 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 37 | 1) Get the latest Python source code from ftp.python.org. |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 38 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 39 | 2) Configure with: |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 40 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 41 | ./configure --verbose --prefix=/boot/home/config --with-thread |
Guido van Rossum | eb45232 | 1998-12-18 22:00:58 +0000 | [diff] [blame] | 42 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 43 | 3) Copy Modules/Setup.in to Modules/Setup. |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 44 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 45 | 4) Edit Modules/Setup to turn on all the modules you want built. |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 46 | |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 47 | Make sure you use _socket instead of socket for the name of the |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 48 | socketmodule on BeOS (at least, until we get the new BONE networking). |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 49 | |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 50 | 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 Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 52 | line. I haven't done much testing with static linking, it's not as |
| 53 | interesting. |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 54 | |
Guido van Rossum | 343848b | 1998-12-22 13:35:29 +0000 | [diff] [blame] | 55 | I've tried the following modules: |
| 56 | |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 57 | 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 Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 62 | |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 63 | 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 Rossum | 343848b | 1998-12-22 13:35:29 +0000 | [diff] [blame] | 67 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 68 | 5) Make: |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 69 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 70 | make |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 71 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 72 | 6) Test: |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 73 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 74 | make test |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 75 | |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 76 | 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 Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 95 | Expect the following errors: |
| 96 | |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 97 | 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 Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 110 | |
| 111 | These are all due to either partial support for certain things (like |
Guido van Rossum | fc4966b | 1998-12-17 18:00:33 +0000 | [diff] [blame] | 112 | sockets), or valid differences between systems. |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 113 | |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 114 | That test_re failure is a little worrysome though. |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 115 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 116 | 7) Install: |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 117 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 118 | make install |
Guido van Rossum | d8eb211 | 1998-08-04 17:57:28 +0000 | [diff] [blame] | 119 | |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 120 | 8) Enjoy! |
Guido van Rossum | eb45232 | 1998-12-18 22:00:58 +0000 | [diff] [blame] | 121 | |
Fred Drake | 56221a7 | 2000-08-15 18:52:33 +0000 | [diff] [blame] | 122 | - Chris Herborth (chrish@pobox.com) |
| 123 | July 21, 2000 |