Check-in [f84245cd51]
Overview
Comment:Fix hard-coded use of './kit' in the kitsh build script and improve how the kit target name is defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f84245cd51d96745f86003f5c3a47eed4db67081
User & Date: mistachkin on 2015-10-07 02:38:10
Other Links: manifest | tags
Context
2015-10-07
22:44
Simplify and fix handling of 'kit.exe' instead of 'kit' on Windows. check-in: 31baf7fa49 user: mistachkin tags: trunk
02:38
Fix hard-coded use of './kit' in the kitsh build script and improve how the kit target name is defined. check-in: f84245cd51 user: mistachkin tags: trunk
2015-09-14
19:04
Updated to include timeout for tests check-in: 404a1c438f user: rkeene tags: trunk
2015-05-18
22:54
Improvements in how the kit target name is defined. Closed-Leaf check-in: 227a06a601 user: mistachkin tags: kitTargetNameFix
Changes

Modified kitsh/build.sh from [60eb9576ab] to [d9a8c3dd79].

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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
				continue
			fi

			if echo "${chkkittarget}" | egrep '\.(lib|def|a)$'; then
				continue
			fi

			KITTARGET_NAME="${chkkittarget}"

			break
		done

		## Also create an executable named "kit" so that we can run it later
		${MAKE:-make} tclsh
		if [ -f "tclsh.exe" ]; then
			mv tclsh.exe kit.exe
		else
			mv tclsh kit
		fi
	else
		## The executable is always named "kit"
		if [ -f 'kit.exe' -a ! -f 'kit' ]; then
			KITTARGET_NAME='kit.exe'
		else
			KITTARGET_NAME='kit'
		fi
	fi
	export KITTARGET_NAME

	if [ "${KITTARGET_NAME}" = '__error__' ]; then
		echo "Failed to locate kit target!" >&2

		exit 1
	fi

	# Intall VFS onto kit
	## Determine if we have a Tclkit to do this work
	TCLKIT="${TCLKIT:-tclkit}"
	if echo 'exit 0' | "${TCLKIT}" >/dev/null 2>/dev/null; then
		## Install using existing Tclkit
		### Call installer
		echo "Running: \"${TCLKIT}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\" \"${KITTARGET_NAME}.new\""
		"${TCLKIT}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" "${KITTARGET_NAME}.new" || exit 1
	else
		if echo 'exit 0' | ./kit >/dev/null 2>/dev/null; then
			## Bootstrap (cannot cross-compile)
			### Call installer
			echo "set argv [list {${KITTARGET_NAME}} starpack.vfs {${ENABLECOMPRESSION}} {${KITTARGET_NAME}.new}]" > setup.tcl
			echo 'if {[catch { clock seconds }]} { proc clock args { return 0 } }' >> setup.tcl
			echo 'source installvfs.tcl' >> setup.tcl

			echo 'Running: echo | ./kit setup.tcl'
			echo | ./kit setup.tcl || exit 1
		else
			## Install using Tclsh, which may work if we're not using Metakit
			### Call installer
			echo "Running: \"${TCLSH_NATIVE}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\" \"${KITTARGET_NAME}.new\""
			"${TCLSH_NATIVE}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" "${KITTARGET_NAME}.new" || exit 1
		fi
	fi

	cat "${KITTARGET_NAME}.new" > "${KITTARGET_NAME}" || exit 1
	rm -f "${KITTARGET_NAME}.new"

	# Cleanup
	if [ "${KITTARGET}" = "kitdll" ]; then
		## Remove built interpreters if we are building KitDLL --
		## they're just tiny stubs anyway
		rm -f kit
	fi

	exit 0
) || exit 1

exit 0







|














|

|



















|






|
|















|






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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
				continue
			fi

			if echo "${chkkittarget}" | egrep '\.(lib|def|a)$'; then
				continue
			fi

			KITTARGET_NAME="./${chkkittarget}"

			break
		done

		## Also create an executable named "kit" so that we can run it later
		${MAKE:-make} tclsh
		if [ -f "tclsh.exe" ]; then
			mv tclsh.exe kit.exe
		else
			mv tclsh kit
		fi
	else
		## The executable is always named "kit"
		if [ -f 'kit.exe' -a ! -f 'kit' ]; then
			KITTARGET_NAME='./kit.exe'
		else
			KITTARGET_NAME='./kit'
		fi
	fi
	export KITTARGET_NAME

	if [ "${KITTARGET_NAME}" = '__error__' ]; then
		echo "Failed to locate kit target!" >&2

		exit 1
	fi

	# Intall VFS onto kit
	## Determine if we have a Tclkit to do this work
	TCLKIT="${TCLKIT:-tclkit}"
	if echo 'exit 0' | "${TCLKIT}" >/dev/null 2>/dev/null; then
		## Install using existing Tclkit
		### Call installer
		echo "Running: \"${TCLKIT}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\" \"${KITTARGET_NAME}.new\""
		"${TCLKIT}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" "${KITTARGET_NAME}.new" || exit 1
	else
		if echo 'exit 0' | "${KITTARGET_NAME}" >/dev/null 2>/dev/null; then
			## Bootstrap (cannot cross-compile)
			### Call installer
			echo "set argv [list {${KITTARGET_NAME}} starpack.vfs {${ENABLECOMPRESSION}} {${KITTARGET_NAME}.new}]" > setup.tcl
			echo 'if {[catch { clock seconds }]} { proc clock args { return 0 } }' >> setup.tcl
			echo 'source installvfs.tcl' >> setup.tcl

			echo 'Running: echo | \"${KITTARGET_NAME}\" setup.tcl'
			echo | "${KITTARGET_NAME}" setup.tcl || exit 1
		else
			## Install using Tclsh, which may work if we're not using Metakit
			### Call installer
			echo "Running: \"${TCLSH_NATIVE}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\" \"${KITTARGET_NAME}.new\""
			"${TCLSH_NATIVE}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" "${KITTARGET_NAME}.new" || exit 1
		fi
	fi

	cat "${KITTARGET_NAME}.new" > "${KITTARGET_NAME}" || exit 1
	rm -f "${KITTARGET_NAME}.new"

	# Cleanup
	if [ "${KITTARGET}" = "kitdll" ]; then
		## Remove built interpreters if we are building KitDLL --
		## they're just tiny stubs anyway
		rm -f "${KITTARGET_NAME}"
	fi

	exit 0
) || exit 1

exit 0