blob: 001fefaf0dbcf1dd4fb2b6ad592482cf770a357e [file] [log] [blame]
Guido van Rossumb06df271997-08-05 21:50:20 +00001This is Python release 1.5 alpha 3
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 Rossumb06df271997-08-05 21:50:20 +000011Too much has changed to list it all; I'll be more complete later.
Guido van Rossum33fde571997-05-09 02:40:09 +000012
Guido van Rossumb06df271997-08-05 21:50:20 +000013The most important changes since Python 1.4 include:
14
15- Many previously undocumented modules are now documented; some are
16now officially obsolete or deprecated.
17
18- It's much faster (almost twice for pystone.py -- see Tools/scripts.)
19
20- There's an assert statement.
21
22- There's a -O option that removes SET_LINENO instructions and code
23prefixed with ``if __debug__: ...''.
24
25- It's much smarter about the initial value for sys.path; you can
26control it easier using $PYTHONHOME (see the usage message, e.g. try
27``python -h'').
28
29- The Grand Renaming is completed: all linker-visible symbols defined
30by Python now have a "Py" or "_Py" prefix, and the same is true for
31most macros and typedefs.
32
33- The build strategy now uses a single library (libpython1.5.a) which
34contains everything except for the main() entry point. This makes
35life much easier for applications that want to embed Python.
36
37- There is also much better support for embedding Python in
38applications that use threads.
39
40- Unfinished projects: documentation; multiple independent
41interpreters; more Windows support.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000042
43
Guido van Rossum91cb9d21995-04-10 11:47:38 +000044What is Python anyway?
45----------------------
46
47Python is an interpreted object-oriented programming language, and is
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000048often compared to Tcl, Perl, Java or Scheme. For a quick summary of
Guido van Rossum6d9cc801996-08-01 17:31:22 +000049what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +000050If you have web access, point your browser to http://www.python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000051
52
Guido van Rossumf501b4e1996-10-25 14:32:48 +000053How do I learn Python?
54----------------------
55
56The official tutorial is still a good place to start (in the Doc
57directory as tut.tex; and http://www.python.org/doc/tut/tut.html).
58Aaron Watters wrote a second tutorial, that may be more accessible for
59some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html.
60
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000061There are now also several books on Python. While these are still
62based on Python 1.3 or 1.4, the language is so stable now that you'd
63be hard pressed to find places where the books are out of date. The
64first two books, both first published in October 1996 and both
65including a CD-ROM, form excellent companions to each other:
Guido van Rossumf501b4e1996-10-25 14:32:48 +000066
67 Internet Programming with Python
68 by Aaron Watters, Guido van Rossum, and James Ahlstrom
69 MIS Press/Henry Holt publishers
70 ISBN: 1-55851-484-8
71
72 Programming Python
73 by Mark Lutz
74 O'Reilly & Associates
75 ISBN: 1-56592-197-6
76
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000077If you prefer to read German, try:
78
79 Das Python-Buch
80 by Martin von Loewis and Nils Fischbeck
81 Addison-Wesley-Longman, 1997
82 ISBN: 3-8273-1110-1
83
Guido van Rossumf501b4e1996-10-25 14:32:48 +000084
Guido van Rossum91cb9d21995-04-10 11:47:38 +000085If you don't read instructions
86------------------------------
87
88Congratulations on getting this far. :-)
89
90To start building right away (on UNIX): type "./configure" in the
91current directory and when it finishes, type "make". The section
92Build Instructions below is still recommended reading. :-)
93
94
95Copyright issues
96----------------
97
98Python is COPYRIGHTED but free to use for all. See the full copyright
99notice at the end of this file.
100
101The Python distribution is *not* affected by the GNU Public Licence
102(GPL). There are interfaces to some GNU code but these are entirely
103optional and no GNU code is distributed with Python. For all these
104packages, GPL-free public domain versions also exist.
105
Guido van Rossum627b2d71993-12-24 10:39:16 +0000106
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000107
Guido van Rossumff840491995-09-18 22:02:47 +0000108A modest plug
109=============
110
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000111*********************************************************************
112* Without your help, I won't be able to continue to support Python! *
113*********************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +0000114
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000115If you use Python, please consider joining the Python Software
116Activity (PSA). See http://www.python.org/psa/.
117
118Organizations that make heavy use of Python are especially encouraged
119to become corporate members!
Guido van Rossum627b2d71993-12-24 10:39:16 +0000120
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000121
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000122Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000123==================
Guido van Rossum627b2d71993-12-24 10:39:16 +0000124
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000125Before you can build Python, you must first configure it.
126Fortunately, the configuration and build process has been streamlined
127for most Unix installations, so all you have to do is type a few
128commands, optionally edit one file, and sit back. There are some
129platforms where things are not quite as smooth; see the platform
130specific notes below. If you want to build for multiple platforms
131sharing the same source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000132
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000133You start by running the script "./configure", which figures out your
134system configuration and creates several Makefiles. (It takes a
135minute or two -- please be patient!) When it's done, you are ready to
136run make. You may want to pass options to the configure script -- see
137the section below on configuration options and variables.
138
139To build Python, you normally type "make" in the toplevel directory.
140This will recursively run make in each of the subdirectories Parser,
141Objects, Python and Modules, creating a library file in each one. The
142executable of the interpreter is built in the Modules subdirectory and
143moved up here when it is built. If you want or need to, you can also
144chdir into each subdirectory in turn and run make there manually (do
145the Modules subdirectory last!).
146
147Once you have built an interpreter, see the subsections below on
148testing, configuring additional modules, and installation. If you run
149in trouble, see the next section.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000150
Guido van Rossum0a516c91994-09-12 10:58:40 +0000151
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000152Troubleshooting
153---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +0000154
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000155See also the platform specific notes in the next section.
156
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000157If recursive makes fail, try invoking make as "make MAKE=make".
158
159If you run into other trouble, see section 3 of the FAQ (file
160Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000161
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000162If you rerun the configure script with different options, remove all
163object files by running "make clean" before rebuilding. Believe it or
164not, "make clean" sometimes helps to clean up other inexplicable
165problems as well. Try it before sending in a bug report!
166
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000167If the configure script fails or doesn't seem to find things that
168should be there, inspect the config.log file.
169
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000170
171Platform specific notes
172-----------------------
173
Guido van Rossum0447a321995-10-08 01:22:33 +0000174(Some of these may no longer apply. If you find you can build Python
175on these platforms without the special directions mentioned here, let
176me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000177
Guido van Rossum4462e931997-01-22 21:00:32 +0000178Solaris: When using Sun's C compiler with threads, at least on Solaris
179 2.5.1, you need to add the "-mt" compiler option (the simplest
180 way is probably to specify the compiler with this option as
181 the "CC" environment variable when running the configure
182 script).
183
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000184Linux: On Linux version 1.x, once you've built Python, use it to run
185 the regen script in the Lib/linux1 directory. Apparently
186 the files as distributed don't match the system headers on
187 some Linux versions. (The "h2py" command refers to
188 Tools/scripts/h2py.py.) The modules distributed for Linux 2.x
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000189 should be okay. Shared library support now works by default
Guido van Rossum4462e931997-01-22 21:00:32 +0000190 on ELF-based x86 Linux systems. (Note: when you change the
191 status of a module from static to shared, you must remove its
192 .o file or do a "make clean".)
193
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000194DEC Unix: When enabling threads, use --with-dec-threads, not
Guido van Rossum4462e931997-01-22 21:00:32 +0000195 --with-thread.
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000196
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000197AIX: A complete overhaul of the shared library support is now in
198 place. To enable it, uncomment the LINKCC line in the Setup
199 file. See Misc/AIX-NOTES for some notes on how it's done.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000200
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000201 WARNING! In some versions of AIX, you get errors about
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000202 Invalid Indent when running the Python test set. This appears
203 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000204 using OPT="" or OPT=-g, or use gcc. According to the latest
205 reports, it seems this compiler bug is still present in 4.2.1.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000206
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000207HP-UX: Shared library support now works by default (at least on HP-UX
208 9.x). One other problem remains: the HP ANSI C compiler (cc
209 -Aa) is too pedantic to use, but in K&R mode, it barfs on a
210 few files (complexobject.c, getargs.c and operator.c). Until
211 this is fixed, the following seems to work:
212
213 make -k # this compiles all but a few files
214 make OPT=-Aa # compile the remaining files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000215
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000216Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000217
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000218SCO: 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000219 defs. This is because all the SCO header files are broken.
220 Anything that isn't mentioned in the C standard it's
221 conditionally excluded when __STDC__ is defined.
222
223 2) Due to the U.S. export restrictions, SCO broke the crypt
224 stuff out into a separate library, libcrypt_i.a so the LIBS
225 needed be set to:
226
227 LIBS=' -lsocket -lcrypt_i'
228
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000229 3) According to at least one report, the above apply only to
230 SCO 3 -- Python builds out of the box on SCO 5.
231
Guido van Rossum4462e931997-01-22 21:00:32 +0000232SunOS: On SunOS 4.1.x, when using the SunPro C compiler, you may want
233 to use the '-Xa' option instead of '-Xc', to enable some
234 needed non-ANSI Sunisms.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000235
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000236NeXT: To build fat binaries, use the --with-next-archs switch
237 described below.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000238
Guido van Rossum40d63581997-08-14 19:45:30 +0000239QNX: Edit the top level Makefile to use the following compile options:
240 OPT = -Ox -Q -U_M_IX86 -U__WATCOMC__
241 Edit the Makefile in the Modules directory to read:
242 LDFLAGS = -N 48k
243
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000244
245Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000246---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000247
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000248You can configure the interpreter to contain fewer or more built-in
249modules by editing the file Modules/Setup. This file is initially
250copied (when the toplevel Makefile makes Modules/Makefile for the
251first time) from Setup.in; if it does not exist yet, make a copy
252yourself. Never edit Setup.in -- always edit Setup. Read the
253comments in the file for information on what kind of edits you can
254make. When you have edited Setup, Makefile and config.c in Modules
255will automatically be rebuilt the next time you run make in the
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000256toplevel directory. (When working inside the Modules directory, use
257"make Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16 +0000258
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000259The default collection of modules should build on any Unix system, but
260many optional modules should work on all modern Unices (e.g. try dbm,
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000261nis, termios, timing, syslog, curses, new, soundex, parser). Often
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000262the quickest way to determine whether a particular module works or not
263is to see if it will build: enable it in Setup, then if you get
264compilation or link errors, disable it -- you're missing support.
265
266On SGI IRIX, there are modules that interface to many SGI specific
267system libraries, e.g. the GL library and the audio hardware.
268
269For SunOS and Solaris, enable module "sunaudiodev" to support the
270audio device.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000271
Guido van Rossum4462e931997-01-22 21:00:32 +0000272In addition to the file Setup, you can also edit the file Setup.local.
273(the makesetup script processes both). You may find it more
274convenient to edit Setup.local and leave Setup alone. Then, when
275installing a new Python version, you can copy your old Setup.local
276file.
277
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000278
279Setting the optimization/debugging options
280------------------------------------------
281
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000282If you want or need to change the optimization/debugging options for
283the C compiler, assign to the OPT variable on the toplevel make
284command; e.g. "make OPT=-g" will build a debugging version of Python
285on most platforms. The default is OPT=-O; a value for OPT in the
286environment when the configure script is run overrides this default
287(likewise for CC; and the initial value for LIBS is used as the base
288set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000289
290
291Testing
292-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000293
294To test the interpreter that you have just built, type "make test".
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000295This runs the test set twice (once with no compiled files, once with
296the compiled files left by the previous test run). The test set
297produces some output. You can generally ignore the messages about
298skipped tests due to an optional feature that can't be imported (if
299you want to test those modules, edit Modules/Setup to configure them).
300If a messages is printed about a failed test or a traceback or core
301dump is produced, something's wrong. On some systems, test_strftime
302fails due to a non-standard implementation of strftime() in the C
303library. This can be ignored (or you can complain to your vendor).
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000304
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000305IMPORTANT: If the tests fail and you decide to mail a bug report,
306*don't* include the output of "make test". It is useless. Run the
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000307test that fails manually, as follows:
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000308
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000309 python ../Lib/test/test_whatever.py
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000310
311(substituting the top of the source tree for .. if you built in a
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000312different directory). This runs the test in verbose mode.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000313
314
315Installing
316----------
317
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000318Installing Python was never this easy!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000319
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000320To install the Python binary, library modules, shared library modules
321(see below), include files, configuration files, and the manual page,
322just type "make install". This will install all platform-independent
323files in subdirectories the directory given with the --prefix option
324to configure or the 'prefix' Make variable (default /usr/local), and
325all binary and other platform-specific files in subdirectories if the
326directory given by --exec-prefix or the 'exec_prefix' Make variable
327(defaults to the --prefix directory). All subdirectories created will
328have Python's version number in their name, e.g. the library modules
Guido van Rossum33fde571997-05-09 02:40:09 +0000329are installed in "/usr/local/lib/python1.5/" by default. The Python
330binary is installed as "python1.5" and a hard link named "python" is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000331created. The only file not installed with a version number in its
332name is the manual page, installed as "/usr/local/man/man1/python.1"
333by default.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000334
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000335If you have a previous installation of a pre-1.4 Python that you don't
336want to replace yet, use "make altinstall". This installs the same
337set of files as "make install" except it doesn't create the hard link
Guido van Rossum33fde571997-05-09 02:40:09 +0000338to "python1.5" named "python" and it doesn't install the manual page
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000339at all.
340
341The only thing you may have to install manually is the Python mode for
342Emacs. (But then again, more recent versions of Emacs may already
343have it!) This is the file Misc/python-mode.el; follow the
344instructions that came with Emacs for installation of site specific
345files.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000346
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000347
348Configuration options and variables
349-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000350
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000351Some special cases are handled by passing options to the configure
352script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000353
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000354WARNING: if you rerun the configure script with different options, you
355must run "make clean" before rebuilding. Exceptions to this rule:
356after changing --prefix or --exec-prefix, all you need to do is remove
Guido van Rossumb06df271997-08-05 21:50:20 +0000357Modules/getpath.o.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000358
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000359--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
360 it finds it. If you don't want this, or if this compiler is
361 installed but broken on your platform, pass the option
362 --without-gcc. You can also pass "CC=cc" (or whatever the
363 name of the proper C compiler is) in the environment, but the
364 advantage of using --without-gcc is that this option is
365 remembered by the config.status script for its --recheck
366 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000367
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000368--prefix, --exec-prefix: If you want to install the binaries and the
369 Python library somewhere else than in /usr/local/{bin,lib},
370 you can pass the option --prefix=DIRECTORY; the interpreter
371 binary will be installed as DIRECTORY/bin/python and the
372 library files as DIRECTORY/lib/python/*. If you pass
373 --exec-prefix=DIRECTORY (as well) this overrides the
374 installation prefix for architecture-dependent files (like the
375 interpreter binary). Note that --prefix=DIRECTORY also
376 affects the default module search path (sys.path), when
377 Modules/config.c is compiled. Passing make the option
378 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
379 prefix set at configuration time; this may be more convenient
380 than re-running the configure script if you change your mind
381 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000382
Guido van Rossumb06df271997-08-05 21:50:20 +0000383--with-readline: This option is no longer supported. To use GNU
384 readline, enable module "readline" in the Modules/Setup file.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000385
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000386--with-thread: On most Unix systems, you can now use multiple threads.
Guido van Rossum4462e931997-01-22 21:00:32 +0000387 To enable this, pass --with-thread. (--with-threads is an
388 alias.) If the library required for threads lives in a
Guido van Rossum8d90f9d1997-05-22 20:13:25 +0000389 peculiar place, you can use --with-thread=DIRECTORY. NOTE:
390 you must also enable the thread module by uncommenting it in
391 the Modules/Setup file. (Threads aren't enabled automatically
392 because there are run-time penalties when support for them is
393 compiled in even if you don't use them.) IMPORTANT: run "make
394 clean" after changing (either enabling or disabling) this
395 option! Note: for DEC Unix use --with-dec-threads instead.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000396
397--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
398 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000399 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000400 This is enabled (after you've ftp'ed and compiled the dl
401 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
402 is the absolute pathname of the dl library. (Don't bother on
403 IRIX 5, it already has dynamic linking using SunOS style
404 shared libraries.) Support for this feature is deprecated.
405
406--with-dl-dld: Dynamic loading of modules is rumoured to be supported
407 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
408 Symmetry (Dynix), and Atari ST. This is done using a
409 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000410 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000411 emulation of the SGI dl library mentioned above (the emulation
412 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000413 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000414 enable this, ftp and compile both libraries, then call the
415 configure passing it the option
416 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
417 the absolute pathname of the dl emulation library and
418 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
419 (Don't bother on SunOS 4 or 5, they already have dynamic
420 linking using shared libraries.) Support for this feature is
421 deprecated.
422
423--with-libm, --with-libc: It is possible to specify alternative
424 versions for the Math library (default -lm) and the C library
425 (default the empty string) using the options
426 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
427 if your system requires that you pass -lc_s to the C compiler
428 to use the shared C library, you can pass --with-libc=-lc_s.
429 These libraries are passed after all other libraries, the C
430 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000431
432--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
433 all compiled binaries with the architectures listed. Includes
434 correctly setting the target architecture specific resource
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000435 directory. (This option is not supported on other platforms.)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000436
Guido van Rossumd02ba451996-07-31 17:36:01 +0000437--with-libs='libs': Add 'libs' to the LIBS that the python
438 linked against.
439
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000440
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000441Building for multiple architectures (using the VPATH feature)
442-------------------------------------------------------------
443
444If your file system is shared between multiple architectures, it
445usually is not necessary to make copies of the sources for each
446architecture you want to support. If the make program supports the
447VPATH feature, you can create an empty build directory for each
448architecture, and in each directory run the configure script (on the
449appropriate machine with the appropriate options). This creates the
450necessary subdirectories and the Makefiles therein. The Makefiles
451contain a line VPATH=... which points to directory containing the
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000452actual sources. (On SGI systems, use "smake -J1" instead of "make" if
453you use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000454
455For example, the following is all you need to build a minimal Python
456in /usr/tmp/python (assuming ~guido/src/python is the toplevel
457directory and you want to build in /usr/tmp/python):
458
459 $ mkdir /usr/tmp/python
460 $ cd /usr/tmp/python
461 $ ~guido/src/python/configure
462 [...]
463 $ make
464 [...]
465 $
466
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000467Note that Modules/Makefile copies the original Setup file to the build
468directory if it finds no Setup file there. This means that you can
469edit the Setup file for each architecture independently. For this
470reason, subsequent changes to the original Setup file are not tracked
471automatically, as they might overwrite local changes. To force a copy
472of a changed original Setup file, delete the target Setup file. (The
473makesetup script supports multiple input files, so if you want to be
474fancy you can change the rules to create an empty Setup.local if it
475doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
476however this assumes that you only need to add modules.)
477
478
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000479Building on non-UNIX systems
480----------------------------
481
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000482Building Python for a PC is now a piece of cake!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000483
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000484Enter the directory "PC" and read the file "readme.txt". Most popular
485non-Unix PC platforms and compilers are supported (Unix ports to the
486PC such as Linux, FreeBSD or Solaris-x86 of course use the standard
487Unix build instructions).
488
489For the Mac, a separate source distribution will be made available,
490for use with the CodeWarrior compiler. If you are interested in Mac
491development, join the PythonMac Special Interest Group
492(http://www.python.org/sigs/pythonmac-sig/, or send email to
493pythonmac-sig-request@python.org).
494
495Of course, there are also binary distributions available for these
496platforms -- see http://www.python.org/python/.
497
498To port Python to a new non-UNIX system, you will have to fake the
499effect of running the configure script manually (for Mac and PC, this
500has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000501config.h.in to config.h and edit the latter to reflect the actual
502configuration of your system. Most symbols must simply be defined as
5031 only if the corresponding feature is present and can be left alone
504otherwise; however RETSIGTYPE must always be defined, either as int or
505as void, and the *_t type symbols must be defined as some variant of
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000506int if they need to be defined at all.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000507
508
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000509
510Miscellaneous issues
511====================
512
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000513Documentation
514-------------
515
516All documentation is provided in the subdirectory Doc in the form of
517LaTeX files. In order of importance for new users: Tutorial (tut),
518Library Reference (lib), Language Reference (ref), Extending (ext).
519Especially the Library Reference is of immense value since much of
520Python's power (including the built-in data types and functions!) is
521described here.
522
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000523To print the documentation from the LaTeX files, chdir into the Doc
524subdirectory, type "make" (let's hope you have LaTeX installed!), and
525send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
526ext.ps) to the printer. See the README file there. If you don't have
527LaTeX, you can ftp the PostScript files from the ftp archives (see
528below).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000529
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000530All documentation is also available on-line via the Python web site
531(http://www.python.org/, see below). It can also be downloaded
532separately from the ftp archives (see below) in Emacs INFO, HTML or
533PostScript form -- see the web site or the FAQ (file Misc/FAQ) for
534more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000535
536
537Emacs mode
538----------
539
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000540There's an excellent Emacs editing mode for Python code; see the file
541Misc/python-mode.el. Originally written by Tim Peters, it is now
542maintained by Barry Warsaw <bwarsaw@cnri.reston.va.us>.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000543
544
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000545Web site
546--------
547
548Python's own web site has URL http://www.python.org/. Come visit us!
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000549There are a number of mirrors, listed on the home page -- try a mirror
550that's close you you.
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000551
552
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000553Ftp site
554--------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000555
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000556Python's own ftp site is ftp.python.org, directory /pub/python. See
557the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000558Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000559
560
561Newsgroup and mailing list
562--------------------------
563
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000564There are a newsgroup and a mailing list devoted to Python. The
565newsgroup, comp.lang.python, contains exactly the same messages as the
566mailing list (though not always in the same order, due to the
567mysterious nature of the Usenet news distribution algorithm). To
568subscribe to the mailing list, send mail containing your real name and
569e-mail address to "python-list-request@cwi.nl". Use the same address
570if you want to unsibscribed. (A real person reads these messages, so
571no LISTPROC or Majordomo commands, please, and please be patient --
572normal turn-around time is about one working day.)
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000573
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000574The Python web site contains a search form that lets you search the
575newsgroup archives (or the web site itself). Click on the "search"
576link in the banner menu on any page of http://www.python.org/.
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000577
578
579Bug reports
580-----------
581
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000582Bugs are best reported to the comp.lang.python newsgroup or the Python
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000583mailing list -- see the section "Newsgroup and mailing list" above.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000584Before posting, check the newsgroup archives (see above) to see if
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000585your bug has already been reported!
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000586
587
588Questions
589---------
590
591For help, if you can't find it in the manuals, the FAQ or on the web
592site, it's best to post to the comp.lang.python or the Python mailing
593list (see above). If you specifically don't want to involve the
594newsgroup or mailing list, send questions to python-help@python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000595
596
597The Tk interface
598----------------
599
600Tk (the user interface component of John Ousterhout's Tcl language) is
601also usable from Python. Since this requires that you first build and
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000602install Tcl/Tk, the Tk interface is not enabled by default. It works
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000603with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0. I didn't
604have the time to test it with Tcl 7.6 and Tk 4.2 yet, but it might
605well work.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000606
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000607See http://www.sunlabs.com/research/tcl/ for more info on where to get
Guido van Rossum33fde571997-05-09 02:40:09 +0000608Tcl/Tk. Also http://sunscript.sun.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000609
610To enable the Python/Tk interface, once you've built and installed
611Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000612for the string "_tkinter". Uncomment one (normally the first) of the
613lines beginning with "#_tkinter" and un-comment the line beginning
614with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual
615places, you will have to edit the first line to fix or add -I and -L
616options. See the Build Instructions above for more details.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000617
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000618There is little documentation on how to use Tkinter; however most of
619the Tk manual pages apply quite straightforwardly. Begin with
620fetching the "Tk Lifesaver" document,
621e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped
622tar file containing a PostScript file) or the on-line version
623http://www.python.org/doc/life-preserver/index.html. Reading the
624Tkinter.py source will reveal most details on how Tkinter calls are
625translated into Tcl code.
626
627There are demos in the Demo/tkinter directory, in the subdirectories
628guido, matt and www (the matt and guido subdirectories have been
629overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000630
631Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000632lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter"
633(lower case t and leading underscore) which lives in
634Modules/_tkinter.c. Demos and normal Tk applications only import the
635Python Tkinter module -- only the latter uses the C _tkinter module
636directly. In order to find the C _tkinter module, it must be compiled
637and linked into the Python interpreter -- the _tkinter line in the
638Setup file does this. In order to find the Python Tkinter module,
639sys.path must be set correctly -- the TKPATH assignment in the Setup
640file takes care of this, but only if you install Python properly
641("make install libinstall"). (You can also use dynamic loading for
642the C _tkinter module, in which case you must manually fix up sys.path
643or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000644
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000645
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000646Distribution structure
647----------------------
648
649Most subdirectories have their own README file. Most files have
650comments.
651
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000652BUGS A list of known bugs (not completely up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000653Demo/ Demonstration scripts, modules and programs
654Doc/ Documentation (LaTeX sources)
655Grammar/ Input for the parser generator
656Include/ Public header files
657Lib/ Python library modules
658Makefile.in Source from which config.status creates Makefile
659Misc/ Miscellaneous files
660Modules/ Implementation of most built-in modules
661Objects/ Implementation of most built-in object types
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000662PC/ PC porting files (DOS, Windows, NT, OS/2)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000663Parser/ The parser and tokenizer and their input handling
664Python/ The "compiler" and interpreter
665README The file you're reading now
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000666TODO A list of things that could be done (not up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000667Tools/ Some useful programs written in Python
668acconfig.h Additional input for the autoheader program
669config.h.in Source from which config.status creates config.h
670configure Configuration shell script (GNU autoconf output)
671configure.in Configuration specification (GNU autoconf input)
672install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000673
674The following files will (may) be created in the toplevel directory by
675the configuration and build processes:
676
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000677Makefile Build rules
678config.cache cache of configuration variables
679config.h Configuration header
680config.log log from last configure run
681config.status status from last run of configure script
682python The executable interpreter
683tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000684
685
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000686Author's address
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000687================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000688
689Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000690CNRI
6911895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000692Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000693USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000694
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000695E-mail: guido@cnri.reston.va.us or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000696
697
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000698
699Copyright notice
700================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000701
702The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000703as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000704
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000705----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000706Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
707The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000708
709 All Rights Reserved
710
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000711Permission to use, copy, modify, and distribute this software and its
712documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000713provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000714both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000715supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000716Centrum or CWI or Corporation for National Research Initiatives or
717CNRI not be used in advertising or publicity pertaining to
718distribution of the software without specific, written prior
719permission.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000720
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000721While CWI is the initial source for this software, a modified version
722is made available by the Corporation for National Research Initiatives
723(CNRI) at the Internet address ftp://ftp.python.org.
724
725STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
726REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
727MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
728CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
729DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
730PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
731TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
732PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000733----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000734
735
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000736--Guido van Rossum (home page: http://www.python.org/~guido/)