Check-in [bcd030ea77]
Overview
Comment:Updated to better locate Tclkit under Linux (partially deals with <http://code.google.com/p/tclkit/issues/detail?id=1>)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bcd030ea77385c62f1aadfb2d093745c8309fd8b
User & Date: rkeene on 2010-09-26 04:45:44
Other Links: manifest | tags
Context
2010-09-26
04:45
Updated to use Tcl_FindExecutable() to set executable path check-in: 719fef74cb user: rkeene tags: trunk
04:45
Updated to better locate Tclkit under Linux (partially deals with <http://code.google.com/p/tclkit/issues/detail?id=1>) check-in: bcd030ea77 user: rkeene tags: trunk
04:45
Updated Tcl sub-project to return in failure if it cannot be compiled check-in: 14f3e1be3d user: rkeene tags: trunk
Changes

Modified kitsh/buildsrc/kitsh-0.0/configure.ac from [77ec27d4ef] to [442f0e7737].

    36     36   SAVE_LIBS="${LIBS}"
    37     37   LIBS="${ARCHS} ${LIBS}"
    38     38   dnl Determine if we have "Tcl_SetStartupScript" (8.6.x) or "TclSetStartupScriptPath" (8.4.x)
    39     39   AC_CHECK_FUNCS(Tcl_SetStartupScript TclSetStartupScriptPath)
    40     40   dnl Check for the ability to get the current system encoding
    41     41   AC_CHECK_FUNCS(Tcl_GetEncodingNameFromEnvironment Tcl_SetSystemEncoding)
    42     42   LIBS="${SAVE_LIBS}"
           43  +
           44  +dnl Check for optional system calls
           45  +AC_CHECK_FUNCS(readlink)
    43     46   
    44     47   dnl Find zlib
    45     48   AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib], [directory containing zlib]), [
    46     49   	CPPFLAGS="${CPPFLAGS} -I${with_zlib}/include -I${with_zlib}"
    47     50   	CFLAGS="${CFLAGS} -I${with_zlib}/include -I${with_zlib}"
    48     51   	LDFLAGS="${LDFLAGS} -L${with_zlib}/lib -L${with_zlib}"
    49     52   ])

Modified kitsh/buildsrc/kitsh-0.0/kitInit.c from [8565374f0c] to [2224f05581].

   157    157   "} else continue\n";
   158    158   
   159    159   /* SetExecName --
   160    160   
   161    161      Hack to get around Tcl bug 1224888.
   162    162   */
   163    163   void SetExecName(Tcl_Interp *interp) {
          164  +#if defined(HAVE_READLINK)
          165  +	if (tclExecutableName == NULL) {
          166  +		ssize_t readlink_ret;
          167  +		char procpath[PATH_MAX + 1];
          168  +		char exe_buf[PATH_MAX + 1];
          169  +		int snprintf_ret;
          170  +
          171  +		snprintf_ret = snprintf(procpath, sizeof(procpath), "/proc/%lu/exe", (unsigned long) getpid());
          172  +		if (snprintf_ret < sizeof(procpath)) {
          173  +			readlink_ret = readlink(procpath, exe_buf, sizeof(exe_buf) - 1);
          174  +
          175  +			if (readlink_ret > 0 && readlink_ret < (sizeof(exe_buf) - 1)) {
          176  +				exe_buf[readlink_ret] = '\0';
          177  +
          178  +				tclExecutableName = strdup(exe_buf);
          179  +
          180  +				return;
          181  +			}
          182  +		}
          183  +	}
          184  +#endif
          185  +
   164    186   	if (tclExecutableName == NULL) {
   165    187   		int len = 0;
   166    188   		Tcl_Obj *execNameObj;
   167    189   		Tcl_Obj *lobjv[1];
   168    190   
   169    191   		lobjv[0] = Tcl_GetVar2Ex(interp, "argv0", NULL, TCL_GLOBAL_ONLY);
   170    192   		execNameObj = Tcl_FSJoinToPath(Tcl_FSGetCwd(interp), 1, lobjv);
   171    193   
   172    194   		tclExecutableName = strdup(Tcl_GetStringFromObj(execNameObj, &len));
          195  +
          196  +		return;
   173    197   	}
          198  +
          199  +	return;
   174    200   }
   175    201   
   176    202   int TclKit_AppInit(Tcl_Interp *interp) {
   177    203   #ifdef TCLKIT_CAN_SET_ENCODING
   178    204   	Tcl_DString encodingName;
   179    205   #endif
   180    206