Updated for 2.1b2 distribution.
[python/dscho.git] / Misc / BeOS-NOTES
blob0424c4fbe0fa1aedb28882222d350973834d04b1
1 Python for BeOS R5
3 To build,
5    1)  ./configure --prefix=/boot/home/config
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.)
11    3)  make
13 Test:
15    make test
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.
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:
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.
37    Expect the following errors:
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)
43    test test_fork1 skipped -- can't mix os.fork with  threads on BeOS
45    test test_select crashed -- select.error : (-2147459072, 'Bad file
46                                descriptor')
48    test test_socket crashed -- exceptions.AttributeError : SOCK_RAW
50    These are all due to either partial support for certain things (like
51    sockets), or valid differences between systems.
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.
58 Install:
60    make install
63 Using GNU readline:
65    The Python interpreter is much nicer to work with interactively if
66    you've got readline installed.  Highly recommended.
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/.
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/.
77 Building libreadline for BeOS hosts:
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.
82   You won't be able to link against libreadline.a using the limited
83   linker.
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...
93    2) For PowerPC, configure with:
95       CC=mwcc CFLAGS="-O7 -i- -I." AR=ar-posix RANLIB=: ./configure --verbose \
96       --without-gcc --prefix=/boot/home/config powerpc-*-beos
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
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.
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).
111    4) For PowerPC, make with:
113       make AR=ar-posix 
115       For x86, make with:
116       
117       make
119    5) Install with:
121       make install
123 Enjoy!
125 - Chris Herborth (chrish@pobox.com)
126   July 21, 2000
128 - Donn Cave (donn@oz.net)
129   October 4, 2000