problems building tkinter module

Bill Janssen (janssen@parc.xerox.com)
Wed, 8 Jun 1994 20:43:13 PDT

I've been hacking around these, but I thought I'd better report them so
they get fixed. My environment is a Sun SPARCstation with SunOS 4.1.3.

1) Since I'm linking against shared libraries for Tcl and Tk,
tkintermodule.c must contain a symbol called "Tcl_AppInit", or the
linker objects. Apparently this doesn't matter if you link against
static libraries. I added the following:

*** 1.1 1994/06/09 03:28:10
--- tkintermodule.c 1994/06/09 03:31:40
***************
*** 149,154 ****
--- 149,166 ----
return v;
}

+ #ifdef WITH_APPINIT
+ int
+ Tcl_AppInit(interp)
+ Tcl_Interp *interp; /* Interpreter for application. */
+ {
+ if (Tcl_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+ }
+ #endif
+
/*** Tkapp Object ***/

/* Initialize the Tk application; see the `main' function in

2) I compile python with Sun's bundled "cc", a K&R compiler. When I
attempt to compile tkinter, I get the following warning:

cc -g -I/import/python/include/Py -I/import/python/lib -DHAVE_CONFIG_H -DPYTHONPATH=\".:/import/python/lib/python:/import/python/lib/python/test\" -c config.c
"/import/python/include/Py/intrcheck.h", line 31: syntax error at or near type word "void"
"/import/python/include/Py/intrcheck.h", line 32: syntax error at or near type word "void"
*** Error code 1
make: Fatal error: Command failed for target `config.o'

When I compile with an ANSI C compiler, things work fine. For some
reason, the appropriate def of PROTO is not being picked up.

3) The library lib.a is constructed with "ar cr lib.a...", and isn't
ranlib'ed. This causes warnings from the SunOS linker. It should
probably use $(AR) and $(RANLIB), or whatever the Python solution is.

Bill