Index: README ================================================================== --- README +++ README @@ -139,10 +139,40 @@ Kitsh Configure Options: 1. --enable-kit-storage={zip|mk4|auto} Specify which type of storage to use with the Tclkit. The default is to auto-detect. Auto-detection uses Mk4 if available and built statically, otherwise it falls back to Zip. + +-------------------- +Using the KitDLL SDK +-------------------- +When you build a KitDLL, a "libtclkit-sdk-.tar.gz" tarball is also +produced. This tarball contains the Tcl (and Tk, if compiled) stubs libraries, +and Tcl (and Tk, if compiled) header files needed to compile and link things +against Tcl (and Tk). It also includes "tclConfig.sh" (and "tkConfig.sh", if +Tk was compiled). + +The purpose for this tarball is to be used to build Tcl extensions or +applications that rely on Tcl/Tk using the KitDLL. + +To use it, one first must extract the tarball. After that the environment +variable "TCLKIT_SDK_DIR" must be set to the directory that was created in +order to make most of the variables contain useful values. + +For example, to build an extension using the KitDLL SDK one would typically do +something like: + 1. Compile KitDLL (may be omitted if the KitDLL SDK is already + available) + a. $ KITCREATOR_PKGS='tk itcl kitdll' + b. $ export KITCREATOR_PKGS + c. $ ./kitcreator + 2. Compile the Extension + a. $ tar -xf /path/to/libtclkit-sdk-8.4.19.tar.gz + b. $ TCLKIT_SDK_DIR="$(pwd)/libtclkit-sdk-8.4.19" + c. $ export TCLKIT_SDK_DIR + d. $ ./configure --with-tcl="${TCLKIT_SDK_DIR}/lib" + e. $ make ------------------- Method of Operation ------------------- Summary: Index: build/test/publish-tests ================================================================== --- build/test/publish-tests +++ build/test/publish-tests @@ -140,17 +140,19 @@ if {[file isdirectory $file]} { continue } switch -glob -- $file { - "*.log" - "*.ttml" - "*.html" - "*.desc" - "*-origname" - "*-tclsh" { + "*.log" - "*.ttml" - "*.html" - "*.desc" - "*-origname" - "*-tclsh" - "*-sdk.tar.gz" { continue } } # Derive what we can from the filename set buildfile "${shortfile}-build.log" + set sdkshortfile "${shortfile}-sdk.tar.gz" + set sdkfile "${file}-sdk.tar.gz" # Determine which tests passed/failed set failedtests [list] set passedtests [list] set testsfile "${file}-tests.log" @@ -201,10 +203,14 @@ set kitinfo(passedtests) $passedtests set kitinfo(buildflags) $kitbuildinfo set kitinfo(os) $kitos set kitinfo(cpu) $kitcpu set kitinfo(built) $kitbuilt + + if {[file exists $sdkfile]} { + set kitinfo(sdk) $sdkshortfile + } # Store kit information with all kits set key [list $tclversion $kitos $kitcpu] lappend allkitinfo($key) [array get kitinfo] } @@ -299,11 +305,17 @@ set statustext [lindex $statusinfo 0] set bgcolor [lindex $statusinfo 1] set kitdesc [pretty_print_buildinfo $kitinfo(buildflags)] if {$kitinfo(built)} { - puts $fd " $kitdesc" + puts $fd " " + puts $fd " $kitdesc" + + if {[info exists kitinfo(sdk)]} { + puts $fd " (sdk)" + } + puts $fd " " } else { puts $fd " $kitdesc" } puts $fd " [pretty_print_size [file size [file join $WEBDIR $kitinfo(fullfile)]]]" puts $fd " $statustext" Index: build/test/test ================================================================== --- build/test/test +++ build/test/test @@ -69,10 +69,11 @@ if [ "${BIGBUILD}" = "1" ]; then kits="$(echo normal{,-zip,-nomk4}{,-threaded}{,-statictk,-notk} normal{,-threaded}{,-notk}{,-nomk4}{,-debug}-kitdll win32-i586{,-zip,-nomk4}{,-threaded}{,-notk} win32-i586{,-threaded}{,-notk}{,-nomk4}-kitdll min{,-static} {linux-mipsel-min,linux-amd64-notk}{,-debug}{,-kitdll} {solaris-i386,solaris-amd64,solaris-sparc,solaris-sparc64,freebsd-amd64,netbsd-amd64}{,-zip,-nomk4}{,-threaded}{,-statictk,-notk}{,debug} {solaris-i386,solaris-amd64,solaris-sparc,solaris-sparc64,freebsd-amd64,netbsd-amd64}{,-threaded}{,-notk}{,-nomk4}{,debug}-kitdll netbsd-i386{,-zip,-nomk4}{,-threaded}{,debug}-notk netbsd-i386{,-threaded}{,-nomk4}{,debug}-notk-kitdll)" else kits="normal normal-zip normal-threaded normal-threaded-zip normal-statictk normal-notk normal-threaded-notk normal-threaded-zip-notk normal-nomk4 normal-debug min min-static normal-kitdll normal-threaded-kitdll normal-notk-kitdll normal-nomk4-kitdll normal-nomk4-notk-kitdll normal-threaded-nomk4-kitdll normal-threaded-notk-nomk4-kitdll normal-debug-kitdll min-kitdll win32-i586 win32-i586-zip win32-i586-threaded win32-i586-threaded-zip win32-i586-notk win32-i586-threaded-notk win32-i586-nomk4 win32-i586-kitdll win32-i586-threaded-kitdll win32-i586-notk-kitdll win32-i586-nomk4-kitdll win32-i586-nomk4-notk-kitdll win32-i586-threaded-nomk4-kitdll win32-i586-threaded-notk-nomk4-kitdll linux-mipsel-min linux-mipsel-min-kitdll linux-amd64-notk linux-amd64-notk-debug linux-amd64-notk-kitdll linux-amd64-notk-debug-kitdll solaris-i386 solaris-i386-debug solaris-i386-kitdll solaris-i386-debug-kitdll solaris-amd64 solaris-amd64-debug solaris-amd64-kitdll solaris-amd64-debug-kitdll solaris-sparc solaris-sparc-debug solaris-sparc-kitdll solaris-sparc-debug-kitdll solaris-sparc64 solaris-sparc64-debug solaris-sparc64-kitdll solaris-sparc64-debug-kitdll freebsd-amd64 freebsd-amd64-debug freebsd-amd64-kitdll freebsd-amd64-debug-kitdll netbsd-i386-notk netbsd-i386-notk-debug netbsd-i386-notk-kitdll netbsd-i386-notk-debug-kitdll netbsd-amd64 netbsd-amd64-debug netbsd-amd64-kitdll netbsd-amd64-debug-kitdll" fi +kits="normal-notk-kitdll normal-nomk4-kitdll win32-i586-kitdll" failed="" for kit in $kits; do kitcreator="./kitcreator" args="" @@ -201,14 +202,16 @@ # Create Tclkit if [ "${kitdll}" = "1" ]; then createdkit="libtclkit*.dll libtclkit*.*" outputname="${TESTDIR}/kits/libtclkit-${version}-${kit}" failoutputname="${TESTDIR}/kits/failed/libtclkit-${version}-${kit}" + sdk="libtclkit-sdk-${version}.tar.gz" else createdkit="tclkit-${version}" outputname="${TESTDIR}/kits/tclkit-${version}-${kit}" failoutputname="${TESTDIR}/kits/failed/tclkit-${version}-${kit}" + sdk='' fi buildlog="${outputname}-build.log" failbuildlog="${failoutputname}-build.log" testresultslog="${outputname}-tests.log" @@ -323,11 +326,11 @@ cp tclsh ../../../ ) >> "${buildlog}" 2>&1 fi # Perform wildcard expansion - createdkit="$(ls -f1 ${createdkit} 2>/dev/null | head -n 1)" + createdkit="$(ls -f1 ${createdkit} 2>/dev/null | grep -v '\.tar\.gz$' | head -n 1)" if [ ! -f "${createdkit}" ]; then echo "Failed to create kit ${version}/${kit}" >&2 failed="${failed} ${version}/${kit}-build" @@ -398,10 +401,14 @@ fi # For KitDLL, make a note of the original name if [ "${kitdll}" = "1" ]; then echo "${createdkit}" > "${outputname}-origname" + + if [ -f "${sdk}" ]; then + mv "${sdk}" "${outputname}-sdk.tar.gz" + fi fi fi # Test zip status if unzip -l "${outputname}" 2>&1 | grep 'boot\.tcl' >/dev/null; then ADDED common/post/sdk.sh Index: common/post/sdk.sh ================================================================== --- /dev/null +++ common/post/sdk.sh @@ -0,0 +1,85 @@ +#! /bin/bash + +if [ -z "${TCLVERS}" ]; then + echo 'This script is not meant to be run directly.' >&2 + + exit 1 +fi + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +rm -rf '__tmp__' +mkdir '__tmp__' +mkdir '__tmp__/include' +mkdir '__tmp__/lib' + +cp 'tcl/inst/lib/tclConfig.sh' '__tmp__/lib/' +cp -rp 'tcl/inst/include'/* '__tmp__/include/' +cp 'tcl/inst/lib'/libtclstub* '__tmp__/lib/' + +if [ -f 'tk/inst/lib/tkConfig.sh' ]; then + cp 'tk/inst/lib/tkConfig.sh' '__tmp__/lib/' + cp -rp 'tk/inst/include'/* '__tmp__/include/' + cp 'tk/inst/lib'/libtkstub* '__tmp__/lib/' +fi + +cp 'kitsh/build'/kitsh-*/libtclkit* '__tmp__/lib/' + +( + cd '__tmp__/lib' || exit 1 + + for kitlibfile in libtclkit*.dll libtclkit*; do + if [ ! -f "${kitlibfile}" ]; then + continue + fi + + if echo "${kitlibfile}" | grep '\.tar\.gz' >/dev/null; then + continue + fi + + break + done + kitlinker="$(echo "${kitlibfile}" | sed 's@^lib@-l@;s@\.[^\.]*$@@')" + + 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-zA-Z0-9\.]*|'"${kitlinker}"'|' 'tclConfig.sh' > 'tclConfig.sh.new' + ( + cat << _EOF_ +if [ -z "\${TCLKIT_SDK_DIR}" ]; then + TCLKIT_SDK_DIR="./libtclkit-sdk-${TCLVERS}" +fi + +_EOF_ + cat 'tclConfig.sh.new' + ) > 'tclConfig.sh' + rm -f 'tclConfig.sh.new' + + if [ -f 'tkConfig.sh' ]; then + 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-zA-Z0-9\.]*|'"${kitlinker}"'|' 'tkConfig.sh' > 'tkConfig.sh.new' + ( + cat << _EOF_ +if [ -z "\${TCLKIT_SDK_DIR}" ]; then + TCLKIT_SDK_DIR="./libtclkit-sdk-${TCLVERS}" +fi + +_EOF_ + cat 'tkConfig.sh.new' + ) > 'tkConfig.sh' + rm -f 'tkConfig.sh.new' + fi +) + +( + cd '__tmp__' || exit 1 + + mkdir "libtclkit-sdk-${TCLVERS}" + + mv 'lib' 'include' "libtclkit-sdk-${TCLVERS}/" + + tar -cf - "libtclkit-sdk-${TCLVERS}" | gzip -9c > "../libtclkit-sdk-${TCLVERS}.tar.gz" +) + +rm -rf '__tmp__' + +exit 0 Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -167,7 +167,15 @@ echo 'WARNING: Build is likely incomplete or failed.' >&2 fi cp 'kitsh/build'/kitsh-*/libtclkit* . >/dev/null 2>/dev/null cp 'kitsh/build'/kitsh-*/kit "tclkit-${TCLVERS}" >/dev/null 2>/dev/null + +for postscript in common/post/*; do + if [ ! -f "${postscript}" ]; then + continue + fi + + "${postscript}" +done exit "${buildfailed}"