1998-12-18 02:00:33 +08:00
|
|
|
Python 1.5.x (x > 1) for BeOS
|
1998-08-05 01:57:28 +08:00
|
|
|
|
|
|
|
This directory contains several useful things to help you build your own
|
|
|
|
version of Python for BeOS.
|
|
|
|
|
|
|
|
What's Here?
|
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
ar-fake - A shell script used by the build process to emulate a "real"
|
|
|
|
POSIX ar command; helps to build the Python shared library.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
|
|
|
linkcc - A shell script used by the build process to build the Python
|
|
|
|
shared library.
|
|
|
|
|
|
|
|
linkmodule - A shell script used by the build process to build the
|
|
|
|
shared library versions of the standard modules; you'll
|
|
|
|
probably need this if you want to build dynamically loaded
|
|
|
|
modules from the Python archives.
|
|
|
|
|
|
|
|
README - This file (obviously!).
|
|
|
|
|
|
|
|
README.readline-2.2 - Instructions for compiling/installing GNU readline 2.2.
|
|
|
|
You'll have to grab the GNU readline source code from
|
|
|
|
prep.ai.mit.edu:/pub/GNU or any other GNU mirror.
|
|
|
|
|
|
|
|
The Python interpreter is much nicer to work with
|
|
|
|
interactively if you've got readline installed. Highly
|
|
|
|
recommended.
|
|
|
|
|
|
|
|
Compiling Your Own Version
|
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
To compile your own version of Python 1.5.x for BeOS (with any luck,
|
|
|
|
Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
1) Get the latest Python source code from ftp.python.org.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
2) Configure with:
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-19 06:00:58 +08:00
|
|
|
AR=$(pwd)/BeOS/ar-fake RANLIB=: ./configure --verbose \
|
1998-08-05 01:57:28 +08:00
|
|
|
--prefix=/boot/home/config --with-thread
|
1998-12-19 06:00:58 +08:00
|
|
|
|
1998-12-22 21:35:29 +08:00
|
|
|
When configure is done, add this anywhere in config.h:
|
1998-12-19 06:00:58 +08:00
|
|
|
|
|
|
|
#ifndef DL_EXPORT
|
|
|
|
# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
|
|
|
|
#endif
|
|
|
|
#ifndef DL_IMPORT
|
|
|
|
# ifdef USE_DL_EXPORT
|
|
|
|
# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
|
|
|
|
# else
|
|
|
|
# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
3) Copy Modules/Setup.in to Modules/Setup.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
4) Edit Modules/Setup to turn on all the modules you want built.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
Make sure you use _socket instead of socket for the name of the
|
|
|
|
socketmodule on BeOS.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
If you want the modules to be built as shared libraries, instead of as
|
|
|
|
part of the Python shared library, be sure to uncomment the #*shared*
|
|
|
|
line.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-22 21:35:29 +08:00
|
|
|
I've tried the following modules:
|
|
|
|
|
|
|
|
regex pcre posix signal readline array cmath math strop struct time
|
|
|
|
operator _locale fcntl pwd grp select _socket errno crypt termios
|
|
|
|
audioop imageop rgbimg md5 timing rotor syslog curses new gdbm soundex
|
|
|
|
binascii parser cStringIO cPickle zlib
|
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
5) Make sure Modules/Makefile.pre has REALLIBRARY set to:
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
REALLIBRARY=../libpython$(VERSION).so
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
6) Make:
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-22 21:35:29 +08:00
|
|
|
make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos
|
1998-12-19 06:00:58 +08:00
|
|
|
|
|
|
|
On PowerPC systems, you'll see lots of warnings about duplicate
|
|
|
|
symbols when things get linked; don't worry about this, it's
|
|
|
|
harmless (and should disappear soon).
|
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
7) Test:
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-22 21:40:55 +08:00
|
|
|
make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos test
|
1998-08-05 01:57:28 +08:00
|
|
|
|
|
|
|
Expect the following errors:
|
|
|
|
|
|
|
|
test_grp crashed -- exceptions.KeyError : getgrnam(): name not found
|
|
|
|
test_pwd failed -- Writing: 'fakename', expected: 'caught e'
|
|
|
|
test_socket crashed -- exceptions.AttributeError : SOCK_RAW
|
|
|
|
|
|
|
|
These are all due to either partial support for certain things (like
|
1998-12-18 02:00:33 +08:00
|
|
|
sockets), or valid differences between systems.
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
NOTE: On R4/x86, the pause() function is broken; expect the signal
|
|
|
|
module test to crash Python!
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
8) Install:
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-22 21:40:55 +08:00
|
|
|
make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos nstall
|
1998-08-05 01:57:28 +08:00
|
|
|
|
1998-12-19 06:00:58 +08:00
|
|
|
This will fail trying to copy libpython1.5.a; at that point in the
|
|
|
|
install, everything you "normally" need is installed (all the Python
|
|
|
|
bits), and the stuff you need for compiling C-based modules is half-
|
|
|
|
installed. This will be fixed before the 1.5.2 release.
|
|
|
|
|
1998-12-18 02:00:33 +08:00
|
|
|
9) Enjoy!
|
1998-08-05 01:57:28 +08:00
|
|
|
|
|
|
|
- Chris Herborth (chrish@qnx.com)
|
1998-12-22 21:35:29 +08:00
|
|
|
December 22, 1998
|