From: Michael T. <mt...@ee...> - 2002-09-07 14:31:03
|
Hi, Sorry to repost this, but I haven't gotten any responses my previous emails about building a standalone C/Tcl/Tk app for Classic MacOS. If anyone has any ideas or questions, please let me know. Thanks, Mike ---------- Reposteded message ---------- Hi, I have been trying to port an application that uses Tcl/Tk to MacOS 9. Basically, I am porting the graphical version of a virtual machine to which there is a corresponding command-line driven version. Since the command line version was written in C, when the developers wanted to make a user-friendly front end, they developed an interface in Tcl/Tk, and built a custom interpreter with their C functions compiled into it that would immediately evaluate the Tcl/Tk code to bring up the interface. On a standard Linux box, it is compiled as: /usr/bin/gcc -o myprog -g -O -fPIC -W -Wall -Wno-char-subscripts -static myprog_ide.o myprog_wish.o myprog_gui.o -ltk8.0 -ltcl8.0 -L/usr/X11/lib -lX11 -lm -ldl After compiling the source files myprog_ide.c, myprog_wish.c and myprog_gui.c (each compiled as): /usr/bin/gcc -g -O -fPIC -I/custom/header/directory -c aide8_XXX.c Where the tk.h and tcl.h files were present in /custom/header/directory The myprog_ide.c file contains the main function which sets up a Tcl_Interp and a Tk_Window, calls Tcl_Init and Tk_Init, sets up the main window and then eventually hands off control to Tk_MainLoop. The myprog_wish.c file contains the C functions that are being made available to the Tcl/Tk environment with the Tcl_CreateCommand function, and a makeBindings function that binds them into the Tcl environment (this is called from main in the previous file). The myprog_gui.c file contains functions that pull the contents of the Tcl/Tk text boxes, radio buttons, etc. into the C code. On the Unix side it is straight-forward to compile this (as shown above), and it works without a hitch. What I would like to do is make a Codewarrior project that includes these C files, plus the apporpriate MacOS9 libraries, but I am not sure which to add to the project. I don't know which libraries that come in the build directory are appropriate for this kind of project, and I am also not sure what I will need to satisfy the X11 requirements. Further, when I have tried building the Tcl or Tk shells using the Codewarrior Project files that have been shipped, I can't get them to compile either (I wrote to the list about it, but received no responses). If anyone has any ideas that they think might be helpful, please let me know. I am very curious if it is common practice on the Classic MacOS to build a custom interpreter, as it is such a straight-forward process under UNIX-based operating systems. Thanks, Michael Tucker |