MAKE SURE that your tcl library and tk library are available to the runtime. Either put them where it is discussed below, or set up TCL_LIBRARY and TK_LIBRARY variable according to tk rules. STATE: ~~~~~ Simplest demos run! I was too lazy to change fork/exec to spawn, so running processes does not work in dynamically linked version of tcl (as the precompiled one is). Current runtime consists of 3 huge (since debugging) .DLLs and 2 tiny .EXEs. The snapshot is contained in 3 zips: tk41.rt.zip, tk41.dev.zip, and tk41.libs.zip. The first one contains runtime, the second the patches, makefiles and additional modules, the third one import libraries for the .dlls and .res. The zips are available from ftp://math.ohio-state.edu/pub/users/ilya/os2 BUGS: ~~~~ See above remark about exec/popen. This port utilizes Open32 (=DAPIE) library by IBM, so is prone to all the bugs in this product. It contains workarounds for 5 or 6 bugs I have workarounds for, all the rest is there: a) Fonts: There is some bug in font rendering, thus if an insertion point (or any other mark) is inside a row, two halves of the row overlap slightly (apparently font is rendered wider than reported). b) Timers: I could not convince Open32 to start a timer. In particular, insertion cursor blinks only if some other events happens. c) Window size tracking: Apparently Open32 does not update (/updates wrongly?) the winsize info if the window size is changed _from application_. We work around the most serious problems by updating size of windows before they are created, but explicit changes will trigger this bug. d) Bitmaps higher than the screen are not allocated. e) ReleaseDC segfaults if winhandle is NULL - we patch around from windows.h. f) The event loop does not checks file events. g) The symbols missing from DAPIE are substituted by stubs in windows.h. PREREQUISITES: ~~~~~~~~~~~~~ RUNTIME: EMX runtime and DAPIE runtime needed. It is advised to have SIQ FIX installed, otherwise you may get in a hard position if the event queue stalls. Note that you may get into such a position even with SIQ FIX. However, I usually run a SD386 debugger from a full-screen window, and it was only once when I could not switch to this window (even with WatchCat). Your mileage may vary. BUILD: EMX development tools and DAPIE headers and library needed. (In fact DAPIE tools are needed only if you rebuild tksys.dll, two others are EMX only.) Dynamic.zip from the above FTP site is needed as well. Emx 0.9b3 _required_ (before fix3 you will have problems with wchar_t.) INSTALL: ~~~~~~~ unzip all the zips you want from the same directory. Make sure that tcl library is at f:/lib/tcl7.5, tk library is in ../lib/tk4.1 with respect to .exe file. Make sure that . is in LIBPATH, switch to the ./tk4.1/os2, and start experiments! You need only the tk41.rt.zip to run the executable, but it is mostly useless without tlc/tk libraries, which should be obtained from standard places. You need to rename tk4.1/library to tk4.1/lib/tk4.1. wish console is not working, so you may run it like this: wish myscript >& outfile outfile will contain the wish output. Change the syntax of the above line to suit the shell you use. BUILD: ~~~~~ You will need tk41.dev.zip, having tk41.libs.zip will slightly simplify the build. Note that if you do not have SMART migration tool, and want to have resources for tksys.dll, you _need_ tk41.libs.zip, since it contains compiled .RES file - or maybe you may chop it from prebuild tksys.dll. You will need tcl/tk sources as well. Unzip tcl75* and tk41* tar's in the same directory as above. Install files from dynamic.zip. In fact better install Makefile.dynamic not into /emx/lib, but into f:/emx.add/lib, then you do not need to edit Makefiles. Change into ./tk4.1*/os2. Patch using the tcl.os2.notes, tk.os2.notes. (You do not need to run configure!) If the tcl library is not on f:/lib/tcl7.5, correct Makefile.tcl. Correct DYNMAKE line in all three Makefile.*, if needed. If your Warp toolkit is not in f:/TOOLKIT, you need to correct Makefile.tksys. Run make -f Makefile.tcl make -f Makefile.tkgen It may fail linking tkgen.dll, since there is no tksys_import.lib yet (unless you have it already). Rerun make -f Makefile.tkgen to build tkgen_import.lib, then delete broken tkgen.dll and wish.exe. Run make -f Makefile.tksys make -f Makefile.tkgen and the build should be finished. (You will get 2 warnings per use of windows.h from a bug in Open32 headers. Ignore them. One more warning about OS2LoadCursor,) If you have errors with rc, you probably do not have the resources file ready. Change to ./h/rc, run make change back, and rebuild tksys. Test using wish ../lib/tk4.1/demos/widget >& out (with csh syntax, e.g. 4os2.exe), or wish ../lib/tk4.1/demos/widget > out 2>&1 with sh syntax, e.g. cmd.exe. The file "out" will contain error reports (if any). IDEA OF THE PORT: ~~~~~~~~~~~~~~~~ We build tcl pretending that this is Unix, but at start time set the system description to WINDOWS. This fixes the filesystem manipulation, but breaks Network names (new in beta3). The tcl event loop is purely select()ish, but we install backdoor to substitute it from tk. We build generic part of tk pretending that this is Unix. We build the system-specific part of tk using Win32 API under OS/2, and install a windows event loop instead of unixish one at startup. The idea is that the same tcl.dll and tkgen.dll may be used by _any_ tksys.dll, which may be constructed "natively" - using PM API, using DAPIE, or using local X client API. I NEED YOUR HELP! ~~~~~~~~~~~~~~~~ I made the part of the port that I have an expertise in. I do not have the environment and/or skills for PM debugging. This port will hang in the air unless _you_ will support it by your time. Please keep in touch to not duplicate the effort needlessly. ANOTHER PORT ~~~~~~~~~~~~ Note that Illya Vaes is making a parallel port using PM API. I hope that tcl and tkgen parts of this port will be used by him as well, so your help with debugging these two may help him as well.