Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 1 | This is Python release 1.4 beta 2 |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 2 | ================================= |
| 3 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 4 | It's a beta release. Use this only if you want to help me iron the |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 5 | last wrinkles out of the distribution before I release the real 1.4 |
| 6 | release. In particular, I'm interested in porting experiences to Unix |
| 7 | boxes. It should build out of the box using "./configure; make". |
| 8 | Also try running configue with the --with-thread and --with-readline |
| 9 | options (described below). |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 12 | What's new in this release? |
| 13 | --------------------------- |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 14 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 15 | A list of things that changed since 1.4 beta 1 can be found in |
| 16 | Misc/NEWS. This file will eventually be updated to also list what's |
| 17 | new since to 1.3. |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 18 | |
| 19 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 20 | What is Python anyway? |
| 21 | ---------------------- |
| 22 | |
| 23 | Python is an interpreted object-oriented programming language, and is |
| 24 | often compared to Tcl, Perl or Scheme. For a quick summary of what |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 25 | Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ. If you |
| 26 | have web access, point your browser to <URL:http://www.python.org>. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 27 | |
| 28 | |
| 29 | If you don't read instructions |
| 30 | ------------------------------ |
| 31 | |
| 32 | Congratulations on getting this far. :-) |
| 33 | |
| 34 | To start building right away (on UNIX): type "./configure" in the |
| 35 | current directory and when it finishes, type "make". The section |
| 36 | Build Instructions below is still recommended reading. :-) |
| 37 | |
| 38 | |
| 39 | Copyright issues |
| 40 | ---------------- |
| 41 | |
| 42 | Python is COPYRIGHTED but free to use for all. See the full copyright |
| 43 | notice at the end of this file. |
| 44 | |
| 45 | The Python distribution is *not* affected by the GNU Public Licence |
| 46 | (GPL). There are interfaces to some GNU code but these are entirely |
| 47 | optional and no GNU code is distributed with Python. For all these |
| 48 | packages, GPL-free public domain versions also exist. |
| 49 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 50 | |
Guido van Rossum | ff84049 | 1995-09-18 22:02:47 +0000 | [diff] [blame] | 51 | A modest plug |
| 52 | ============= |
| 53 | |
| 54 | |
Guido van Rossum | 0447a32 | 1995-10-08 01:22:33 +0000 | [diff] [blame] | 55 | ************************************************************************* |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 56 | * * |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 57 | * If you use Python, please consider joining the Python Software * |
| 58 | * Activity (PSA). See http://www.python.org/psa/. * |
| 59 | * * |
| 60 | * Organizations making heavy use of Python are especially invited * |
| 61 | * to become corporate members! * |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 62 | * * |
Guido van Rossum | 0447a32 | 1995-10-08 01:22:33 +0000 | [diff] [blame] | 63 | ************************************************************************* |
Guido van Rossum | ff84049 | 1995-09-18 22:02:47 +0000 | [diff] [blame] | 64 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 65 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 66 | Build instructions |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 67 | ================== |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 68 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 69 | Before you start building Python, you must first configure it. This |
| 70 | entails (at least) running the script "./configure", which figures out |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 71 | your system configuration and creates several Makefiles. (It takes a |
| 72 | minute or two -- please be patient!) When it's done, you are ready to |
| 73 | run make. Typing "make" in the toplevel directory will recursively |
| 74 | run make in each of the subdirectories Parser, Objects, Python and |
| 75 | Modules, creating a library file in each one. The executable of the |
| 76 | interpreter is built in the Modules subdirectory and moved up here |
| 77 | when it is built. If you want or need to, you can also chdir into |
| 78 | each subdirectory in turn and run make there manually (do the Modules |
| 79 | subdirectory last!). |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 80 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 81 | NOTE: if you rerun the configure script with different options, remove |
| 82 | all object files by running "make clean" before rebuilding. Believe |
| 83 | it or not, "make clean" sometimes helps to clean up other inexplicable |
| 84 | problems as well. Try it before sending in a bug report! |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 85 | |
Guido van Rossum | 0a516c9 | 1994-09-12 10:58:40 +0000 | [diff] [blame] | 86 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 87 | Troubleshooting |
| 88 | --------------- |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 89 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 90 | If recursive makes fail, try invoking make as "make MAKE=make". |
| 91 | |
| 92 | If you run into other trouble, see section 3 of the FAQ (file |
| 93 | Misc/FAQ) for hints on what can go wrong, and how to fix it. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 94 | |
| 95 | |
| 96 | Platform specific notes |
| 97 | ----------------------- |
| 98 | |
Guido van Rossum | 0447a32 | 1995-10-08 01:22:33 +0000 | [diff] [blame] | 99 | (Some of these may no longer apply. If you find you can build Python |
| 100 | on these platforms without the special directions mentioned here, let |
| 101 | me know so I can remove them!) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 102 | |
Guido van Rossum | 8eca2c2 | 1996-02-14 18:37:46 +0000 | [diff] [blame] | 103 | Linux: Once you've built Python, use it to run the regen.py script in |
| 104 | the Lib/linux1 directory. Apparently the files as distributed |
| 105 | don't match the system headers on some Linux versions. |
| 106 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 107 | AIX: Read the files Misc/AIX-NOTES* before trying to build. |
Guido van Rossum | a3b4b61 | 1996-07-21 02:48:16 +0000 | [diff] [blame] | 108 | WARNING! In some versions of AIX, you get errors about |
| 109 | Invalid Indent when running the Python test set. This appears |
| 110 | to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c |
| 111 | using OPT="" or OPT=-g, or use gcc. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 112 | |
| 113 | HP-UX: Read the file Misc/HPUX-NOTES if you want to be able to |
| 114 | use shared libraries for dynamically loaded modules. |
| 115 | |
| 116 | Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"! |
| 117 | |
| 118 | SCO: 1) Everything works much better if you add -U__STDC__ to the |
| 119 | defs. This is because all the SCO header files are broken. |
| 120 | Anything that isn't mentioned in the C standard it's |
| 121 | conditionally excluded when __STDC__ is defined. |
| 122 | |
| 123 | 2) Due to the U.S. export restrictions, SCO broke the crypt |
| 124 | stuff out into a separate library, libcrypt_i.a so the LIBS |
| 125 | needed be set to: |
| 126 | |
| 127 | LIBS=' -lsocket -lcrypt_i' |
| 128 | |
Guido van Rossum | a3b4b61 | 1996-07-21 02:48:16 +0000 | [diff] [blame] | 129 | 3) According to at least one report, the above apply only to |
| 130 | SCO 3 -- Python builds out of the box on SCO 5. |
| 131 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 132 | |
| 133 | Configuring the set of built-in modules |
| 134 | --------------------------------------- |
Guido van Rossum | 19e0c26 | 1995-01-17 16:36:34 +0000 | [diff] [blame] | 135 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 136 | You can configure the interpreter to contain fewer or more built-in |
| 137 | modules by editing the file Modules/Setup. This file is initially |
| 138 | copied (when the toplevel Makefile makes Modules/Makefile for the |
| 139 | first time) from Setup.in; if it does not exist yet, make a copy |
| 140 | yourself. Never edit Setup.in -- always edit Setup. Read the |
| 141 | comments in the file for information on what kind of edits you can |
| 142 | make. When you have edited Setup, Makefile and config.c in Modules |
| 143 | will automatically be rebuilt the next time you run make in the |
Guido van Rossum | 9444ce0 | 1994-10-20 22:10:23 +0000 | [diff] [blame] | 144 | toplevel directory. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 145 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 146 | Especially on SGI IRIX, there are modules that interface to many SGI |
| 147 | specific system libraries, e.g. the GL library and the audio hardware. |
| 148 | |
| 149 | |
| 150 | Setting the optimization/debugging options |
| 151 | ------------------------------------------ |
| 152 | |
| 153 | If you want to change the optimization/debugging options for the C |
| 154 | compiler, assign to the OPT variable on the toplevel make command; |
| 155 | e.g. "make OPT=-g" will build a debugging version of Python on most |
| 156 | platforms. The default is OPT=-O; a value for OPT in the environment |
| 157 | when the configure script is run overrides this default (likewise for |
| 158 | CC; and the initial value for LIBS is used as the base set of |
| 159 | libraries to link with). |
| 160 | |
| 161 | |
| 162 | Testing |
| 163 | ------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 164 | |
| 165 | To test the interpreter that you have just built, type "make test". |
| 166 | This runs the test set silently, twice (once with no compiled files, |
| 167 | once with the compiled files left by the previous test run). Each |
| 168 | test run should print "All tests OK." and nothing more. (The test set |
| 169 | does not test the built-in modules, but will find most other problems |
| 170 | with the interpreter.) |
| 171 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 172 | IMPORTANT: If the tests fail and you decide to mail a bug report, |
| 173 | *don't* include the output of "make test". It is useless. Run the |
| 174 | following command instead: |
| 175 | |
| 176 | PYTHONPATH=../Lib:../Lib/test:./Modules ./python -c 'import testall' |
| 177 | |
| 178 | (substituting the top of the source tree for .. if you built in a |
| 179 | different directory). This gives the output of the tests and shows |
| 180 | which test failed. |
| 181 | |
| 182 | |
| 183 | Installing |
| 184 | ---------- |
| 185 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 186 | XXX TO be rewritten for new install procedure. |
| 187 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 188 | To install the interpreter as /usr/local/bin/python, type "make |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 189 | bininstall". To install the library as /usr/local/lib/python, type |
| 190 | "make libinstall". To install the manual page as |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 191 | /usr/local/man/man1/python.1, type "make maninstall". To install the |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 192 | Emacs editing mode for Python, manually copy the file |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 193 | Misc/python-mode.el to your local Emacs lisp directory. The directory |
| 194 | /usr/local can be overridden at configuration time by passing |
| 195 | --prefix=DIRECTORY to the configure script, or at make time by passing |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 196 | "prefix=DIRECTORY" to make. See below for more information on |
| 197 | --prefix. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 198 | |
| 199 | If you plan to do development of extension modules or to embed Python |
| 200 | in another application and don't want to reference the original source |
| 201 | tree, you can type "make inclinstall" and "make libainstall" to |
| 202 | install the include files and lib*.a files, respectively, as |
| 203 | /usr/local/include/Py/*.h and /usr/local/lib/python/lib/lib*.a. The |
| 204 | make libainstall target also installs copies of several other files |
| 205 | used or produced during the build process which are needed to build |
| 206 | extensions or to generate their Makefiles. |
| 207 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 208 | |
| 209 | Configuration options and variables |
| 210 | ----------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 211 | |
| 212 | Some special cases are handled by passing environment variables or |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 213 | options to the configure script. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 214 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 215 | NOTE: if you rerun the configure script with different options, remove |
| 216 | all object files by running "make clean" before rebuilding. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 217 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 218 | --with(out)-gcc: The configure script uses gcc (the GNU C compiler) if |
| 219 | it finds it. If you don't want this, or if this compiler is |
| 220 | installed but broken on your platform, pass the option |
| 221 | --without-gcc. You can also pass "CC=cc" (or whatever the |
| 222 | name of the proper C compiler is) in the environment, but the |
| 223 | advantage of using --without-gcc is that this option is |
| 224 | remembered by the config.status script for its --recheck |
| 225 | option. |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 226 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 227 | --prefix, --exec-prefix: If you want to install the binaries and the |
| 228 | Python library somewhere else than in /usr/local/{bin,lib}, |
| 229 | you can pass the option --prefix=DIRECTORY; the interpreter |
| 230 | binary will be installed as DIRECTORY/bin/python and the |
| 231 | library files as DIRECTORY/lib/python/*. If you pass |
| 232 | --exec-prefix=DIRECTORY (as well) this overrides the |
| 233 | installation prefix for architecture-dependent files (like the |
| 234 | interpreter binary). Note that --prefix=DIRECTORY also |
| 235 | affects the default module search path (sys.path), when |
| 236 | Modules/config.c is compiled. Passing make the option |
| 237 | prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the |
| 238 | prefix set at configuration time; this may be more convenient |
| 239 | than re-running the configure script if you change your mind |
| 240 | about the install prefix... |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 241 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 242 | --with-readline: You can use the GNU readline library to improve the |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 243 | interactive user interface. This gives you line editing and |
| 244 | command history when calling Python interactively. Unless GNU |
| 245 | readline is a standard part of your system (it is on Linux), |
| 246 | you need to configure build the GNU readline library before |
| 247 | running the configure script. Its sources are not distributed |
| 248 | with Python; you can ftp them from any GNU mirror site, or |
| 249 | from its home site: |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 250 | <URL:ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz> (or |
| 251 | a higher version number -- using version 1.x is not |
| 252 | recommended). |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 253 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 254 | A GPL-free version was posted to comp.sources.misc in volume |
| 255 | 31 and is widely available from FTP archive sites, e.g. |
| 256 | <URL:ftp://gatekeeper.dec.com/.b/usenet/comp.sources.misc/ |
| 257 | volume31/editline/part01.Z> |
| 258 | |
| 259 | Pass the Python configure script the option |
| 260 | --with-readline=DIRECTORY where DIRECTORY is the absolute |
| 261 | pathname of the directory where you've built the readline |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 262 | library. If GNU readline is a standard part of your system, |
| 263 | don't pass '=DIRECTORY'. Some hints on building and using the |
| 264 | readline library are in the FAQ (file Misc/FAQ). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 265 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 266 | --with-thread: On most Unix systems, you can now use multiple threads. |
| 267 | To enable this, pass --with-thread. If the library required |
| 268 | for threads lives in a peculiar place, you can use |
| 269 | --with-thread=DIRECTORY. In the Modules/Setup file, enable |
| 270 | the thread module. (Threads aren't enabled automatically |
| 271 | because there are run-time penalties when support for them is |
| 272 | compiled in even if you don't use them.) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 273 | |
| 274 | --with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is |
| 275 | supported by the "dl" library by Jack Jansen, which is |
| 276 | ftp'able from <URL:ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z>. |
| 277 | This is enabled (after you've ftp'ed and compiled the dl |
| 278 | library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY |
| 279 | is the absolute pathname of the dl library. (Don't bother on |
| 280 | IRIX 5, it already has dynamic linking using SunOS style |
| 281 | shared libraries.) Support for this feature is deprecated. |
| 282 | |
| 283 | --with-dl-dld: Dynamic loading of modules is rumoured to be supported |
| 284 | on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent |
| 285 | Symmetry (Dynix), and Atari ST. This is done using a |
| 286 | combination of the GNU dynamic loading package |
| 287 | (<URL:ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z>) and an |
| 288 | emulation of the SGI dl library mentioned above (the emulation |
| 289 | can be found at |
| 290 | <URL:ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z>). To |
| 291 | enable this, ftp and compile both libraries, then call the |
| 292 | configure passing it the option |
| 293 | --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is |
| 294 | the absolute pathname of the dl emulation library and |
| 295 | DLD_DIRECTORY is the absolute pathname of the GNU dld library. |
| 296 | (Don't bother on SunOS 4 or 5, they already have dynamic |
| 297 | linking using shared libraries.) Support for this feature is |
| 298 | deprecated. |
| 299 | |
| 300 | --with-libm, --with-libc: It is possible to specify alternative |
| 301 | versions for the Math library (default -lm) and the C library |
| 302 | (default the empty string) using the options |
| 303 | --with-libm=STRING and --with-libc=STRING, respectively. E.g. |
| 304 | if your system requires that you pass -lc_s to the C compiler |
| 305 | to use the shared C library, you can pass --with-libc=-lc_s. |
| 306 | These libraries are passed after all other libraries, the C |
| 307 | library last. |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 308 | |
| 309 | --with-next-archs='arch1 arch2': Under NEXTSTEP, this will build |
| 310 | all compiled binaries with the architectures listed. Includes |
| 311 | correctly setting the target architecture specific resource |
| 312 | directory. |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 313 | |
Guido van Rossum | d02ba45 | 1996-07-31 17:36:01 +0000 | [diff] [blame^] | 314 | --with-libs='libs': Add 'libs' to the LIBS that the python |
| 315 | linked against. |
| 316 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 317 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 318 | Building for multiple architectures (using the VPATH feature) |
| 319 | ------------------------------------------------------------- |
| 320 | |
| 321 | If your file system is shared between multiple architectures, it |
| 322 | usually is not necessary to make copies of the sources for each |
| 323 | architecture you want to support. If the make program supports the |
| 324 | VPATH feature, you can create an empty build directory for each |
| 325 | architecture, and in each directory run the configure script (on the |
| 326 | appropriate machine with the appropriate options). This creates the |
| 327 | necessary subdirectories and the Makefiles therein. The Makefiles |
| 328 | contain a line VPATH=... which points to directory containing the |
Guido van Rossum | 6b111b0 | 1994-10-11 15:03:34 +0000 | [diff] [blame] | 329 | actual sources. (On SGI systems, use "smake" instead of "make" if you |
| 330 | use VPATH -- don't try gnumake.) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 331 | |
| 332 | For example, the following is all you need to build a minimal Python |
| 333 | in /usr/tmp/python (assuming ~guido/src/python is the toplevel |
| 334 | directory and you want to build in /usr/tmp/python): |
| 335 | |
| 336 | $ mkdir /usr/tmp/python |
| 337 | $ cd /usr/tmp/python |
| 338 | $ ~guido/src/python/configure |
| 339 | [...] |
| 340 | $ make |
| 341 | [...] |
| 342 | $ |
| 343 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 344 | Note that Modules/Makefile copies the original Setup file to the build |
| 345 | directory if it finds no Setup file there. This means that you can |
| 346 | edit the Setup file for each architecture independently. For this |
| 347 | reason, subsequent changes to the original Setup file are not tracked |
| 348 | automatically, as they might overwrite local changes. To force a copy |
| 349 | of a changed original Setup file, delete the target Setup file. (The |
| 350 | makesetup script supports multiple input files, so if you want to be |
| 351 | fancy you can change the rules to create an empty Setup.local if it |
| 352 | doesn't exist and run it with arguments $(srcdir)/Setup Setup.local; |
| 353 | however this assumes that you only need to add modules.) |
| 354 | |
| 355 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 356 | Building on non-UNIX systems |
| 357 | ---------------------------- |
| 358 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 359 | XXX Rewrite -- nothing in this chapter is true any more. |
| 360 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 361 | On non-UNIX systems, you will have to fake the effect of running the |
| 362 | configure script manually. A good start is to copy the file |
| 363 | config.h.in to config.h and edit the latter to reflect the actual |
| 364 | configuration of your system. Most symbols must simply be defined as |
| 365 | 1 only if the corresponding feature is present and can be left alone |
| 366 | otherwise; however RETSIGTYPE must always be defined, either as int or |
| 367 | as void, and the *_t type symbols must be defined as some variant of |
| 368 | int if they need to be defined at all. Then arrange that the symbol |
| 369 | HAVE_CONFIG_H is defined during compilation (usually by passing an |
| 370 | argument of the form `-DHAVE_CONFIG_H' to the compiler, but this is |
| 371 | necessarily system-dependent). |
| 372 | |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 373 | I have tried to collect instructions, Makefiles and additional sources |
| 374 | for various platforms in this release. The following directories |
| 375 | exist: |
| 376 | |
| 377 | Mac/ Apple Macintosh, using THINK C 6.0 or MPW 3.2. |
| 378 | Dos/ MS-DOS and Windows 3.1, using Microsoft C. |
| 379 | Nt/ Windows NT, using Microsoft Visual C/C++. |
| 380 | Os2/ OS/2. |
| 381 | |
| 382 | Most of these instructions were last tested with a previous Python |
| 383 | release, so you may still experience occasional problems. If you have |
| 384 | fixes or suggestions, please let me know and I'll try to incorporate |
| 385 | them in the next release. |
| 386 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 387 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 388 | |
| 389 | Miscellaneous issues |
| 390 | ==================== |
| 391 | |
| 392 | |
| 393 | Documentation |
| 394 | ------------- |
| 395 | |
| 396 | All documentation is provided in the subdirectory Doc in the form of |
| 397 | LaTeX files. In order of importance for new users: Tutorial (tut), |
| 398 | Library Reference (lib), Language Reference (ref), Extending (ext). |
| 399 | Especially the Library Reference is of immense value since much of |
| 400 | Python's power (including the built-in data types and functions!) is |
| 401 | described here. |
| 402 | |
| 403 | To print the documentation from the LaTeX files, chdir into the Doc |
| 404 | subdirectory, type "make" (let's hope you have LaTeX installed!), and |
| 405 | send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and |
| 406 | ext.ps) to the printer. See the README file there. |
| 407 | |
| 408 | All documentation is also available on-line via the World-Wide Web |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 409 | (WWW): <URL:http://www.python.org>. It can also be downloaded |
| 410 | separately from the ftp archives (see below) in Emacs INFO, HTML or |
| 411 | PostScript form -- see the FAQ (file Misc/FAQ) for more info. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 412 | |
| 413 | |
| 414 | Emacs mode |
| 415 | ---------- |
| 416 | |
| 417 | There's an excellent Emacs editing mode for Python code; see the file |
| 418 | Misc/python-mode.el. Originally written by Tim Peters, who's no |
| 419 | longer on the net, it is now maintained by Barry Warsaw |
| 420 | <bwarsaw@cnri.reston.va.com>. |
| 421 | |
Guido van Rossum | 3c294ca | 1995-06-14 18:17:22 +0000 | [diff] [blame] | 422 | BTW, if you want to use font-lock for Python sources, here's something |
| 423 | to put in your .emacs file: |
| 424 | |
| 425 | (defun my-python-mode-hook () |
| 426 | (setq font-lock-keywords python-font-lock-keywords) |
| 427 | (font-lock-mode 1)) |
| 428 | (add-hook 'python-mode-hook 'my-python-mode-hook) |
| 429 | |
| 430 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 431 | |
| 432 | Bug reports |
| 433 | ----------- |
| 434 | |
| 435 | Bugs are best reported to the comp.lang.python newsgroup or the Python |
| 436 | mailing list -- see the section "Newsgroup and mailing list" below. |
| 437 | Before posting, read the FAQ (file Misc/FAQ) first to see if your |
| 438 | problem has already been answered! |
| 439 | |
| 440 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 441 | Web site |
| 442 | -------- |
| 443 | |
| 444 | Python's own web site has URL http://www.python.org/. Come visit us! |
| 445 | |
| 446 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 447 | Ftp access |
| 448 | ---------- |
| 449 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 450 | Python's own ftp site is ftp.python.org, directory /pub/python. See |
| 451 | the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 452 | Python distribution. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 453 | |
| 454 | |
| 455 | Newsgroup and mailing list |
| 456 | -------------------------- |
| 457 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 458 | There are a newsgroup and a mailing list devoted to Python. The |
| 459 | newsgroup, comp.lang.python, contains exactly the same messages as the |
| 460 | mailing list (though not always in the same order, due to the |
| 461 | mysterious nature of Usenet news' flooding algorithms). To subscribe |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 462 | to the mailing list, send mail containing your real name and e-mail |
| 463 | address to "python-list-request@cwi.nl" (a real person reads these |
| 464 | messages, so no LISTPROC or Majordomo commands, please). |
| 465 | |
| 466 | |
| 467 | The Tk interface |
| 468 | ---------------- |
| 469 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 470 | XXX To be rewritten in the light of _tkinter and Tk 4.1. |
| 471 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 472 | Tk (the user interface component of John Ousterhout's Tcl language) is |
| 473 | also usable from Python. Since this requires that you first build and |
| 474 | install Tcl/Tk, the Tk interface is not enabled by default. It |
Guido van Rossum | 84c8c7f | 1995-08-28 02:44:24 +0000 | [diff] [blame] | 475 | requires Tcl 7.4 and Tk 4.0. (Support for Tk 3.6 and Tcl 7.3 can be |
| 476 | found in Lib/tk3inter/.) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 477 | |
| 478 | To enable the Python/Tk interface, once you've built and installed |
| 479 | Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search |
Jack Jansen | 10d0f8f | 1995-10-23 14:36:05 +0000 | [diff] [blame] | 480 | for the string "_tkinter". Un-comment one (normally the first) of the |
| 481 | lines beginning with "#_tkinter" and un-comment the line beginning with |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 482 | "#TKPATH". (If you have installed Tcl/Tk in unusual places you will |
| 483 | have to edit the first line as well to fix the -I and -L options.) |
| 484 | See the Build Instructions above for more details. |
| 485 | |
| 486 | There is little documentation. Begin with fetching the "Tk Lifesaver" |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 487 | document, |
| 488 | e.g. <URL:ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz> (a |
| 489 | gzipped tar file containing a PostScript file). There are demos in |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 490 | the Demo/tkinter directory, in the subdirectories guido, matt and www. |
| 491 | |
| 492 | Note that there's a Python module called "Tkinter" (capital T) which |
| 493 | lives in Lib/tkinter/Tkinter.py, and a C module called "tkinter" |
Jack Jansen | 10d0f8f | 1995-10-23 14:36:05 +0000 | [diff] [blame] | 494 | (lower case t) which lives in Modules/_tkinter.c. Demos and |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 495 | normal Tk applications only import the Python Tkinter module -- only |
Jack Jansen | 10d0f8f | 1995-10-23 14:36:05 +0000 | [diff] [blame] | 496 | the latter uses the C _tkinter module directly. In order to find the C |
| 497 | _tkinter module, it must be compiled and linked into the Python |
| 498 | interpreter -- the _tkinter line in the Setup file does this. In order |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 499 | to find the Python Tkinter module, sys.path must be set correctly -- |
| 500 | the TKPATH assignment in the Setup file takes care of this, but only |
| 501 | if you install Python properly ("make install libinstall"). (You can |
Jack Jansen | 10d0f8f | 1995-10-23 14:36:05 +0000 | [diff] [blame] | 502 | also use dynamic loading for the C _tkinter module, in which case you |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 503 | must manually fix up sys.path or set $PYTHONPATH for the Python |
| 504 | Tkinter module.) |
| 505 | |
Guido van Rossum | 0447a32 | 1995-10-08 01:22:33 +0000 | [diff] [blame] | 506 | See <URL:http://www.smli.com/research/tcl/> for more info on where |
Guido van Rossum | 84c8c7f | 1995-08-28 02:44:24 +0000 | [diff] [blame] | 507 | to get Tcl/Tk. |
| 508 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 509 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 510 | Distribution structure |
| 511 | ---------------------- |
| 512 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 513 | XXX To be redone! |
| 514 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 515 | Most subdirectories have their own README file. Most files have |
| 516 | comments. |
| 517 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 518 | Demo/ Demonstration scripts, modules and programs |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 519 | Doc/ Documentation (LaTeX sources) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 520 | Grammar/ Input for the parser generator |
| 521 | Include/ Public header files |
| 522 | Lib/ Python library modules |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 523 | Makefile.in Source from which config.status creates Makefile |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 524 | Misc/ Miscellaneous files |
| 525 | Modules/ Implementation of most built-in modules |
| 526 | Objects/ Implementation of most built-in object types |
| 527 | Parser/ The parser and tokenizer and their input handling |
| 528 | Python/ The "compiler" and interpreter |
| 529 | README The file you're reading now |
Guido van Rossum | e109aa7 | 1995-03-09 14:12:10 +0000 | [diff] [blame] | 530 | Tools/ Some useful programs written in Python |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 531 | acconfig.h Additional input for the autoheader program |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 532 | config.h.in Source from which config.status creates config.h |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 533 | configure Configuration shell script (GNU autoconf output) |
| 534 | configure.in Configuration specification (GNU autoconf input) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 535 | |
| 536 | The following files will (may) be created in the toplevel directory by |
| 537 | the configuration and build processes: |
| 538 | |
| 539 | Makefile Build rules |
| 540 | config.cache cache of configuration variables |
| 541 | config.h Configuration header |
| 542 | config.log log from last configure run |
| 543 | config.status status from last run of configure script |
| 544 | python The executable interpreter |
| 545 | tags, TAGS Tags files for vi and Emacs |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 546 | |
| 547 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 548 | Author's address |
| 549 | ---------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 550 | |
| 551 | Guido van Rossum |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 552 | CNRI |
| 553 | 1895 Preston White Drive |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 554 | Reston, VA 20191 |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 555 | USA |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 556 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 557 | E-mail: guido@cnri.reston.va.or or guido@python.org |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 558 | |
| 559 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 560 | |
| 561 | Copyright notice |
| 562 | ================ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 563 | |
| 564 | The Python source is copyrighted, but you can freely use and copy it |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 565 | as long as you don't change or remove the copyright notice: |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 566 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 567 | ---------------------------------------------------------------------- |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 568 | Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 569 | The Netherlands. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 570 | |
| 571 | All Rights Reserved |
| 572 | |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 573 | Permission to use, copy, modify, and distribute this software and its |
| 574 | documentation for any purpose and without fee is hereby granted, |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 575 | provided that the above copyright notice appear in all copies and that |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 576 | both that copyright notice and this permission notice appear in |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 577 | supporting documentation, and that the names of Stichting Mathematisch |
| 578 | Centrum or CWI not be used in advertising or publicity pertaining to |
| 579 | distribution of the software without specific, written prior permission. |
| 580 | |
| 581 | STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO |
| 582 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 583 | FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE |
| 584 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 585 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 586 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
| 587 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 588 | ---------------------------------------------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 589 | |
| 590 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 591 | --Guido van Rossum (home page: http://www.python.org/~guido/) |