Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 1 | This is a port of Python 2.3 to OS/2 using the EMX development tools |
| 2 | ========================================================================= |
| 3 | |
| 4 | What's new since the previous release |
| 5 | ------------------------------------- |
| 6 | |
| 7 | This release of the port incorporates the following changes from the |
Andrew MacIntyre | 7e5bf67 | 2002-12-04 12:40:49 +0000 | [diff] [blame] | 8 | October 24, 2002 release of the Python 2.2.2 port: |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 9 | |
| 10 | - based on the Python v2.3 final release source. |
Andrew MacIntyre | ffcf899 | 2002-08-18 06:28:21 +0000 | [diff] [blame] | 11 | - now setting higher number of file handles (250). |
| 12 | - defaults to building with PyMalloc enabled (Python 2.3 default). |
| 13 | - the port is now maintained in the Python CVS repository. |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 14 | - most standard modules are now built into the core Python DLL. |
Andrew MacIntyre | ffcf899 | 2002-08-18 06:28:21 +0000 | [diff] [blame] | 15 | |
| 16 | Python 2.3 incorporates several changes which have resolved the |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 17 | longstanding problems the EMX port has had with test_longexp. |
| 18 | |
| 19 | Python 2.3 introduces changes to the Berkeley DB support, as a result of |
| 20 | the PyBSDDB3 module (for the Sleepycat DB 3.3.x/4.0.x/4.1.x library) |
| 21 | being imported into Python's standard library - see "YOU HAVE BEEN WARNED" |
| 22 | items 4 & 5 for more information. |
| 23 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 24 | |
| 25 | Licenses and info about Python and EMX |
| 26 | -------------------------------------- |
| 27 | |
| 28 | Please read the file README.Python-2.3 included in this package for |
| 29 | information about Python 2.3. This file is the README file from the |
| 30 | Python 2.3 source distribution available via http://www.python.org/ |
| 31 | and its mirrors. The file LICENCE.Python-2.3 is the text of the Licence |
| 32 | from the Python 2.3 source distribution. |
| 33 | |
| 34 | Note that the EMX package that this package depends on is released under |
| 35 | the GNU General Public Licence. Please refer to the documentation |
| 36 | accompanying the EMX Runtime libraries for more information about the |
| 37 | implications of this. A copy of version 2 of the GPL is included as the |
| 38 | file COPYING.gpl2. |
| 39 | |
| 40 | Readline and GDBM are covered by the GNU General Public Licence. I think |
| 41 | Eberhard Mattes' porting changes to BSD DB v1.85 are also GPL'ed (BSD DB |
| 42 | itself is BSD Licenced). ncurses and expat appear to be covered by MIT |
| 43 | style licences - please refer to the source distributions for more detail. |
| 44 | zlib is distributable under a very free license. GNU MP and GNU UFC are |
| 45 | under the GNU LGPL (see file COPYING.lib). |
| 46 | |
| 47 | My patches to the Python-2.x source distributions, and any other packages |
| 48 | used in this port, are placed in the public domain. |
| 49 | |
| 50 | This software is provided 'as-is', without any express or implied warranty. |
| 51 | In no event will the author be held liable for any damages arising from the |
| 52 | use of the software. |
| 53 | |
| 54 | I do hope however that it proves useful to someone. |
| 55 | |
| 56 | |
| 57 | Other ports |
| 58 | ----------- |
| 59 | |
| 60 | There have been ports of previous versions of Python to OS/2. |
| 61 | |
| 62 | The best known would be that by Jeff Rush, most recently of version |
| 63 | 1.5.2. Jeff used IBM's Visual Age C++ (v3) for his ports, and his |
| 64 | patches have been included in the Python 2.3 source distribution. |
| 65 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 66 | Andy Zabolotny implemented a port of Python v1.5.2 using the EMX |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 67 | development tools. His patches against the Python v1.5.2 source |
| 68 | distribution have become the core of this port, and without his efforts |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 69 | this port wouldn't exist. Andy's port also appears to have been |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 70 | compiled with his port of gcc 2.95.2 to EMX, which I have but have |
| 71 | chosen not to use for the binary distribution of this port (see item 21 |
| 72 | of the "YOU HAVE BEEN WARNED" section below). |
| 73 | |
| 74 | Previous Python port releases by me:- |
| 75 | - v2.0 on March 31, 2001; |
| 76 | - v2.0 on April 25, 2001 (cleanup release + Stackless variant); |
| 77 | - v2.1 on June 17, 2001; |
| 78 | - v2.0 (Stackless re-release) on June 18, 2001. |
| 79 | - v2.1.1 on August 5, 2001; |
| 80 | - v2.1.1 on August 12, 2001 (cleanup release); |
Andrew MacIntyre | ffcf899 | 2002-08-18 06:28:21 +0000 | [diff] [blame] | 81 | - v2.1.1 (updated DLL) on August 14, 2001; |
| 82 | - v2.2b2 on December 8, 2001 (not uploaded to archive sites); |
| 83 | - v2.2c1 on December 16, 2001 (not uploaded to archive sites); |
| 84 | - v2.2 on December 24, 2001; |
| 85 | - v2.2.1c2 on March 31, 2002 (not uploaded to archive sites); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 86 | - v2.2.1 on April 14, 2002; |
Andrew MacIntyre | 7e5bf67 | 2002-12-04 12:40:49 +0000 | [diff] [blame] | 87 | - v2.2.2 on October 24, 2002. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 88 | |
| 89 | It is possible to have these earlier ports still usable after installing |
| 90 | this port - see the README.os2emx.multiple_versions file, contributed by |
| 91 | Dr David Mertz, for a suggested approach to achieving this. |
| 92 | |
| 93 | |
| 94 | Software requirements |
| 95 | --------------------- |
| 96 | |
| 97 | This package requires the EMX Runtime package, available from the |
| 98 | Hobbes (http://hobbes.nmsu.edu/) and LEO (http://archiv.leo.org/) |
| 99 | archives of OS/2 software. I have used EMX version 0.9d fix04 in |
| 100 | developing this port. |
| 101 | |
| 102 | My development system is running OS/2 v4 with fixpack 12. |
| 103 | |
| 104 | 3rd party software which has been linked into dynamically loaded modules: |
| 105 | - ncurses (see http://dickey.his.com/ for more info, v5.2) |
| 106 | - GNU Readline (Kai Uwe Rommel's port available from Hobbes or LEO, v2.1) |
| 107 | - GNU GDBM (Kai Uwe Rommel's port available from Hobbes or LEO, v1.7.3) |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 108 | - zlib (derived from Hung-Chi Chu's port of v1.1.3, v1.1.4) |
| 109 | - expat (distributed with Python, v1.95.6) |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 110 | - GNU MP (Peter Meerwald's port available from LEO, v2.0.2) |
| 111 | - GNU UFC (Kai Uwe Rommel's port available from LEO, v2.0.4) |
| 112 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 113 | |
| 114 | About this port |
| 115 | --------------- |
| 116 | |
| 117 | I have attempted to make this port as complete and functional as I can, |
| 118 | notwithstanding the issues in the "YOU HAVE BEEN WARNED" section below. |
| 119 | |
| 120 | Core components: |
| 121 | |
| 122 | Python.exe is linked as an a.out executable, ie using EMX method E1 |
| 123 | to compile & link the executable. This is so that fork() works (see |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 124 | "YOU HAVE BEEN WARNED" item 1). |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 125 | |
| 126 | Python23.dll is created as a normal OMF DLL, with an OMF import |
| 127 | library and module definition file. There is also an a.out (.a) import |
Andrew MacIntyre | ffcf899 | 2002-08-18 06:28:21 +0000 | [diff] [blame] | 128 | library to support linking the DLL to a.out executables. The DLL |
| 129 | requires the EMX runtime DLLs. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 130 | |
| 131 | This port has been built with complete support for multithreading. |
| 132 | |
| 133 | Modules: |
| 134 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 135 | With the exception of modules that have a significant code size, or are |
| 136 | not recommended or desired for normal use, the standard modules are now |
| 137 | built into the core DLL rather than configured as dynamically loadable |
| 138 | modules. This is for both reasons of performance (startup time) and |
| 139 | memory use (lots of small DLLs fragment the address space). |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 140 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 141 | I haven't yet changed the building of Python's dynamically loadable |
| 142 | modules over to using the DistUtils. |
| 143 | |
| 144 | See "YOU HAVE BEEN WARNED" item 3 for notes about the fcntl module, and |
| 145 | "YOU HAVE BEEN WARNED" item 10 for notes about the pwd and grp modules. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 146 | |
| 147 | Support for case sensitive module import semantics has been added to match |
| 148 | the Windows release. This can be deactivated by setting the PYTHONCASEOK |
| 149 | environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED" |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 150 | item 12. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 151 | |
| 152 | Optional modules: |
| 153 | |
| 154 | Where I've been able to locate the required 3rd party packages already |
| 155 | ported to OS/2, I've built and included them. |
| 156 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 157 | These include ncurses (_curses, _curses_panel), BSD DB (bsddb185), |
| 158 | GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), GNU MP (mpz) |
| 159 | and GNU UFC (crypt). |
| 160 | |
| 161 | Expat is now included in the Python release sourceball, and is always |
| 162 | built. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 163 | |
| 164 | I have built these modules statically linked against the 3rd party |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 165 | libraries. Unfortunately my attempts to use the dll version of GNU |
| 166 | readline have been a dismal failure, in that when the dynamically |
| 167 | linked readline module is active other modules immediately provoke a |
| 168 | core dump when imported. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 169 | |
| 170 | Only the BSD DB package (part of the BSD package distributed with EMX) |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 171 | needs source modifications to be used for this port, pertaining to use |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 172 | of errno with multithreading. |
| 173 | |
| 174 | The other packages, except for ncurses and zlib, needed Makefile changes |
| 175 | for multithreading support but no source changes. |
| 176 | |
| 177 | The _curses_panel module is a potential problem - see "YOU HAVE BEEN |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 178 | WARNED" item 13. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 179 | |
| 180 | Upstream source patches: |
| 181 | |
| 182 | No updates to the Python 2.3 release have become available. |
| 183 | |
| 184 | Eberhard Mattes' EMXFIX04 update to his EMX 0.9d tools suite includes |
| 185 | bug fixes for the BSD DB library. The bsddb module included in this |
| 186 | port incorporates these fixes. |
| 187 | |
| 188 | Library and other distributed Python code: |
| 189 | |
| 190 | The Python standard library lives in the Lib directory. All the standard |
| 191 | library code included with the Python 2.3 source distribution is included |
| 192 | in the binary archive, with the exception of the dos-8x3 and tkinter |
| 193 | subdirectories which have been omitted to reduce the size of the binary |
| 194 | archive - the dos-8x3 components are unnecessary duplicates and Tkinter |
| 195 | is not supported by this port (yet). All the plat-* subdirectories in the |
| 196 | source distribution have also been omitted, and a plat-os2emx directory |
| 197 | included. |
| 198 | |
| 199 | The Tools and Demo directories contain a collection of Python scripts. |
| 200 | To reduce the size of the binary archive, the Demo/sgi, Demo/Tix, |
| 201 | Demo/tkinter, Tools/audiopy and Tools/IDLE subdirectories have been |
| 202 | omitted as not being supported by this port. The Misc directory has |
| 203 | also been omitted. |
| 204 | |
| 205 | All subdirectories omitted from the binary archive can be reconstituted |
| 206 | from the Python 2.3 source distribution, if desired. |
| 207 | |
| 208 | Support for building Python extensions: |
| 209 | |
| 210 | The Config subdirectory contains the files describing the configuration |
| 211 | of the interpreter and the Makefile, import libraries for the Python DLL, |
| 212 | and the module definition file used to create the Python DLL. The |
| 213 | Include subdirectory contains all the standard Python header files |
| 214 | needed for building extensions. |
| 215 | |
| 216 | As I don't have the Visual Age C++ compiler, I've made no attempt to |
| 217 | have this port support extensions built with that compiler. |
| 218 | |
| 219 | |
| 220 | Packaging |
| 221 | --------- |
| 222 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 223 | This port is packaged as follows: |
| 224 | - python-2.3-os2emx-bin-03????.zip (binaries, library modules) |
| 225 | - python-2.3-os2emx-src-03???? (patches+makefiles for non-Python code) |
| 226 | |
| 227 | As all the Python specific patches for the port are now part of the |
| 228 | Python release tarball, only the patches and makefiles involved in |
| 229 | building external libraries for optional extensions are included in |
| 230 | the source archive. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 231 | |
| 232 | Documentation for the Python language, as well as the Python 2.3 |
| 233 | source distibution, can be obtained from the Python website |
| 234 | (http://www.python.org/) or the Python project pages at Sourceforge |
| 235 | (http://sf.net/projects/python/). |
| 236 | |
| 237 | |
| 238 | Installation |
| 239 | ------------ |
| 240 | |
| 241 | Obtain and install, as per the included instructions, the EMX runtime |
| 242 | package. |
| 243 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 244 | Unpack this archive, preserving the subdirectories, in the root directory |
| 245 | of the drive where you want Python to live. |
| 246 | |
| 247 | Add the Python directory (eg C:\Python23) to the PATH and LIBPATH |
| 248 | variables in CONFIG.SYS. |
| 249 | |
| 250 | You should then set the PYTHONHOME and PYTHONPATH environment variables |
| 251 | in CONFIG.SYS. |
| 252 | |
| 253 | PYTHONHOME should be set to Python's top level directory. PYTHONPATH |
| 254 | should be set to the semicolon separated list of principal Python library |
| 255 | directories. |
| 256 | I use: |
| 257 | SET PYTHONHOME=F:/Python23 |
| 258 | SET PYTHONPATH=F:/Python23/Lib;F:/Python23/Lib/plat-os2emx; |
| 259 | F:/Python23/Lib/lib-dynload;F:/Python23/Lib/site-packages |
| 260 | |
| 261 | NOTE!: the PYTHONPATH setting above is linewrapped for this document - it |
| 262 | should all be on one line in CONFIG.SYS! |
| 263 | |
| 264 | If you wish to use the curses module, you should set the TERM and TERMINFO |
| 265 | environment variables appropriately. |
| 266 | |
| 267 | If you don't already have ncurses installed, I have included a copy of the |
| 268 | EMX subset of the Terminfo database included with the ncurses-5.2 source |
| 269 | distribution. This can be used by setting the TERMINFO environment variable |
| 270 | to the path of the Terminfo subdirectory below the Python home directory. |
| 271 | On my system this looks like: |
| 272 | SET TERMINFO=F:/Python23/Terminfo |
| 273 | |
| 274 | For the TERM environment variable, I would try one of the following: |
| 275 | SET TERM=ansi |
| 276 | SET TERM=os2 |
| 277 | SET TERM=window |
| 278 | |
| 279 | You will have to reboot your system for these changes to CONFIG.SYS to take |
| 280 | effect. |
| 281 | |
| 282 | If you wish to compile all the included Python library modules to bytecode, |
| 283 | you can change into the Python home directory and run the COMPILEALL.CMD |
| 284 | batch file. |
| 285 | |
| 286 | You can execute the regression tests included with the Python 2.3 source |
| 287 | distribution by changing to the Python 2.3 home directory and executing the |
| 288 | REGRTEST.CMD batch file. The following tests are known to fail at this |
| 289 | time: |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 290 | - test_mhlib (I don't know of any port of MH to OS/2); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 291 | - test_pwd (see "YOU HAVE BEEN WARNED" item 10, probably a bug in my code); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 292 | - test_grp (as per test_pwd); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 293 | - test_strftime (see "YOU HAVE BEEN WARNED" item 15); |
| 294 | - test_strptime (see "YOU HAVE BEEN WARNED" item 22); |
| 295 | - test_whichdb (see "YOU HAVE BEEN WARNED" item 5). |
| 296 | - test_socketserver (fork() related, see "YOU HAVE BEEN WARNED" item 1). |
| 297 | |
| 298 | Note that some of the network related tests expect the loopback interface |
| 299 | (interface "lo", with IP address 127.0.0.1) to be enabled, which from my |
| 300 | experience is not the default configuration. Additionally, test_popen2 |
| 301 | expects the "cat" utility (such as found in ports of the GNU tools) to |
| 302 | be installed. |
| 303 | |
| 304 | |
| 305 | Building from source |
| 306 | -------------------- |
| 307 | |
| 308 | With the EMX port now checked into Python's CVS repository, the build |
| 309 | infrastructure is part of the Python release sourceball. |
| 310 | |
| 311 | Prerequisites |
| 312 | |
| 313 | First and foremost, you need an operational EMX development installation - |
| 314 | EMX v0.9d with fix04 (the latest at time of writing) & the gcc 2.8.1 |
| 315 | compiler released by Eberhard Mattes is the recommended setup. |
| 316 | |
| 317 | If you have a different version of gcc installed, see "YOU HAVE BEEN |
| 318 | WARNED" item 16. |
| 319 | |
| 320 | Other items of software required:- |
| 321 | |
| 322 | - GNU make (I'm using v3.76.1) |
| 323 | - rm, cp, mkdir from the GNU file utilities package |
| 324 | - GNU find |
| 325 | |
| 326 | Procedure |
| 327 | |
| 328 | 0. all changes mentioned apply to files in the PC/os2emx subdirectory |
| 329 | of the Python release source tree. make is also executed from this |
| 330 | directory, so change into this directory before proceeding. |
| 331 | |
| 332 | 1. decide if you need to change the location of the Python installation. |
| 333 | If you wish to do this, set the value of the Makefile variable LIB_DIR |
| 334 | to the directory you wish to use for PYTHONHOME |
| 335 | (eg /usr/local/lib/python2.3). |
| 336 | |
| 337 | If you want Python to find its library without the PYTHONHOME |
| 338 | environment variable set, set the value of the Makefile variable |
| 339 | FIXED_PYHOME to "yes" (uncomment the appropriate line). |
| 340 | |
| 341 | 2. If you wish the Python executables (python.exe, pythonpm.exe & pgen.exe) |
| 342 | to be installed in a directory other than the PYTHONHOME directory, set |
| 343 | the value of the Makefile variable EXE_DIR to the appropriate directory. |
| 344 | |
| 345 | 3. If you wish the Python core DLL (python23.dll) to be installed in a |
| 346 | directory other than the directory in which the Python executables are |
| 347 | installed (by default, the PYTHONHOME directory), set the value of the |
| 348 | Makefile variable DLL_DIR to the appropriate directory. This DLL must |
| 349 | be placed in a directory on the system's LIBPATH, or that gets set |
| 350 | with BEGINLIBPATH or ENDLIBPATH. |
| 351 | |
| 352 | 4. If you have installed any of the libraries that can be used to build |
| 353 | optional Python modules, set the value of the relevant HAVE_<package> |
| 354 | Makefile variable to "yes". The Makefile currently supports: |
| 355 | |
| 356 | library Makefile variable |
| 357 | ........................................ |
| 358 | zlib (1.1.4) HAVE_ZLIB |
| 359 | GNU UltraFast Crypt HAVE_UFC |
| 360 | Tcl/Tk HAVE_TCLTK (not known to work) |
| 361 | GNU MP HAVE_GMPZ |
| 362 | GNU Readline HAVE_GREADLINE |
| 363 | BSD DB (v1.85) HAVE_BSDDB |
| 364 | ncurses HAVE_NCURSES |
| 365 | GNU gdbm HAVE_GDBM |
| 366 | libbz2 HAVE_BZ2 |
| 367 | |
| 368 | Please note that you need to check that what you have installed |
| 369 | is compatible with Python's build options. In particular, the |
| 370 | BSD DB v1.85 library needs to be rebuilt with a source patch for |
| 371 | multithread support (doesn't change the library's reentrant status |
| 372 | but allows it to be linked to Python which is multithreaded). |
| 373 | Widely available binary packages of other librarys & DLLs are |
| 374 | not built/linked with multithread support. Beware! |
| 375 | |
| 376 | Also note that the Makefile currently expects any libraries to be |
| 377 | found with the default library search path. You may need to add |
| 378 | -L switches to the LDFLAGS Makefile variable if you have installed |
| 379 | libraries in directories not in the default search path (which can |
| 380 | be controlled by the LIBRARY_PATH environment variable used by EMX). |
| 381 | |
| 382 | 5. make |
| 383 | |
| 384 | It is usually a good idea to redirect the stdout and stderr streams |
| 385 | of the make process to log files, so that you can review any messages. |
| 386 | |
| 387 | 6. make test |
| 388 | |
| 389 | This runs the Python regression tests, and completion is a sign of |
| 390 | a usable build. You should check the list of skipped modules to |
| 391 | ensure that any optional modules you selected have been built; |
| 392 | checking the list of failures against the list of known failures |
| 393 | elsewhere in this document is also prudent. |
| 394 | |
| 395 | 7. make install |
| 396 | >>>>>> NOT YET COMPLETE <<<<<< |
| 397 | |
| 398 | 8. change to a directory outside the Python source tree and start Python. |
| 399 | Check the version and build date to confirm satisfactory installation. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 400 | |
| 401 | |
| 402 | YOU HAVE BEEN WARNED!! |
| 403 | ---------------------- |
| 404 | |
| 405 | I know about a number of nasties in this port. |
| 406 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 407 | 1. Eberhard Mattes, author of EMX, writes in his documentation that fork() |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 408 | is very inefficient in the OS/2 environment. It also requires that the |
| 409 | executable be linked in a.out format rather than OMF. Use the os.exec |
| 410 | and/or the os.spawn family of functions where possible. |
| 411 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 412 | 2. In the absence of GNU Readline, terminating the interpreter requires a |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 413 | control-Z (^Z) followed by a carriage return. Jeff Rush documented this |
| 414 | problem in his Python 1.5.2 port. With Readline, a control-D (^D) works |
| 415 | as per the standard Unix environment. |
| 416 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 417 | 3. EMX only has a partial implementation of fcntl(). The fcntl module |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 418 | in this port supports what EMX supports. If fcntl is important to you, |
| 419 | please review the EMX C Library Reference (included in .INF format in the |
| 420 | EMXVIEW.ZIP archive as part of the complete EMX development tools suite). |
| 421 | Because of other side-effects I have modified the test_fcntl.py test |
| 422 | script to deactivate the exercising of the missing functionality. |
| 423 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 424 | 4. the PyBSDDB3 module has been imported into the Python standard |
| 425 | library, with the intent of superceding the BSDDB 1.85 module (bsddb). |
| 426 | As I don't yet have a satisfactory port of Sleepcat's more recent DB |
| 427 | library (3.3.x/4.0.x/4.1.x), I haven't included a binary of this |
| 428 | module. I have left the Python part of the PyBSDDB package in this |
| 429 | distribution for completeness. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 430 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 431 | 5. As a consequence of the PyBSDDB3 module being imported, the former |
| 432 | BSD DB (bsddb) module, linked against the DB v1.85 library from EMX, |
| 433 | has been renamed bsddb185. The bsddb185 module will not be built by |
| 434 | default on most platforms, but in the absence of a PyBSDDB3 module I |
| 435 | have retained it in the EMX port. |
| 436 | |
| 437 | Version 1.85 of the DB library is widely known to have bugs, although |
| 438 | some patches have become available (and are incorporated into the |
| 439 | included bsddb185 module). Unless you have problems with software |
| 440 | licenses which would rule out GDBM (and the dbm module because it is |
| 441 | linked against the GDBM library) or need it for file format compatibility, |
| 442 | you may be better off deleting it and relying on GDBM. |
| 443 | |
| 444 | Any code you have which uses the bsddb module can be modified to use the |
| 445 | renamed module by changing |
| 446 | |
| 447 | import bsddb |
| 448 | |
| 449 | to |
| 450 | |
| 451 | import bsddb185 as bsddb |
| 452 | |
| 453 | A side effect of these changes is that the test_whichdb regression test |
| 454 | fails. |
| 455 | |
| 456 | 6. The readline module has been linked against ncurses rather than the |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 457 | termcap library supplied with EMX. |
| 458 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 459 | 7. I have configured this port to use "/" as the preferred path separator |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 460 | character, rather than "\" ('\\'), in line with the convention supported |
| 461 | by EMX. Backslashes are still supported of course, and still appear in |
| 462 | unexpected places due to outside sources that don't get normalised. |
| 463 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 464 | 8. While the DistUtils components are now functional, other |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 465 | packaging/binary handling tools and utilities such as those included in |
| 466 | the Demo and Tools directories - freeze in particular - are unlikely to |
| 467 | work. If you do get them going, I'd like to know about your success. |
| 468 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 469 | 9. I haven't set out to support the [BEGIN|END]LIBPATH functionality |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 470 | supported by one of the earlier ports (Rush's??). If it works let me know. |
| 471 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 472 | 10. As a result of the limitations imposed by EMX's library routines, the |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 473 | standard extension module pwd only synthesises a simple passwd database, |
| 474 | and the grp module cannot be supported at all. |
| 475 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 476 | I have written pure Python substitutes for pwd and grp, which can process |
| 477 | real passwd and group files for those applications (such as MailMan) that |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 478 | require more than EMX emulates. I have placed pwd.py and grp.py in |
| 479 | Lib/plat-os2emx, which is usually before Lib/lib-dynload (which contains |
| 480 | pwd.pyd) in the PYTHONPATH. If you have become attached to what pwd.pyd |
| 481 | supports, you can put Lib/lib-dynload before Lib/plat-os2emx in PYTHONPATH |
| 482 | or delete/rename pwd.py & grp.py. |
| 483 | |
| 484 | pwd.py & grp.py support locating their data files by looking in the |
| 485 | environment for them in the following sequence: |
| 486 | pwd.py: $ETC_PASSWD (%ETC_PASSWD%) |
| 487 | $ETC/passwd (%ETC%/passwd) |
| 488 | $PYTHONHOME/Etc/passwd (%PYTHONHOME%/Etc/passwd) |
| 489 | grp.py: $ETC_GROUP (%ETC_GROUP%) |
| 490 | $ETC/group (%ETC%/group) |
| 491 | $PYTHONHOME/Etc/group (%PYTHONHOME%/Etc/group) |
| 492 | |
| 493 | Both modules support using either the ":" character (Unix standard) or |
| 494 | ";" (OS/2, DOS, Windows standard) field separator character, and pwd.py |
| 495 | implements the following drive letter conversions for the home_directory and |
| 496 | shell fields (for the ":" separator only): |
| 497 | $x -> x: |
| 498 | x; -> x: |
| 499 | |
| 500 | Example versions of passwd and group are in the Etc subdirectory. Note |
| 501 | that as of this release, this code fails the regression test. I'm looking |
| 502 | into why, and hope to have this fixed. |
| 503 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 504 | Be aware that Python's pwd & group modules are for reading password and |
| 505 | group information only. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 506 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 507 | 11. EMX's termios routines don't support all of the functionality now |
| 508 | exposed by the termios module - refer to the EMX documentation to find |
| 509 | out what is supported. |
| 510 | |
| 511 | 12. The case sensitive import semantics introduced in Python 2.1 for other |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 512 | case insensitive but case preserving file/operating systems (Windows etc), |
| 513 | have been incorporated into this port, and are active by default. Setting |
| 514 | the PYTHONCASEOK environment variable (to any value) reverts to the |
| 515 | previous (case insensitive) semantics. |
| 516 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 517 | 13. Because I am statically linking ncurses, the _curses_panel |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 518 | module has potential problems arising from separate library data areas. |
| 519 | To avoid this, I have configured the _curses_.pyd (imported as |
| 520 | "_curses_panel") to import the ncurses symbols it needs from _curses.pyd. |
| 521 | As a result the _curses module must be imported before the _curses_panel |
| 522 | module. As far as I can tell, the modules in the curses package do this. |
| 523 | If you have problems attempting to use the _curses_panel support please |
| 524 | let me know, and I'll look into an alternative solution. |
| 525 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 526 | 14. sys.platform reports "os2emx" instead of "os2". os.name still |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 527 | reports "os2". This change was to make it easier to distinguish between |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 528 | the VAC++ build (formerly maintained by Michael Muller) and the EMX build |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 529 | (this port), principally for DistUtils. |
| 530 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 531 | 15. it appears that the %W substitution in the EMX strftime() routine has |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 532 | an off-by-one bug. strftime was listed as passing the regression tests |
| 533 | in previous releases, but this fact appears to have been an oversight in |
| 534 | the regression test suite. To fix this really requires a portable |
| 535 | strftime routine - I'm looking into using one from FreeBSD, but its not |
| 536 | ready yet. |
| 537 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 538 | 16. I have successfully built this port with Andy Zabolotny's ports of |
| 539 | pgcc 2.95 and gcc 3.2.1, in addition to EM's gcc 2.8.1. To use the |
| 540 | bsddb185 module with the gcc 3.2.1 build, I had to recompile the DB library |
| 541 | with gcc 3.2.1 - I don't know why, but trying to import the module built |
| 542 | against a DB library compiled with gcc 2.8.1 would result in a SYS3175 |
| 543 | error. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 544 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 545 | I have not attempted to compile Python with any version of gcc prior to |
| 546 | v2.8.1. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 547 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 548 | If you compile Python with pgcc 2.95, changing the optimisation from -O2 to |
| 549 | -O3 is worthwhile. While more aggressive optimisation is supported by gcc, |
| 550 | a lot of benchmarking indicates that Python's performance is impeded by |
| 551 | optimisation settings beyond just -O2 (-O3 for pgcc 2.95), at least on my |
| 552 | hardware (AMD Athlon 1.4GHz, VIA C3 800MHz). |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 553 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 554 | If you wish to compile Python with gcc 3.2.1, you will need to modify the |
| 555 | Makefile to compile Modules/_sre.c with either the -Os (recommended) or |
| 556 | -O options, with the global optimisation set to -O2 or -O3 (not much |
| 557 | difference between these with this compiler). Alternatively, you could |
| 558 | change the global optimisation instead with a performance drop of 6-7% |
| 559 | compared to the special-case approach. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 560 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 561 | 17. os.spawnv() and os.spawnve() expose EMX's library routines rather |
| 562 | than use the emulation in os.py. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 563 | |
| 564 | In order to make use of some of the features this makes available in |
| 565 | the OS/2 environment, you should peruse the relevant EMX documentation |
| 566 | (EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives |
| 567 | on Hobbes or LEO). Be aware that I have exposed all the "mode" options |
| 568 | supported by EMX, but there are combinations that either cannot be |
| 569 | practically used by/in Python or have the potential to compromise your |
| 570 | system's stability. |
| 571 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 572 | 18. pythonpm.exe used to be just python.exe with the WINDOWAPI linker |
| 573 | option set in the pythonpm.def file. In practice, this turns out to do |
| 574 | nothing useful. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 575 | |
| 576 | I have written a replacement which wraps the Python DLL in a genuine |
| 577 | Presentation Manager application. This version actually runs the |
| 578 | Python interpreter in a separate thread from the PM shell, in order |
| 579 | that PythonPM has a functioning message queue as good PM apps should. |
| 580 | In its current state, PythonPM's window is hidden. It can be displayed, |
| 581 | although it will have no content as nothing is ever written to the |
| 582 | window. Only the "hide" button is available. Although the code |
| 583 | has support for shutting PythonPM down when the Python interpreter is |
| 584 | still busy (via the "control" menu), this is not well tested and given |
| 585 | comments I've come across in EMX documentation suggesting that the |
| 586 | thread killing operation has problems I would suggest caution in |
| 587 | relying on this capability. |
| 588 | |
| 589 | PythonPM processes commandline parameters normally. The standard input, |
| 590 | output and error streams are only useful if redirected, as PythonPM's |
| 591 | window is not a console in any form and so cannot accept or display |
| 592 | anything. This means that the -i option is ineffective. |
| 593 | |
| 594 | Because the Python thread doesn't create its own message queue, creating |
| 595 | PM Windows and performing most PM operations is not possible from within |
| 596 | this thread. How this will affect supporting PM extensions (such as |
| 597 | Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of |
| 598 | WxWindows) is still being researched. |
| 599 | |
| 600 | Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result |
| 601 | of trying. os.spawnv() _does_ work. PythonPM passes all regression tests |
| 602 | that the standard Python interpreter (python.exe) passes, with the exception |
| 603 | of test_fork1 and test_socket which both attempt to use os.fork(). |
| 604 | |
| 605 | I very much want feedback on the performance, behaviour and utility of |
| 606 | PythonPM. I would like to add a PM console capability to it, but that |
| 607 | will be a non-trivial effort. I may be able to leverage the code in |
| 608 | Illya Vaes' Tcl/Tk port, which would make it easier. |
| 609 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 610 | 19. os.chdir() uses EMX's _chdir2(), which supports changing both drive |
| 611 | and directory at once. Similarly, os.getcwd() uses EMX's _getcwd() |
| 612 | which returns drive as well as path. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 613 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 614 | 20. pyconfig.h is installed in the Include subdirectory with all |
| 615 | other include files. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 616 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 617 | 21. the default build explicitly sets the number of file handles |
| 618 | available to a Python process to 250. EMX default is 40, which is |
| 619 | insufficient for the tempfile regression test (test_tempfile) which |
| 620 | tries to create 100 temporary files. |
Andrew MacIntyre | ffcf899 | 2002-08-18 06:28:21 +0000 | [diff] [blame] | 621 | |
| 622 | This setting can be overridden via the EMXOPT environment variable: |
| 623 | set EMXOPT=-h250 |
| 624 | is equivalent to the setting currently used. The emxbind utility (if you |
| 625 | have it installed) can also be used to permanently change the setting in |
| 626 | python.exe - please refer to the EMX documentation for more information. |
| 627 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 628 | 22. a pure python strptime module is now part of the Python standard |
| 629 | library, superceding a platform specific extension module. This module |
| 630 | leverages the strftime module, and as a result test_strptime fails |
| 631 | due to the EMX strftime bug in item 20 above. |
| 632 | |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 633 | ... probably other issues that I've not encountered, or don't remember :-( |
| 634 | |
| 635 | If you encounter other difficulties with this port, which can be |
| 636 | characterised as peculiar to this port rather than to the Python release, |
| 637 | I would like to hear about them. However I cannot promise to be able to do |
| 638 | anything to resolve such problems. See the Contact section below... |
| 639 | |
| 640 | |
| 641 | To do... |
| 642 | -------- |
| 643 | |
| 644 | In no particular order of apparent importance or likelihood... |
| 645 | |
| 646 | - support Tkinter and/or alternative GUI (wxWindows??) |
| 647 | |
| 648 | |
| 649 | Credits |
| 650 | ------- |
| 651 | |
| 652 | In addition to people identified above, I'd like to thank: |
| 653 | - the BDFL, Guido van Rossum, and crew for Python; |
| 654 | - Dr David Mertz, for trying out a pre-release of this port; |
| 655 | - the Python-list/comp.lang.python community; |
| 656 | - John Poltorak, for input about pwd/grp. |
| 657 | |
| 658 | Contact |
| 659 | ------- |
| 660 | |
| 661 | Constructive feedback, negative or positive, about this port is welcome |
| 662 | and should be addressed to me at the e-mail addresses below. |
| 663 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 664 | I have a private mailing list for announcements of fixes & updates to |
| 665 | this port. If you wish to receive such e-mail announcments, please send |
| 666 | me an e-mail requesting that you be added to this list. |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 667 | |
| 668 | Andrew MacIntyre |
| 669 | E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au |
| 670 | Web: http://www.andymac.org/ |
| 671 | |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 672 | 18 April, 2003. |