|
1 | 1 | Python for BeOS R5 |
2 | 2 |
|
3 | | -To build, |
| 3 | +In Python-2.1, the standard version of the new setup.py program |
| 4 | +will not build the full complement of modules on BeOS. Instead, |
| 5 | +please replace it with the special BeOS version in Misc/BeOS-setup.py. |
4 | 6 |
|
5 | | - 1) ./configure --prefix=/boot/home/config |
| 7 | +To build, |
6 | 8 |
|
7 | | - 2) edit Modules/Setup |
8 | | - comment out grp and mmap, and pwd on 4.5 or earlier |
9 | | - uncomment any modules you want to include in python |
10 | | - (you can also add them later as shared libraries.) |
| 9 | + 1) cp Misc/BeOS-setup.py setup.py |
| 10 | + 2) ./configure --prefix=/boot/home/config |
11 | 11 | 3) make |
12 | 12 |
|
| 13 | +The modules will all build, except termios which assumes some flags |
| 14 | +we don't have. Put a libreadline.a in /boot/home/config/lib to get |
| 15 | +a readline.so for your interactive editing convenience; NB, not |
| 16 | +libreadline.so, you want to link a static readline library into the |
| 17 | +dynamically loaded Python module. |
| 18 | + |
13 | 19 | Test: |
14 | 20 |
|
15 | 21 | make test |
16 | 22 |
|
17 | | - [Chris Herborth writes:] |
18 | | - test_popen2 will probably hang; it's deadlocked on a semaphore. I should |
19 | | - probably disable popen2 support... it uses fork(), and fork() doesn't mix |
20 | | - with threads on BeOS. In *THEORY* you could use it in a single-threaded |
21 | | - program, but I haven't tried. |
22 | | - |
23 | | - If test_popen2 does hang, you can find the semaphore it's hung on via the |
24 | | - "ps" command. Look for python and you'll find something like this: |
25 | | - |
26 | | -./python -tt ../src/Lib/test/regrtest.py (team 26922) (uid 0) (gid 0) |
27 | | - 39472 python sem 10 3785 1500 piperd(360526) |
28 | | -./python -tt ../src/Lib/test/regrtest.py (team 26923) (uid 0) (gid 0) |
29 | | - 39477 python sem 10 25 4 python lock (1)(360022) |
30 | | - ^^^^^^ |
31 | | - That last number is the semaphore the fork()'d python is stuck on |
32 | | - (see how it's helpfully called "python lock (1)"? :-). You can unblock |
33 | | - that semaphore to let the tests continue using the "release" command |
34 | | - with that semaphore number. Be _very_ careful with "release" though, |
35 | | - releasing the wrong semaphore can be hazardous. |
36 | | - |
37 | | - Expect the following errors: |
38 | | - |
39 | | - test * skipped -- an optional feature could not be imported (you'll see |
40 | | - quite a few of these, based on what optional modules |
41 | | - you've included) |
42 | | - |
43 | | - test test_fork1 skipped -- can't mix os.fork with threads on BeOS |
| 23 | + The BeOS is Not UNIX category: |
| 24 | + - test_select crashed -- select.error : (-2147459072, 'Bad file descriptor') |
| 25 | + - test_socket crashed -- exceptions.AttributeError : SOCK_RAW |
| 26 | + - test_fcntl crashed -- exceptions.IOError: [Errno -2147483643] Invalid argument |
44 | 27 |
|
45 | | - test test_select crashed -- select.error : (-2147459072, 'Bad file |
46 | | - descriptor') |
| 28 | + This one is funny! BeOS does support large files, and that's why |
| 29 | + we get this error: the file is too big for my filesystem! |
| 30 | + - test_largefile crashed -- exceptions.IOError: [Errno -2147459065] |
| 31 | + No space left on device |
47 | 32 |
|
48 | | - test test_socket crashed -- exceptions.AttributeError : SOCK_RAW |
49 | | - |
50 | | - These are all due to either partial support for certain things (like |
51 | | - sockets), or valid differences between systems. |
52 | | - |
53 | | - test test_pickle crashed. This is apparently a serious problem, |
54 | | - "complex" number objects reconstructed from a |
55 | | - pickle don't compare equal to their ancestors. |
56 | | - But it happens on BeOS PPC only, not Intel. |
| 33 | + - test_pickle crashed. This is apparently a serious problem, "complex" |
| 34 | + number objects reconstructed from a pickle don't compare equal to |
| 35 | + their ancestors. But it happens on BeOS PPC only, not Intel. |
57 | 36 |
|
58 | 37 | Install: |
59 | 38 |
|
60 | 39 | make install |
61 | 40 |
|
62 | 41 |
|
63 | | -Using GNU readline: |
64 | | - |
65 | | - The Python interpreter is much nicer to work with interactively if |
66 | | - you've got readline installed. Highly recommended. |
67 | | - |
68 | | - You can get the original GNU readline 2.2 source code from your |
69 | | - favourite GNU software repository, such as |
70 | | - ftp://prep.ai.mit.edu/pub/gnu/. |
71 | | - |
72 | | - You can get the only-slightly-modified-for-BeOS version of GNU |
73 | | - readline 2.2 from the GeekGadgets repository; |
74 | | - ftp://ftp.ninemoons.com/pub/geekgadgets/. |
75 | | - |
76 | | - |
77 | | -Building libreadline for BeOS hosts: |
78 | | - |
79 | | - Note that we don't build a shared library version of libreadline and |
80 | | - libhistory. That's left as an exercise for the reader. |
81 | | - |
82 | | - You won't be able to link against libreadline.a using the limited |
83 | | - linker. |
84 | | - |
85 | | - 1) If you're on a PowerPC system, install the POSIX ar from |
86 | | - http://www.qnx.com/~chrish/Be/software/index.html#programming |
87 | | - (note that it's currently packaged with Python, in the BeOS/ar-1.1 |
88 | | - directory). |
89 | | - |
90 | | - If you're on an x86 system, you can leave out the "AR=ar-posix" |
91 | | - part of the following instructions. In fact, you'll have to... |
92 | | - |
93 | | - 2) For PowerPC, configure with: |
94 | | - |
95 | | - CC=mwcc CFLAGS="-O7 -i- -I." AR=ar-posix RANLIB=: ./configure --verbose \ |
96 | | - --without-gcc --prefix=/boot/home/config powerpc-*-beos |
97 | | - |
98 | | - For x86, configure with: |
99 | | - |
100 | | - CC=mwcc CFLAGS="-O2 -i- -I." RANLIB=: ./configure --verbose \ |
101 | | - --without-gcc --prefix=/boot/home/config x86-*-beos |
102 | | - |
103 | | - Don't worry about the warnings/errors configure spews for |
104 | | - powerpc-*-beos or x86-*-beos; readline doesn't actually use this host |
105 | | - information for anything, although configure will die if you don't |
106 | | - specify it. |
107 | | - |
108 | | - 3) Edit config.h to comment out "#define HAVE_SELECT 1"; select() on |
109 | | - BeOS doesn't work on file descriptors (such as stdin). |
110 | | - |
111 | | - 4) For PowerPC, make with: |
112 | | - |
113 | | - make AR=ar-posix |
114 | | - |
115 | | - For x86, make with: |
116 | | - |
117 | | - make |
118 | | - |
119 | | - 5) Install with: |
120 | | - |
121 | | - make install |
122 | | - |
123 | | -Enjoy! |
124 | | - |
125 | | -- Chris Herborth ( [email protected]) |
126 | | - July 21, 2000 |
127 | | - |
128 | 42 | |
129 | 43 | October 4, 2000 |
0 commit comments