blob: ef700efa2cac92d4691f8a8bca28e2664fb41b51 [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
47 If you're on a PowerPC system, add this anywhere in config.h:
48
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 Rossumfc4966b1998-12-17 18:00:33 +0000715) Make sure Modules/Makefile.pre has REALLIBRARY set to:
Guido van Rossumd8eb2111998-08-04 17:57:28 +000072
Guido van Rossumfc4966b1998-12-17 18:00:33 +000073 REALLIBRARY=../libpython$(VERSION).so
Guido van Rossumd8eb2111998-08-04 17:57:28 +000074
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000756) Make:
76
77 make AR=$(pwd)/BeOS/ar-fake RANLIB=: OPT=-DUSE_DL_EXPORT \
78 CCSHARED=-UUSE_DL_EXPORT
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
86 make AR=$(pwd)/BeOS/ar-fake RANLIB=: OPT=-DUSE_DL_EXPORT \
87 CCSHARED=-UUSE_DL_EXPORT test
Guido van Rossumd8eb2111998-08-04 17:57:28 +000088
89 Expect the following errors:
90
Guido van Rossumd8eb2111998-08-04 17:57:28 +000091 test_grp crashed -- exceptions.KeyError : getgrnam(): name not found
92 test_pwd failed -- Writing: 'fakename', expected: 'caught e'
93 test_socket crashed -- exceptions.AttributeError : SOCK_RAW
94
95 These are all due to either partial support for certain things (like
Guido van Rossumfc4966b1998-12-17 18:00:33 +000096 sockets), or valid differences between systems.
Guido van Rossumd8eb2111998-08-04 17:57:28 +000097
Guido van Rossumfc4966b1998-12-17 18:00:33 +000098 NOTE: On R4/x86, the pause() function is broken; expect the signal
99 module test to crash Python!
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000100
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001018) Install:
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000102
Guido van Rossumfc4966b1998-12-17 18:00:33 +0000103 make AR=$(pwd)/BeOS/ar-fake RANLIB=: OPT=-DUSE_DL_EXPORT \
104 CCSHARED=-UUSE_DL_EXPORT install
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000105
Guido van Rossumeb452321998-12-18 22:00:58 +0000106 This will fail trying to copy libpython1.5.a; at that point in the
107 install, everything you "normally" need is installed (all the Python
108 bits), and the stuff you need for compiling C-based modules is half-
109 installed. This will be fixed before the 1.5.2 release.
110
Guido van Rossumfc4966b1998-12-17 18:00:33 +00001119) Enjoy!
Guido van Rossumd8eb2111998-08-04 17:57:28 +0000112
113- Chris Herborth (chrish@qnx.com)
Guido van Rossumeb452321998-12-18 22:00:58 +0000114 December 18, 1998