DAS goes on to say:for TEA based extensions, the following configure invocation should do the trick:
./configure \
--prefix=/usr/local --libdir=/Library/Tcl \
--with-tcl=/Library/Frameworks/Tcl.framework \
--with-tclinclude=/Library/Frameworks/Tcl.framework/Headers \
--with-tk=/Library/Frameworks/Tk.framework \
--with-tkinclude=/Library/Frameworks/Tk.framework/Headers \
--enable-threadsYou should probably link with stub libraries like on other unix platforms: gcc -dynamiclib -o yourdylib.dylib yourcommands.o \
-L /Library/Frameworks/Tcl.framework/ -ltclstub8.4 \
-L /Library/Frameworks/Tk.framework -ltkstub8.4You can build tcl & tk with X11 yourself in the standard unix manner and install into e.g. /usr/local and not bother with the framework based TkAqua.You'll need X11 & X11SDK from Apple:http://www.apple.com/macosx/features/x11/download/
[Dscho] This did not work too well for me: linking as described above would result in many unresolved symbols. However, replacing "-L /Libaray/Frameworks/Tcl.framework/ -ltclstub8.4" with "-framework Tcl" (which is more OSXish, and shorter) helped! So, it is:
gcc -dynamiclib -o yourlib.dylib yourcommands.o \
-framework Tcl -framework TkMB A minimal example using gcc alone:
/*- Mac OS X build (-I may be skipped):
*
- gcc -Wall -g -DUSE_TCL_STUBS \
- -I/Library/Frameworks/Tcl.framework/Headers/ -c minimal.c
- gcc -dynamiclib -o minimal.dylib minimal.o \
- -L/Library/Frameworks/Tcl.framework/ -ltclstub8.4
*
- Unix:
*
- gcc -Wall -g -DUSE_TCL_STUBS -fpic -c minimal.c
- gcc -shared -o minimal.so minimal.o -ltclstub8.4
*
*/
#if TARGET_API_MAC_CARBON
# include <Tcl/tcl.h>
#else
# include "tcl.h"
#endif
static int MinimalObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
DLLEXPORT int Minimal_Init(Tcl_Interp *interp) {
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
return TCL_ERROR;
}
Tcl_CreateObjCommand(interp, "minimal", MinimalObjCmd, (ClientData) NULL, NULL);
return Tcl_PkgProvide(interp, "minimal", "0.1");
}
DLLEXPORT int Minimal_SafeInit(Tcl_Interp *interp) {
return Minimal_Init(interp);
}
static int MinimalObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("minimal seems ok", -1));
return TCL_OK;
}

