blob: a0f0dc8e8c16b97e8ecc6f7f39f2ce43f24f64d9 [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
Guido van Rossumd8eb2111998-08-04 17:57:28 +000019README - This file (obviously!).
20
21README.readline-2.2 - Instructions for compiling/installing GNU readline 2.2.
22 You'll have to grab the GNU readline source code from
23 prep.ai.mit.edu:/pub/GNU or any other GNU mirror.
24
25 The Python interpreter is much nicer to work with
26 interactively if you've got readline installed. Highly
27 recommended.
28
29Compiling Your Own Version
30
Guido van Rossumfc4966b1998-12-17 18:00:33 +000031To compile your own version of Python 1.5.x for BeOS (with any luck,
32Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000033
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000341) Get the latest Python source code from ftp.python.org.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000035
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000362) Configure with:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000037
Guido van Rossumeb452321998-12-18 22:00:58 +000038 AR=$(pwd)/BeOS/ar-fake RANLIB=: ./configure --verbose \
Guido van Rossumd8eb2111998-08-04 17:57:28 +000039 --prefix=/boot/home/config --with-thread
Guido van Rossumeb452321998-12-18 22:00:58 +000040
Guido van Rossum343848b1998-12-22 13:35:29 +000041 When configure is done, add this anywhere in config.h:
Guido van Rossumeb452321998-12-18 22:00:58 +000042
43#ifndef DL_EXPORT
44# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
45#endif
46#ifndef DL_IMPORT
47# ifdef USE_DL_EXPORT
48# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
49# else
50# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
51# endif
52#endif
53
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000543) Copy Modules/Setup.in to Modules/Setup.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000055
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000564) Edit Modules/Setup to turn on all the modules you want built.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000057
Guido van Rossumd8eb2111998-08-04 17:57:28 +000058 Make sure you use _socket instead of socket for the name of the
59 socketmodule on BeOS.
60
Guido van Rossumfc4966b1998-12-17 18:00:33 +000061 If you want the modules to be built as shared libraries, instead of as
62 part of the Python shared library, be sure to uncomment the #*shared*
63 line.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000064
Guido van Rossum343848b1998-12-22 13:35:29 +000065 I've tried the following modules:
66
67 regex pcre posix signal readline array cmath math strop struct time
68 operator _locale fcntl pwd grp select _socket errno crypt termios
69 audioop imageop rgbimg md5 timing rotor syslog curses new gdbm soundex
70 binascii parser cStringIO cPickle zlib
71
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000725) Make sure Modules/Makefile.pre has REALLIBRARY set to:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000073
Guido van Rossumfc4966b1998-12-17 18:00:33 +000074 REALLIBRARY=../libpython$(VERSION).so
Guido van Rossumd8eb2111998-08-04 17:57:28 +000075
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000766) Make:
77
Guido van Rossum343848b1998-12-22 13:35:29 +000078 make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos
Guido van Rossumeb452321998-12-18 22:00:58 +000079
80 On PowerPC systems, you'll see lots of warnings about duplicate
81 symbols when things get linked; don't worry about this, it's
82 harmless (and should disappear soon).
83
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000847) Test:
85
Guido van Rossumf96cff21998-12-22 13:40:55 +000086 make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos test
Guido van Rossumd8eb2111998-08-04 17:57:28 +000087
88 Expect the following errors:
89
Guido van Rossumd8eb2111998-08-04 17:57:28 +000090 test_grp crashed -- exceptions.KeyError : getgrnam(): name not found
91 test_pwd failed -- Writing: 'fakename', expected: 'caught e'
92 test_socket crashed -- exceptions.AttributeError : SOCK_RAW
93
94 These are all due to either partial support for certain things (like
Guido van Rossumfc4966b1998-12-17 18:00:33 +000095 sockets), or valid differences between systems.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000096
Guido van Rossumfc4966b1998-12-17 18:00:33 +000097 NOTE: On R4/x86, the pause() function is broken; expect the signal
98 module test to crash Python!
Guido van Rossumd8eb2111998-08-04 17:57:28 +000099
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001008) Install:
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000101
Guido van Rossumf96cff21998-12-22 13:40:55 +0000102 make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos nstall
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000103
Guido van Rossumeb452321998-12-18 22:00:58 +0000104 This will fail trying to copy libpython1.5.a; at that point in the
105 install, everything you "normally" need is installed (all the Python
106 bits), and the stuff you need for compiling C-based modules is half-
107 installed. This will be fixed before the 1.5.2 release.
108
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001099) Enjoy!
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000110
111- Chris Herborth (chrish@qnx.com)
Guido van Rossum343848b1998-12-22 13:35:29 +0000112 December 22, 1998