Diff

Differences From Artifact [5a0fe6c78b]:

To Artifact [5a5604ad51]:


38
39
40
41
42
43
44

45
46
47
48
49
50
51

# Always rebuild kitsh
rm -f "kitsh/.success"
for pkg in ${KITCREATOR_ALLPKGS} ${KITCREATOR_PKGS}; do
	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
		rm -f "${pkg}/build.log" "${pkg}/.success"
		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"


		rm -rf "${pkg}/src"/tmp-*
	fi

	if [ "${mode}" = "distclean" ]; then
		rm -rf "${pkg}/src"
	fi







>







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

# Always rebuild kitsh
rm -f "kitsh/.success"
for pkg in ${KITCREATOR_ALLPKGS} ${KITCREATOR_PKGS}; do
	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
		rm -f "${pkg}/build.log" "${pkg}/.success"
		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"
		rm -rf "${pkg}"/workdir-*

		rm -rf "${pkg}/src"/tmp-*
	fi

	if [ "${mode}" = "distclean" ]; then
		rm -rf "${pkg}/src"
	fi
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
	if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then
		TCLSH_NATIVE="${testsh}"

		break
	fi
done
export TCLSH_NATIVE



















# Verify that each component is happy with the environment
validatefailed="0"
for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
	failed='0'
	if [ -f "${pkg}/.success" ]; then
		continue
	fi

	if [ -x "${pkg}/validate.sh" ]; then
		(
			cd "${pkg}" >/dev/null 2>/dev/null || exit 1

			./validate.sh 3>&1 4>&2 > build.log 2>&1 || exit 1
		) || failed="1"

		if [ "${failed}" = '1' ]; then
			echo "Failed pre-requisite check for ${pkg}" >&2

			validatefailed='1'
		fi







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













|







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
	if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then
		TCLSH_NATIVE="${testsh}"

		break
	fi
done
export TCLSH_NATIVE

# Function to determine what build mode is being used
function useCommonBuildSystem() {
	local script

	script="$1"

	if head "${script}" 2>/dev/null | grep -i '^# *BuildCompatible: *KitCreator *$' >/dev/null 2>/dev/null; then
		return 0
	fi

	return 1
}

# Cleanup build logs
for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
	rm -f "${pkg}/build.log"
done

# Verify that each component is happy with the environment
validatefailed="0"
for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
	failed='0'
	if [ -f "${pkg}/.success" ]; then
		continue
	fi

	if [ -x "${pkg}/validate.sh" ]; then
		(
			cd "${pkg}" >/dev/null 2>/dev/null || exit 1

			./validate.sh 3>&1 4>&2 >> build.log 2>&1 || exit 1
		) || failed="1"

		if [ "${failed}" = '1' ]; then
			echo "Failed pre-requisite check for ${pkg}" >&2

			validatefailed='1'
		fi
202
203
204
205
206
207
208





































209



210
211
212
213
214
215
216
		(
			cd "${pkg}" >/dev/null 2>/dev/null || exit 1

			build_script='./build.sh'
			if [ -x 'kitcreator-build.sh' ]; then
				build_script='./kitcreator-build.sh'
			fi





































			"${build_script}" 3>&1 4>&2 > build.log 2>&1 || exit 1



		) || failed="1"
	fi

	if [ "${failed}" = "1" ]; then
		echo " failed."
		failedpkgs="${failedpkgs} ${pkg}"
	else







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
		(
			cd "${pkg}" >/dev/null 2>/dev/null || exit 1

			build_script='./build.sh'
			if [ -x 'kitcreator-build.sh' ]; then
				build_script='./kitcreator-build.sh'
			fi

			if useCommonBuildSystem "${build_script}"; then
				(
					. ../common/common.sh
					. "${build_script}"

					set -x

					init || die 'init failed'

					predownload || die 'predownload failed'
					download || die 'download failed'
					postdownload || die 'postdownload failed'

					extract || die 'extract failed'

					apply_patches || die 'apply patches failed'

					cd "${workdir}" || exit 1

					preconfigure || die 'preconfigure failed'
					configure || die 'configure failed'
					postconfigure || die 'postconfigure failed'

					prebuild || die 'prebuild failed'
					build || die 'build failed'
					postbuild || die 'postbuild failed'

					preinstall || die 'preinstall failed'
					install || die 'install failed'
					postinstall || die 'postinstall failed'

					createruntime || die 'createruntime failed'

					set +x

					rm -rf "${workdir}"
				) 3>&1 4>&2 > build.log 2>&1 || exit 1
			else
				"${build_script}" 3>&1 4>&2 >> build.log 2>&1 || exit 1
			fi
		) || failed="1"
	fi

	if [ "${failed}" = "1" ]; then
		echo " failed."
		failedpkgs="${failedpkgs} ${pkg}"
	else