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
37
38
39
40
41
42



43
44
45
46
47
48
49
SAVE_LIBS="${LIBS}"
LIBS="${ARCHS} ${LIBS}"
dnl Determine if we have "Tcl_SetStartupScript" (8.6.x) or "TclSetStartupScriptPath" (8.4.x)
AC_CHECK_FUNCS(Tcl_SetStartupScript TclSetStartupScriptPath)
dnl Check for the ability to get the current system encoding
AC_CHECK_FUNCS(Tcl_GetEncodingNameFromEnvironment Tcl_SetSystemEncoding)
LIBS="${SAVE_LIBS}"




dnl Find zlib
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib], [directory containing zlib]), [
	CPPFLAGS="${CPPFLAGS} -I${with_zlib}/include -I${with_zlib}"
	CFLAGS="${CFLAGS} -I${with_zlib}/include -I${with_zlib}"
	LDFLAGS="${LDFLAGS} -L${with_zlib}/lib -L${with_zlib}"
])







>
>
>







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
SAVE_LIBS="${LIBS}"
LIBS="${ARCHS} ${LIBS}"
dnl Determine if we have "Tcl_SetStartupScript" (8.6.x) or "TclSetStartupScriptPath" (8.4.x)
AC_CHECK_FUNCS(Tcl_SetStartupScript TclSetStartupScriptPath)
dnl Check for the ability to get the current system encoding
AC_CHECK_FUNCS(Tcl_GetEncodingNameFromEnvironment Tcl_SetSystemEncoding)
LIBS="${SAVE_LIBS}"

dnl Check for optional system calls
AC_CHECK_FUNCS(readlink)

dnl Find zlib
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib], [directory containing zlib]), [
	CPPFLAGS="${CPPFLAGS} -I${with_zlib}/include -I${with_zlib}"
	CFLAGS="${CFLAGS} -I${with_zlib}/include -I${with_zlib}"
	LDFLAGS="${LDFLAGS} -L${with_zlib}/lib -L${with_zlib}"
])

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

157
158
159
160
161
162
163






















164
165
166
167
168
169
170
171
172
173




174
175
176
177
178
179
180
"} else continue\n";

/* SetExecName --

   Hack to get around Tcl bug 1224888.
*/
void SetExecName(Tcl_Interp *interp) {






















	if (tclExecutableName == NULL) {
		int len = 0;
		Tcl_Obj *execNameObj;
		Tcl_Obj *lobjv[1];

		lobjv[0] = Tcl_GetVar2Ex(interp, "argv0", NULL, TCL_GLOBAL_ONLY);
		execNameObj = Tcl_FSJoinToPath(Tcl_FSGetCwd(interp), 1, lobjv);

		tclExecutableName = strdup(Tcl_GetStringFromObj(execNameObj, &len));
	}




}

int TclKit_AppInit(Tcl_Interp *interp) {
#ifdef TCLKIT_CAN_SET_ENCODING
	Tcl_DString encodingName;
#endif








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|
>
>
>
>







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
"} else continue\n";

/* SetExecName --

   Hack to get around Tcl bug 1224888.
*/
void SetExecName(Tcl_Interp *interp) {
#if defined(HAVE_READLINK)
	if (tclExecutableName == NULL) {
		ssize_t readlink_ret;
		char procpath[PATH_MAX + 1];
		char exe_buf[PATH_MAX + 1];
		int snprintf_ret;

		snprintf_ret = snprintf(procpath, sizeof(procpath), "/proc/%lu/exe", (unsigned long) getpid());
		if (snprintf_ret < sizeof(procpath)) {
			readlink_ret = readlink(procpath, exe_buf, sizeof(exe_buf) - 1);

			if (readlink_ret > 0 && readlink_ret < (sizeof(exe_buf) - 1)) {
				exe_buf[readlink_ret] = '\0';

				tclExecutableName = strdup(exe_buf);

				return;
			}
		}
	}
#endif

	if (tclExecutableName == NULL) {
		int len = 0;
		Tcl_Obj *execNameObj;
		Tcl_Obj *lobjv[1];

		lobjv[0] = Tcl_GetVar2Ex(interp, "argv0", NULL, TCL_GLOBAL_ONLY);
		execNameObj = Tcl_FSJoinToPath(Tcl_FSGetCwd(interp), 1, lobjv);

		tclExecutableName = strdup(Tcl_GetStringFromObj(execNameObj, &len));

		return;
	}

	return;
}

int TclKit_AppInit(Tcl_Interp *interp) {
#ifdef TCLKIT_CAN_SET_ENCODING
	Tcl_DString encodingName;
#endif