Check-in [2906d8d4b0]
Overview
Comment:Added support for performing post-build actions

Added post-build action "sdk" for building a KitDLL SDK if KitDLL building was requested

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tcl-sdk-support
Files: files | file ages | folders
SHA1:2906d8d4b01c8b89c09cd4ce958291fb99b34379
User & Date: rkeene on 2011-11-14 04:23:33
Other Links: manifest | tags
Context
2011-11-14
04:29
Updated to ignore created SDKs when looking for created kits during test builds check-in: cb0c37e35e user: rkeene tags: tcl-sdk-support
04:23
Added support for performing post-build actions

Added post-build action "sdk" for building a KitDLL SDK if KitDLL building was requested check-in: 2906d8d4b0 user: rkeene tags: tcl-sdk-support

02:32
Create new branch named "tcl-sdk-support" check-in: d5e4b44ef6 user: rkeene tags: tcl-sdk-support
Changes

Added common/post/sdk.sh version [2a53429c2b].

            1  +#! /bin/bash
            2  +
            3  +if [ -z "${TCLVERS}" ]; then
            4  +	echo 'This script is not meant to be run directly.' >&2
            5  +
            6  +	exit 1
            7  +fi
            8  +
            9  +if [ "${KITTARGET}" != "kitdll" ]; then
           10  +	exit 0
           11  +fi
           12  +
           13  +rm -rf '__tmp__'
           14  +mkdir '__tmp__'
           15  +mkdir '__tmp__/include'
           16  +mkdir '__tmp__/lib'
           17  +
           18  +cp 'tcl/inst/lib/tclConfig.sh' '__tmp__/lib/'
           19  +cp 'tcl/inst/include'/* '__tmp__/include/'
           20  +cp 'tcl/inst/lib'/libtclstub* '__tmp__/lib/'
           21  +
           22  +if [ -f 'tk/inst/lib/tkConfig.sh' ]; then
           23  +	cp 'tk/inst/lib/tkConfig.sh' '__tmp__/lib/'
           24  +	cp 'tk/inst/include'/* '__tmp__/include/'
           25  +	cp 'tk/inst/lib'/libtkstub* '__tmp__/lib/'
           26  +fi
           27  +
           28  +cp libtclkit* '__tmp__/lib/'
           29  +
           30  +(
           31  +	cd '__tmp__/lib' || exit 1
           32  +
           33  +	for libfile in *.dll.a; do
           34  +		if [ ! -f "${libfile}" ]; then
           35  +			continue
           36  +		fi
           37  +
           38  +		newlibfile="$(basename "${libfile}" .dll.a).lib"
           39  +
           40  +		mv "${libfile}" "${newlibfile}"
           41  +	done
           42  +
           43  +	for kitlibfile in libtclkit*; do
           44  +		if echo "${kitlibfile}" | grep '\.tar\.gz' >/dev/null; then
           45  +			continue
           46  +		fi
           47  +
           48  +		break
           49  +	done
           50  +	kitlinker="$(echo "${kitlibfile}" | sed 's@^lib@-l@;s@\.[^\.]*$@@')"
           51  +
           52  +	sed 's|'"$(dirname "$(dirname "$(pwd)")")"'/tcl/inst|${TCLKIT_SDK_DIR}|g;s|^TCL_SHARED_BUILD=.*$|TCL_SHARED_BUILD=1|;s|^TCL_LIB_FILE=.*$|TCL_LIB_FILE='"${kitlibfile}"'|;s|-ltcl[^s][a-fA-F0-9\.]*|'"${kitlinker}"'|' 'tclConfig.sh' > 'tclConfig.sh.new'
           53  +	(
           54  +		cat << _EOF_
           55  +if [ -z "\${TCLKIT_SDK_DIR}" ]; then
           56  +	TCLKIT_SDK_DIR="./libtclkit-sdk-${TCLVERS}"
           57  +fi
           58  +
           59  +_EOF_
           60  +		cat 'tclConfig.sh.new'
           61  +	) > 'tclConfig.sh'
           62  +	rm -f 'tclConfig.sh.new'
           63  +
           64  +	if [ -f 'tkConfig.sh' ]; then
           65  +		sed 's|'"$(dirname "$(dirname "$(pwd)")")"'/tk/inst|${TCLKIT_SDK_DIR}|g;s|^TK_SHARED_BUILD=.*$|TK_SHARED_BUILD=1|;s|^TK_LIB_FILE=.*$|TK_LIB_FILE='"${kitlibfile}"'|;s|-ltk[^s][a-fA-F0-9\.]*|'"${kitlinker}"'|' 'tkConfig.sh' > 'tkConfig.sh.new'
           66  +		(
           67  +			cat << _EOF_
           68  +if [ -z "\${TCLKIT_SDK_DIR}" ]; then
           69  +	TCLKIT_SDK_DIR="./libtclkit-sdk-${TCLVERS}"
           70  +fi
           71  +
           72  +_EOF_
           73  +			cat 'tkConfig.sh.new'
           74  +		) > 'tkConfig.sh'
           75  +		rm -f 'tkConfig.sh.new'
           76  +	fi
           77  +)
           78  +
           79  +(
           80  +	cd '__tmp__' || exit 1
           81  +
           82  +	mkdir "libtclkit-sdk-${TCLVERS}"
           83  +
           84  +	mv 'lib' 'include' "libtclkit-sdk-${TCLVERS}/"
           85  +
           86  +	tar -cf - "libtclkit-sdk-${TCLVERS}" | gzip -9c > "../libtclkit-sdk-${TCLVERS}.tar.gz"
           87  +)
           88  +
           89  +rm -rf '__tmp__'
           90  +
           91  +exit 0

Modified kitcreator from [ed95cc9314] to [e5a4f5c30e].

   165    165   
   166    166   if [ "${buildfailed}" != "0" ]; then
   167    167   	echo 'WARNING: Build is likely incomplete or failed.' >&2
   168    168   fi
   169    169   
   170    170   cp 'kitsh/build'/kitsh-*/libtclkit* . >/dev/null 2>/dev/null
   171    171   cp 'kitsh/build'/kitsh-*/kit "tclkit-${TCLVERS}" >/dev/null 2>/dev/null
          172  +
          173  +for postscript in common/post/*; do
          174  +	if [ ! -f "${postscript}" ]; then
          175  +		continue
          176  +	fi
          177  +
          178  +	"${postscript}"
          179  +done
   172    180   
   173    181   exit "${buildfailed}"