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