blob: 8f5891a25b71a2d745140daa9b10958bf67bc5e5 [file] [log] [blame]
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001Python 1.5.x (x > 1) for BeOS
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
11linkcc - A shell script used by the build process to build the Python
12 shared library.
13
14linkmodule - A shell script used by the build process to build the
15 shared library versions of the standard modules; you'll
16 probably need this if you want to build dynamically loaded
17 modules from the Python archives.
18
19PyImport_BeImageID.html - Documentation for a function added to the
20 Python interpreter under BeOS; not interesting
21 unless you're writing your own BeOS-specific
22 modules for dealing with dynamically-loaded
23 Python modules.
24
25README - This file (obviously!).
26
27README.readline-2.2 - Instructions for compiling/installing GNU readline 2.2.
28 You'll have to grab the GNU readline source code from
29 prep.ai.mit.edu:/pub/GNU or any other GNU mirror.
30
31 The Python interpreter is much nicer to work with
32 interactively if you've got readline installed. Highly
33 recommended.
34
35Compiling Your Own Version
36
Guido van Rossumfc4966b1998-12-17 18:00:33 +000037To compile your own version of Python 1.5.x for BeOS (with any luck,
38Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000039
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000401) Get the latest Python source code from ftp.python.org.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000041
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000422) Configure with:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000043
Guido van Rossumeb452321998-12-18 22:00:58 +000044 AR=$(pwd)/BeOS/ar-fake RANLIB=: ./configure --verbose \
Guido van Rossumd8eb2111998-08-04 17:57:28 +000045 --prefix=/boot/home/config --with-thread
Guido van Rossumeb452321998-12-18 22:00:58 +000046
Guido van Rossum343848b1998-12-22 13:35:29 +000047 When configure is done, add this anywhere in config.h:
Guido van Rossumeb452321998-12-18 22:00:58 +000048
49#ifndef DL_EXPORT
50# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
51#endif
52#ifndef DL_IMPORT
53# ifdef USE_DL_EXPORT
54# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
55# else
56# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
57# endif
58#endif
59
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000603) Copy Modules/Setup.in to Modules/Setup.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000061
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000624) Edit Modules/Setup to turn on all the modules you want built.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000063
Guido van Rossumd8eb2111998-08-04 17:57:28 +000064 Make sure you use _socket instead of socket for the name of the
65 socketmodule on BeOS.
66
Guido van Rossumfc4966b1998-12-17 18:00:33 +000067 If you want the modules to be built as shared libraries, instead of as
68 part of the Python shared library, be sure to uncomment the #*shared*
69 line.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000070
Guido van Rossum343848b1998-12-22 13:35:29 +000071 I've tried the following modules:
72
73 regex pcre posix signal readline array cmath math strop struct time
74 operator _locale fcntl pwd grp select _socket errno crypt termios
75 audioop imageop rgbimg md5 timing rotor syslog curses new gdbm soundex
76 binascii parser cStringIO cPickle zlib
77
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000785) Make sure Modules/Makefile.pre has REALLIBRARY set to:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000079
Guido van Rossumfc4966b1998-12-17 18:00:33 +000080 REALLIBRARY=../libpython$(VERSION).so
Guido van Rossumd8eb2111998-08-04 17:57:28 +000081
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000826) Make:
83
Guido van Rossum343848b1998-12-22 13:35:29 +000084 make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos
Guido van Rossumeb452321998-12-18 22:00:58 +000085
86 On PowerPC systems, you'll see lots of warnings about duplicate
87 symbols when things get linked; don't worry about this, it's
88 harmless (and should disappear soon).
89
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000907) Test:
91
Guido van Rossum343848b1998-12-22 13:35:29 +000092 make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT test
Guido van Rossumd8eb2111998-08-04 17:57:28 +000093
94 Expect the following errors:
95
Guido van Rossumd8eb2111998-08-04 17:57:28 +000096 test_grp crashed -- exceptions.KeyError : getgrnam(): name not found
97 test_pwd failed -- Writing: 'fakename', expected: 'caught e'
98 test_socket crashed -- exceptions.AttributeError : SOCK_RAW
99
100 These are all due to either partial support for certain things (like
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000101 sockets), or valid differences between systems.
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000102
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000103 NOTE: On R4/x86, the pause() function is broken; expect the signal
104 module test to crash Python!
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000105
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001068) Install:
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000107
Guido van Rossum343848b1998-12-22 13:35:29 +0000108 make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT install
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000109
Guido van Rossumeb452321998-12-18 22:00:58 +0000110 This will fail trying to copy libpython1.5.a; at that point in the
111 install, everything you "normally" need is installed (all the Python
112 bits), and the stuff you need for compiling C-based modules is half-
113 installed. This will be fixed before the 1.5.2 release.
114
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001159) Enjoy!
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000116
117- Chris Herborth (chrish@qnx.com)
Guido van Rossum343848b1998-12-22 13:35:29 +0000118 December 22, 1998