Diff

Differences From Artifact [5a0fe6c78b]:

To Artifact [5a5604ad51]:


    38     38   
    39     39   # Always rebuild kitsh
    40     40   rm -f "kitsh/.success"
    41     41   for pkg in ${KITCREATOR_ALLPKGS} ${KITCREATOR_PKGS}; do
    42     42   	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
    43     43   		rm -f "${pkg}/build.log" "${pkg}/.success"
    44     44   		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"
           45  +		rm -rf "${pkg}"/workdir-*
    45     46   
    46     47   		rm -rf "${pkg}/src"/tmp-*
    47     48   	fi
    48     49   
    49     50   	if [ "${mode}" = "distclean" ]; then
    50     51   		rm -rf "${pkg}/src"
    51     52   	fi
................................................................................
   157    158   	if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then
   158    159   		TCLSH_NATIVE="${testsh}"
   159    160   
   160    161   		break
   161    162   	fi
   162    163   done
   163    164   export TCLSH_NATIVE
          165  +
          166  +# Function to determine what build mode is being used
          167  +function useCommonBuildSystem() {
          168  +	local script
          169  +
          170  +	script="$1"
          171  +
          172  +	if head "${script}" 2>/dev/null | grep -i '^# *BuildCompatible: *KitCreator *$' >/dev/null 2>/dev/null; then
          173  +		return 0
          174  +	fi
          175  +
          176  +	return 1
          177  +}
          178  +
          179  +# Cleanup build logs
          180  +for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
          181  +	rm -f "${pkg}/build.log"
          182  +done
   164    183   
   165    184   # Verify that each component is happy with the environment
   166    185   validatefailed="0"
   167    186   for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
   168    187   	failed='0'
   169    188   	if [ -f "${pkg}/.success" ]; then
   170    189   		continue
   171    190   	fi
   172    191   
   173    192   	if [ -x "${pkg}/validate.sh" ]; then
   174    193   		(
   175    194   			cd "${pkg}" >/dev/null 2>/dev/null || exit 1
   176    195   
   177         -			./validate.sh 3>&1 4>&2 > build.log 2>&1 || exit 1
          196  +			./validate.sh 3>&1 4>&2 >> build.log 2>&1 || exit 1
   178    197   		) || failed="1"
   179    198   
   180    199   		if [ "${failed}" = '1' ]; then
   181    200   			echo "Failed pre-requisite check for ${pkg}" >&2
   182    201   
   183    202   			validatefailed='1'
   184    203   		fi
................................................................................
   202    221   		(
   203    222   			cd "${pkg}" >/dev/null 2>/dev/null || exit 1
   204    223   
   205    224   			build_script='./build.sh'
   206    225   			if [ -x 'kitcreator-build.sh' ]; then
   207    226   				build_script='./kitcreator-build.sh'
   208    227   			fi
   209         -			"${build_script}" 3>&1 4>&2 > build.log 2>&1 || exit 1
          228  +
          229  +			if useCommonBuildSystem "${build_script}"; then
          230  +				(
          231  +					. ../common/common.sh
          232  +					. "${build_script}"
          233  +
          234  +					set -x
          235  +
          236  +					init || die 'init failed'
          237  +
          238  +					predownload || die 'predownload failed'
          239  +					download || die 'download failed'
          240  +					postdownload || die 'postdownload failed'
          241  +
          242  +					extract || die 'extract failed'
          243  +
          244  +					apply_patches || die 'apply patches failed'
          245  +
          246  +					cd "${workdir}" || exit 1
          247  +
          248  +					preconfigure || die 'preconfigure failed'
          249  +					configure || die 'configure failed'
          250  +					postconfigure || die 'postconfigure failed'
          251  +
          252  +					prebuild || die 'prebuild failed'
          253  +					build || die 'build failed'
          254  +					postbuild || die 'postbuild failed'
          255  +
          256  +					preinstall || die 'preinstall failed'
          257  +					install || die 'install failed'
          258  +					postinstall || die 'postinstall failed'
          259  +
          260  +					createruntime || die 'createruntime failed'
          261  +
          262  +					set +x
          263  +
          264  +					rm -rf "${workdir}"
          265  +				) 3>&1 4>&2 > build.log 2>&1 || exit 1
          266  +			else
          267  +				"${build_script}" 3>&1 4>&2 >> build.log 2>&1 || exit 1
          268  +			fi
   210    269   		) || failed="1"
   211    270   	fi
   212    271   
   213    272   	if [ "${failed}" = "1" ]; then
   214    273   		echo " failed."
   215    274   		failedpkgs="${failedpkgs} ${pkg}"
   216    275   	else