Index: kitsh/buildsrc/kitsh-0.0/configure.ac ================================================================== --- kitsh/buildsrc/kitsh-0.0/configure.ac +++ kitsh/buildsrc/kitsh-0.0/configure.ac @@ -20,8 +20,14 @@ dnl Find the appropriate libraries to link to AC_SEARCH_LIBS(inflate, z zlib,, [ AC_MSG_WARN([Couldn't find inflate (normally in zlib)!]) ]) AC_SEARCH_LIBS(acos, m,, [ AC_MSG_WARN([Couldn't find acos (normally in libm)!]) ]) AC_SEARCH_LIBS(dlsym, dl,, [ AC_MSG_WARN([Couldn't find dlsym (normally in libdl)!]) ]) + +dnl Determine if we have "Tcl_SetStartupScript" (8.6.x) or "TclSetStartupScriptPath" (8.4.x) +SAVE_LIBS="${LIBS}" +LIBS="${ARCHS} ${LIBS}" +AC_CHECK_FUNCS(Tcl_SetStartupScript TclSetStartupScriptPath) +LIBS="${SAVE_LIBS}" dnl Produce output AC_OUTPUT(Makefile) Index: kitsh/buildsrc/kitsh-0.0/kitInit.c ================================================================== --- kitsh/buildsrc/kitsh-0.0/kitInit.c +++ kitsh/buildsrc/kitsh-0.0/kitInit.c @@ -176,12 +176,20 @@ #endif #endif /* messy because TclSetStartupScriptPath is called slightly too late */ if (Tcl_Eval(interp, initScript) == TCL_OK) { - Tcl_Obj* path = TclGetStartupScriptPath(); + Tcl_Obj* path; +#ifdef HAVE_TCLSETSTARTUPSCRIPTPATH + path = TclGetStartupScriptPath(); + TclSetStartupScriptPath(Tcl_GetObjResult(interp)); +#else +# ifdef HAVE_TCL_SETSTARTUPSCRIPT + path = Tcl_GetStartupScriptPath(NULL); TclSetStartupScriptPath(Tcl_GetObjResult(interp)); +# endif +#endif if (path == NULL) Tcl_Eval(interp, "incr argc -1; set argv [lrange $argv 1 end]"); } Tcl_SetVar(interp, "errorInfo", "", TCL_GLOBAL_ONLY);