blob: 20da0c5fe706bc0ddf32ac6c5b7a1a29a189b86d [file] [log] [blame]
Guido van Rossum33fde571997-05-09 02:40:09 +00001This is Python release 1.5 alpha 1
Guido van Rossumf501b4e1996-10-25 14:32:48 +00002==================================
Guido van Rossumfaf681a1996-06-20 14:32:08 +00003
Guido van Rossum33fde571997-05-09 02:40:09 +00004******************************************
5*** RELEASE RESTRICTED TO PSA MEMBERS! ***
6******************************************
Guido van Rossum627b2d71993-12-24 10:39:16 +00007
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +00008What's new in this release?
9---------------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000010
Guido van Rossum33fde571997-05-09 02:40:09 +000011Ehm, I'll be more complete later. Som highlights: I've completed the
12Grand Renaming. It's much faster (almost twice for pystone.py -- see
13Tools/scripts.) There's an assert statement, and a -O option that
14squeezes SET_LINENO instructions and if __debug__ code. It's much
15smarter (only on Unix, so far) about the initial value for sys.path.
16See the usage message (python -h). There's an explicit structure that
17maintains all per-thread globals.
18
19Unfinished projects: documentation; multiple independent interpreters;
20better embedding support; more Windows support.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000021
22
Guido van Rossum91cb9d21995-04-10 11:47:38 +000023What is Python anyway?
24----------------------
25
26Python is an interpreted object-oriented programming language, and is
Guido van Rossum6d9cc801996-08-01 17:31:22 +000027often compared to Tcl, Perl, Scheme or Java. For a quick summary of
28what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +000029If you have web access, point your browser to http://www.python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000030
31
Guido van Rossumf501b4e1996-10-25 14:32:48 +000032How do I learn Python?
33----------------------
34
35The official tutorial is still a good place to start (in the Doc
36directory as tut.tex; and http://www.python.org/doc/tut/tut.html).
37Aaron Watters wrote a second tutorial, that may be more accessible for
38some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html.
39
40There are now also two books on Python. While these are still based
Guido van Rossum33fde571997-05-09 02:40:09 +000041on Python 1.3 or 1.4, the language is so stable now that you'd be
Guido van Rossumf501b4e1996-10-25 14:32:48 +000042hard pressed to find places where the books are out of date. The
43books, both first published in October 1996 and both including a
44CD-ROM, form excellent companions to each other:
45
46 Internet Programming with Python
47 by Aaron Watters, Guido van Rossum, and James Ahlstrom
48 MIS Press/Henry Holt publishers
49 ISBN: 1-55851-484-8
50
51 Programming Python
52 by Mark Lutz
53 O'Reilly & Associates
54 ISBN: 1-56592-197-6
55
56
Guido van Rossum91cb9d21995-04-10 11:47:38 +000057If you don't read instructions
58------------------------------
59
60Congratulations on getting this far. :-)
61
62To start building right away (on UNIX): type "./configure" in the
63current directory and when it finishes, type "make". The section
64Build Instructions below is still recommended reading. :-)
65
66
67Copyright issues
68----------------
69
70Python is COPYRIGHTED but free to use for all. See the full copyright
71notice at the end of this file.
72
73The Python distribution is *not* affected by the GNU Public Licence
74(GPL). There are interfaces to some GNU code but these are entirely
75optional and no GNU code is distributed with Python. For all these
76packages, GPL-free public domain versions also exist.
77
Guido van Rossum627b2d71993-12-24 10:39:16 +000078
Guido van Rossum6d9cc801996-08-01 17:31:22 +000079
Guido van Rossumff840491995-09-18 22:02:47 +000080A modest plug
81=============
82
Guido van Rossumf501b4e1996-10-25 14:32:48 +000083*********************************************************************
84* Without your help, I won't be able to continue to support Python! *
85*********************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +000086
Guido van Rossumf501b4e1996-10-25 14:32:48 +000087If you use Python, please consider joining the Python Software
88Activity (PSA). See http://www.python.org/psa/.
89
90Organizations that make heavy use of Python are especially encouraged
91to become corporate members!
Guido van Rossum627b2d71993-12-24 10:39:16 +000092
Guido van Rossum6d9cc801996-08-01 17:31:22 +000093
Guido van Rossum433c8ad1994-08-01 12:07:07 +000094Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +000095==================
Guido van Rossum627b2d71993-12-24 10:39:16 +000096
Guido van Rossum6d9cc801996-08-01 17:31:22 +000097Before you can build Python, you must first configure it.
98Fortunately, the configuration and build process has been streamlined
99for most Unix installations, so all you have to do is type a few
100commands, optionally edit one file, and sit back. There are some
101platforms where things are not quite as smooth; see the platform
102specific notes below. If you want to build for multiple platforms
103sharing the same source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000104
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000105You start by running the script "./configure", which figures out your
106system configuration and creates several Makefiles. (It takes a
107minute or two -- please be patient!) When it's done, you are ready to
108run make. You may want to pass options to the configure script -- see
109the section below on configuration options and variables.
110
111To build Python, you normally type "make" in the toplevel directory.
112This will recursively run make in each of the subdirectories Parser,
113Objects, Python and Modules, creating a library file in each one. The
114executable of the interpreter is built in the Modules subdirectory and
115moved up here when it is built. If you want or need to, you can also
116chdir into each subdirectory in turn and run make there manually (do
117the Modules subdirectory last!).
118
119Once you have built an interpreter, see the subsections below on
120testing, configuring additional modules, and installation. If you run
121in trouble, see the next section.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000122
Guido van Rossum0a516c91994-09-12 10:58:40 +0000123
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000124Troubleshooting
125---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +0000126
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000127See also the platform specific notes in the next section.
128
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000129If recursive makes fail, try invoking make as "make MAKE=make".
130
131If you run into other trouble, see section 3 of the FAQ (file
132Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000133
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000134If you rerun the configure script with different options, remove all
135object files by running "make clean" before rebuilding. Believe it or
136not, "make clean" sometimes helps to clean up other inexplicable
137problems as well. Try it before sending in a bug report!
138
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000139If the configure script fails or doesn't seem to find things that
140should be there, inspect the config.log file.
141
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000142
143Platform specific notes
144-----------------------
145
Guido van Rossum0447a321995-10-08 01:22:33 +0000146(Some of these may no longer apply. If you find you can build Python
147on these platforms without the special directions mentioned here, let
148me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000149
Guido van Rossum4462e931997-01-22 21:00:32 +0000150Solaris: When using Sun's C compiler with threads, at least on Solaris
151 2.5.1, you need to add the "-mt" compiler option (the simplest
152 way is probably to specify the compiler with this option as
153 the "CC" environment variable when running the configure
154 script).
155
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000156Linux: On Linux version 1.x, once you've built Python, use it to run
157 the regen script in the Lib/linux1 directory. Apparently
158 the files as distributed don't match the system headers on
159 some Linux versions. (The "h2py" command refers to
160 Tools/scripts/h2py.py.) The modules distributed for Linux 2.x
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000161 should be okay. Shared library support now works by default
Guido van Rossum4462e931997-01-22 21:00:32 +0000162 on ELF-based x86 Linux systems. (Note: when you change the
163 status of a module from static to shared, you must remove its
164 .o file or do a "make clean".)
165
166DEC Alpha OFS/1: When enabling threads, use --with-dec-threads, not
167 --with-thread.
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000168
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000169AIX: A complete overhaul of the shared library support is now in
170 place. To enable it, uncomment the LINKCC line in the Setup
171 file. See Misc/AIX-NOTES for some notes on how it's done.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000172
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000173 WARNING! In some versions of AIX 3.x, you get errors about
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000174 Invalid Indent when running the Python test set. This appears
175 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
176 using OPT="" or OPT=-g, or use gcc.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000177
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000178HP-UX: Shared library support now works by default (at least on HP-UX
179 9.x). One other problem remains: the HP ANSI C compiler (cc
180 -Aa) is too pedantic to use, but in K&R mode, it barfs on a
181 few files (complexobject.c, getargs.c and operator.c). Until
182 this is fixed, the following seems to work:
183
184 make -k # this compiles all but a few files
185 make OPT=-Aa # compile the remaining files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000186
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000187Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000188
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000189SCO: 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000190 defs. This is because all the SCO header files are broken.
191 Anything that isn't mentioned in the C standard it's
192 conditionally excluded when __STDC__ is defined.
193
194 2) Due to the U.S. export restrictions, SCO broke the crypt
195 stuff out into a separate library, libcrypt_i.a so the LIBS
196 needed be set to:
197
198 LIBS=' -lsocket -lcrypt_i'
199
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000200 3) According to at least one report, the above apply only to
201 SCO 3 -- Python builds out of the box on SCO 5.
202
Guido van Rossum4462e931997-01-22 21:00:32 +0000203SunOS: On SunOS 4.1.x, when using the SunPro C compiler, you may want
204 to use the '-Xa' option instead of '-Xc', to enable some
205 needed non-ANSI Sunisms.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000206
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000207NeXT: To build fat binaries, use the --with-next-archs switch
208 described below.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000209
210
211Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000212---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000213
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000214You can configure the interpreter to contain fewer or more built-in
215modules by editing the file Modules/Setup. This file is initially
216copied (when the toplevel Makefile makes Modules/Makefile for the
217first time) from Setup.in; if it does not exist yet, make a copy
218yourself. Never edit Setup.in -- always edit Setup. Read the
219comments in the file for information on what kind of edits you can
220make. When you have edited Setup, Makefile and config.c in Modules
221will automatically be rebuilt the next time you run make in the
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000222toplevel directory. (When working inside the Modules directory, use
223"make Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16 +0000224
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000225The default collection of modules should build on any Unix system, but
226many optional modules should work on all modern Unices (e.g. try dbm,
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000227nis, termios, timing, syslog, curses, new, soundex, parser). Often
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000228the quickest way to determine whether a particular module works or not
229is to see if it will build: enable it in Setup, then if you get
230compilation or link errors, disable it -- you're missing support.
231
232On SGI IRIX, there are modules that interface to many SGI specific
233system libraries, e.g. the GL library and the audio hardware.
234
235For SunOS and Solaris, enable module "sunaudiodev" to support the
236audio device.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000237
Guido van Rossum4462e931997-01-22 21:00:32 +0000238In addition to the file Setup, you can also edit the file Setup.local.
239(the makesetup script processes both). You may find it more
240convenient to edit Setup.local and leave Setup alone. Then, when
241installing a new Python version, you can copy your old Setup.local
242file.
243
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000244
245Setting the optimization/debugging options
246------------------------------------------
247
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000248If you want or need to change the optimization/debugging options for
249the C compiler, assign to the OPT variable on the toplevel make
250command; e.g. "make OPT=-g" will build a debugging version of Python
251on most platforms. The default is OPT=-O; a value for OPT in the
252environment when the configure script is run overrides this default
253(likewise for CC; and the initial value for LIBS is used as the base
254set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000255
256
257Testing
258-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000259
260To test the interpreter that you have just built, type "make test".
261This runs the test set silently, twice (once with no compiled files,
262once with the compiled files left by the previous test run). Each
263test run should print "All tests OK." and nothing more. (The test set
264does not test the built-in modules, but will find most other problems
265with the interpreter.)
266
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000267IMPORTANT: If the tests fail and you decide to mail a bug report,
268*don't* include the output of "make test". It is useless. Run the
269following command instead:
270
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000271 PYTHONPATH=../Lib:../Lib/test:./Modules ./python -c 'import testall'
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000272
273(substituting the top of the source tree for .. if you built in a
274different directory). This gives the output of the tests and shows
275which test failed.
276
277
278Installing
279----------
280
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000281Installing Python was never this easy!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000282
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000283To install the Python binary, library modules, shared library modules
284(see below), include files, configuration files, and the manual page,
285just type "make install". This will install all platform-independent
286files in subdirectories the directory given with the --prefix option
287to configure or the 'prefix' Make variable (default /usr/local), and
288all binary and other platform-specific files in subdirectories if the
289directory given by --exec-prefix or the 'exec_prefix' Make variable
290(defaults to the --prefix directory). All subdirectories created will
291have Python's version number in their name, e.g. the library modules
Guido van Rossum33fde571997-05-09 02:40:09 +0000292are installed in "/usr/local/lib/python1.5/" by default. The Python
293binary is installed as "python1.5" and a hard link named "python" is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000294created. The only file not installed with a version number in its
295name is the manual page, installed as "/usr/local/man/man1/python.1"
296by default.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000297
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000298If you have a previous installation of a pre-1.4 Python that you don't
299want to replace yet, use "make altinstall". This installs the same
300set of files as "make install" except it doesn't create the hard link
Guido van Rossum33fde571997-05-09 02:40:09 +0000301to "python1.5" named "python" and it doesn't install the manual page
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000302at all.
303
304The only thing you may have to install manually is the Python mode for
305Emacs. (But then again, more recent versions of Emacs may already
306have it!) This is the file Misc/python-mode.el; follow the
307instructions that came with Emacs for installation of site specific
308files.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000309
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000310
311Configuration options and variables
312-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000313
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000314Some special cases are handled by passing options to the configure
315script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000316
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000317WARNING: if you rerun the configure script with different options, you
318must run "make clean" before rebuilding. Exceptions to this rule:
319after changing --prefix or --exec-prefix, all you need to do is remove
320Modules/getpath.o; after changing --with-readline, just remove
Guido van Rossum4462e931997-01-22 21:00:32 +0000321Parser/myreadline.o (but if it doesn't seem to work, always try "make
322clean" before giving up or complaining!).
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000323
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000324--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
325 it finds it. If you don't want this, or if this compiler is
326 installed but broken on your platform, pass the option
327 --without-gcc. You can also pass "CC=cc" (or whatever the
328 name of the proper C compiler is) in the environment, but the
329 advantage of using --without-gcc is that this option is
330 remembered by the config.status script for its --recheck
331 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000332
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000333--prefix, --exec-prefix: If you want to install the binaries and the
334 Python library somewhere else than in /usr/local/{bin,lib},
335 you can pass the option --prefix=DIRECTORY; the interpreter
336 binary will be installed as DIRECTORY/bin/python and the
337 library files as DIRECTORY/lib/python/*. If you pass
338 --exec-prefix=DIRECTORY (as well) this overrides the
339 installation prefix for architecture-dependent files (like the
340 interpreter binary). Note that --prefix=DIRECTORY also
341 affects the default module search path (sys.path), when
342 Modules/config.c is compiled. Passing make the option
343 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
344 prefix set at configuration time; this may be more convenient
345 than re-running the configure script if you change your mind
346 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000347
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000348--with-readline: You can use the GNU readline library to improve the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000349 interactive user interface. This gives you line editing and
350 command history when calling Python interactively. Unless GNU
351 readline is a standard part of your system (it is on Linux),
352 you need to configure build the GNU readline library before
353 running the configure script. Its sources are not distributed
354 with Python; you can ftp them from any GNU mirror site, or
355 from its home site:
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000356 ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz (or
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000357 a higher version number -- using version 1.x is not
358 recommended).
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000359
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000360 A GPL-free version was posted to comp.sources.misc in volume
361 31 and is widely available from FTP archive sites, e.g.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000362 ftp://gatekeeper.dec.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000363
364 Pass the Python configure script the option
365 --with-readline=DIRECTORY where DIRECTORY is the absolute
366 pathname of the directory where you've built the readline
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000367 library. If GNU readline is a standard part of your system,
368 don't pass '=DIRECTORY'. Some hints on building and using the
369 readline library are in the FAQ (file Misc/FAQ).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000370
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000371--with-thread: On most Unix systems, you can now use multiple threads.
Guido van Rossum4462e931997-01-22 21:00:32 +0000372 To enable this, pass --with-thread. (--with-threads is an
373 alias.) If the library required for threads lives in a
374 peculiar place, you can use --with-thread=DIRECTORY. In the
375 Modules/Setup file, enable the thread module. (Threads aren't
376 enabled automatically because there are run-time penalties
377 when support for them is compiled in even if you don't use
378 them.) IMPORTANT: run "make clean" after changing (either
379 enabling or disabling) this option! Note: for DEC Alpha OSF/1,
380 use --with-dec-threads instead.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000381
382--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
383 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000384 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000385 This is enabled (after you've ftp'ed and compiled the dl
386 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
387 is the absolute pathname of the dl library. (Don't bother on
388 IRIX 5, it already has dynamic linking using SunOS style
389 shared libraries.) Support for this feature is deprecated.
390
391--with-dl-dld: Dynamic loading of modules is rumoured to be supported
392 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
393 Symmetry (Dynix), and Atari ST. This is done using a
394 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000395 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000396 emulation of the SGI dl library mentioned above (the emulation
397 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000398 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000399 enable this, ftp and compile both libraries, then call the
400 configure passing it the option
401 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
402 the absolute pathname of the dl emulation library and
403 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
404 (Don't bother on SunOS 4 or 5, they already have dynamic
405 linking using shared libraries.) Support for this feature is
406 deprecated.
407
408--with-libm, --with-libc: It is possible to specify alternative
409 versions for the Math library (default -lm) and the C library
410 (default the empty string) using the options
411 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
412 if your system requires that you pass -lc_s to the C compiler
413 to use the shared C library, you can pass --with-libc=-lc_s.
414 These libraries are passed after all other libraries, the C
415 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000416
417--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
418 all compiled binaries with the architectures listed. Includes
419 correctly setting the target architecture specific resource
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000420 directory. (This option is not supported on other platforms.)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000421
Guido van Rossumd02ba451996-07-31 17:36:01 +0000422--with-libs='libs': Add 'libs' to the LIBS that the python
423 linked against.
424
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000425
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000426Building for multiple architectures (using the VPATH feature)
427-------------------------------------------------------------
428
429If your file system is shared between multiple architectures, it
430usually is not necessary to make copies of the sources for each
431architecture you want to support. If the make program supports the
432VPATH feature, you can create an empty build directory for each
433architecture, and in each directory run the configure script (on the
434appropriate machine with the appropriate options). This creates the
435necessary subdirectories and the Makefiles therein. The Makefiles
436contain a line VPATH=... which points to directory containing the
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000437actual sources. (On SGI systems, use "smake -J1" instead of "make" if
438you use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000439
440For example, the following is all you need to build a minimal Python
441in /usr/tmp/python (assuming ~guido/src/python is the toplevel
442directory and you want to build in /usr/tmp/python):
443
444 $ mkdir /usr/tmp/python
445 $ cd /usr/tmp/python
446 $ ~guido/src/python/configure
447 [...]
448 $ make
449 [...]
450 $
451
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000452Note that Modules/Makefile copies the original Setup file to the build
453directory if it finds no Setup file there. This means that you can
454edit the Setup file for each architecture independently. For this
455reason, subsequent changes to the original Setup file are not tracked
456automatically, as they might overwrite local changes. To force a copy
457of a changed original Setup file, delete the target Setup file. (The
458makesetup script supports multiple input files, so if you want to be
459fancy you can change the rules to create an empty Setup.local if it
460doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
461however this assumes that you only need to add modules.)
462
463
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000464Building on non-UNIX systems
465----------------------------
466
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000467Building Python for a PC is now a piece of cake!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000468
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000469Enter the directory "PC" and read the file "readme.txt". Most popular
470non-Unix PC platforms and compilers are supported (Unix ports to the
471PC such as Linux, FreeBSD or Solaris-x86 of course use the standard
472Unix build instructions).
473
474For the Mac, a separate source distribution will be made available,
475for use with the CodeWarrior compiler. If you are interested in Mac
476development, join the PythonMac Special Interest Group
477(http://www.python.org/sigs/pythonmac-sig/, or send email to
478pythonmac-sig-request@python.org).
479
480Of course, there are also binary distributions available for these
481platforms -- see http://www.python.org/python/.
482
483To port Python to a new non-UNIX system, you will have to fake the
484effect of running the configure script manually (for Mac and PC, this
485has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000486config.h.in to config.h and edit the latter to reflect the actual
487configuration of your system. Most symbols must simply be defined as
4881 only if the corresponding feature is present and can be left alone
489otherwise; however RETSIGTYPE must always be defined, either as int or
490as void, and the *_t type symbols must be defined as some variant of
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000491int if they need to be defined at all.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000492
493
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000494
495Miscellaneous issues
496====================
497
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000498Documentation
499-------------
500
501All documentation is provided in the subdirectory Doc in the form of
502LaTeX files. In order of importance for new users: Tutorial (tut),
503Library Reference (lib), Language Reference (ref), Extending (ext).
504Especially the Library Reference is of immense value since much of
505Python's power (including the built-in data types and functions!) is
506described here.
507
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000508To print the documentation from the LaTeX files, chdir into the Doc
509subdirectory, type "make" (let's hope you have LaTeX installed!), and
510send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
511ext.ps) to the printer. See the README file there. If you don't have
512LaTeX, you can ftp the PostScript files from the ftp archives (see
513below).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000514
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000515All documentation is also available on-line via the Python web site
516(http://www.python.org/, see below). It can also be downloaded
517separately from the ftp archives (see below) in Emacs INFO, HTML or
518PostScript form -- see the web site or the FAQ (file Misc/FAQ) for
519more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000520
521
522Emacs mode
523----------
524
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000525There's an excellent Emacs editing mode for Python code; see the file
526Misc/python-mode.el. Originally written by Tim Peters, it is now
527maintained by Barry Warsaw <bwarsaw@cnri.reston.va.us>.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000528
529
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000530Web site
531--------
532
533Python's own web site has URL http://www.python.org/. Come visit us!
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000534There are a number of mirrors, listed on the home page -- try a mirror
535that's close you you.
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000536
537
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000538Ftp site
539--------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000540
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000541Python's own ftp site is ftp.python.org, directory /pub/python. See
542the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000543Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000544
545
546Newsgroup and mailing list
547--------------------------
548
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000549There are a newsgroup and a mailing list devoted to Python. The
550newsgroup, comp.lang.python, contains exactly the same messages as the
551mailing list (though not always in the same order, due to the
552mysterious nature of the Usenet news distribution algorithm). To
553subscribe to the mailing list, send mail containing your real name and
554e-mail address to "python-list-request@cwi.nl". Use the same address
555if you want to unsibscribed. (A real person reads these messages, so
556no LISTPROC or Majordomo commands, please, and please be patient --
557normal turn-around time is about one working day.)
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000558
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000559The Python web site contains a search form that lets you search the
560newsgroup archives (or the web site itself). Click on the "search"
561link in the banner menu on any page of http://www.python.org/.
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000562
563
564Bug reports
565-----------
566
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000567Bugs are best reported to the comp.lang.python newsgroup or the Python
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000568mailing list -- see the section "Newsgroup and mailing list" above.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000569Before posting, check the newsgroup archives (see above) to see if
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000570your bug has already been reported!
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000571
572
573Questions
574---------
575
576For help, if you can't find it in the manuals, the FAQ or on the web
577site, it's best to post to the comp.lang.python or the Python mailing
578list (see above). If you specifically don't want to involve the
579newsgroup or mailing list, send questions to python-help@python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000580
581
582The Tk interface
583----------------
584
585Tk (the user interface component of John Ousterhout's Tcl language) is
586also usable from Python. Since this requires that you first build and
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000587install Tcl/Tk, the Tk interface is not enabled by default. It works
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000588with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0. I didn't
589have the time to test it with Tcl 7.6 and Tk 4.2 yet, but it might
590well work.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000591
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000592See http://www.sunlabs.com/research/tcl/ for more info on where to get
Guido van Rossum33fde571997-05-09 02:40:09 +0000593Tcl/Tk. Also http://sunscript.sun.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000594
595To enable the Python/Tk interface, once you've built and installed
596Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000597for the string "_tkinter". Uncomment one (normally the first) of the
598lines beginning with "#_tkinter" and un-comment the line beginning
599with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual
600places, you will have to edit the first line to fix or add -I and -L
601options. See the Build Instructions above for more details.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000602
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000603There is little documentation on how to use Tkinter; however most of
604the Tk manual pages apply quite straightforwardly. Begin with
605fetching the "Tk Lifesaver" document,
606e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped
607tar file containing a PostScript file) or the on-line version
608http://www.python.org/doc/life-preserver/index.html. Reading the
609Tkinter.py source will reveal most details on how Tkinter calls are
610translated into Tcl code.
611
612There are demos in the Demo/tkinter directory, in the subdirectories
613guido, matt and www (the matt and guido subdirectories have been
614overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000615
616Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000617lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter"
618(lower case t and leading underscore) which lives in
619Modules/_tkinter.c. Demos and normal Tk applications only import the
620Python Tkinter module -- only the latter uses the C _tkinter module
621directly. In order to find the C _tkinter module, it must be compiled
622and linked into the Python interpreter -- the _tkinter line in the
623Setup file does this. In order to find the Python Tkinter module,
624sys.path must be set correctly -- the TKPATH assignment in the Setup
625file takes care of this, but only if you install Python properly
626("make install libinstall"). (You can also use dynamic loading for
627the C _tkinter module, in which case you must manually fix up sys.path
628or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000629
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000630
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000631Distribution structure
632----------------------
633
634Most subdirectories have their own README file. Most files have
635comments.
636
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000637BUGS A list of known bugs (not completely up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000638Demo/ Demonstration scripts, modules and programs
639Doc/ Documentation (LaTeX sources)
640Grammar/ Input for the parser generator
641Include/ Public header files
642Lib/ Python library modules
643Makefile.in Source from which config.status creates Makefile
644Misc/ Miscellaneous files
645Modules/ Implementation of most built-in modules
646Objects/ Implementation of most built-in object types
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000647PC/ PC porting files (DOS, Windows, NT, OS/2)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000648Parser/ The parser and tokenizer and their input handling
649Python/ The "compiler" and interpreter
650README The file you're reading now
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000651TODO A list of things that could be done (not up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000652Tools/ Some useful programs written in Python
653acconfig.h Additional input for the autoheader program
654config.h.in Source from which config.status creates config.h
655configure Configuration shell script (GNU autoconf output)
656configure.in Configuration specification (GNU autoconf input)
657install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000658
659The following files will (may) be created in the toplevel directory by
660the configuration and build processes:
661
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000662Makefile Build rules
663config.cache cache of configuration variables
664config.h Configuration header
665config.log log from last configure run
666config.status status from last run of configure script
667python The executable interpreter
668tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000669
670
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000671Author's address
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000672================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000673
674Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000675CNRI
6761895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000677Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000678USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000679
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000680E-mail: guido@cnri.reston.va.us or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000681
682
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000683
684Copyright notice
685================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000686
687The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000688as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000689
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000690----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000691Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
692The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000693
694 All Rights Reserved
695
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000696Permission to use, copy, modify, and distribute this software and its
697documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000698provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000699both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000700supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000701Centrum or CWI or Corporation for National Research Initiatives or
702CNRI not be used in advertising or publicity pertaining to
703distribution of the software without specific, written prior
704permission.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000705
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000706While CWI is the initial source for this software, a modified version
707is made available by the Corporation for National Research Initiatives
708(CNRI) at the Internet address ftp://ftp.python.org.
709
710STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
711REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
712MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
713CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
714DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
715PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
716TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
717PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000718----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000719
720
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000721--Guido van Rossum (home page: http://www.python.org/~guido/)