Index: README ================================================================== --- README +++ README @@ -1,6 +1,7 @@ -This will build a Tclkit named "tclkit-". +This will build a Tclkit named "tclkit-" or a KitDLL named +"libtclkit.so". --------------- Using This Tool --------------- Usage: @@ -125,10 +126,14 @@ 9. KITCREATOR_MINBUILD Set this variable to a non-empty string to exclude unnecessary packages from Tcl build. This excludes the following packages: tcltest + + Additionally, any bundled packages (in the "pkgs" directory) + are excluded. This typically includes (as of Tcl 8.6): + itcl thread 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 DELETED build/make-kit-arm Index: build/make-kit-arm ================================================================== --- build/make-kit-arm +++ build/make-kit-arm @@ -1,11 +0,0 @@ -#! /bin/sh - -PATH="${PATH}:/home/rkeene/root/cross-compilers/mipsel-linux-uclibc/usr/mipsel-linux-uclibc/bin" -AR=mipsel-linux-uclibc-ar -CC=mipsel-linux-uclibc-gcc -CXX=false -RANLIB=mipsel-linux-uclibc-ranlib -STRIP=mipsel-linux-uclibc-strip -export PATH AR CC CXX RANLIB STRIP - -./build/make-minkit "$@" --host=mipsel-linux-uclibc ADDED build/make-kit-linux-amd64 Index: build/make-kit-linux-amd64 ================================================================== --- build/make-kit-linux-amd64 +++ build/make-kit-linux-amd64 @@ -0,0 +1,11 @@ +#! /bin/sh + +PATH="${PATH}:${HOME}/root/cross-compilers/x86_64-unknown-linux-gnu/bin/" +AR=x86_64-unknown-linux-gnu-ar +CC=x86_64-unknown-linux-gnu-gcc +CXX=x86_64-unknown-linux-gnu-g++ +RANLIB=x86_64-unknown-linux-gnu-ranlib +STRIP=x86_64-unknown-linux-gnu-strip +export PATH AR CC CXX RANLIB STRIP + +./kitcreator "$@" --host=x86_64-unknown-linux-gnu ADDED build/make-kit-mipsel Index: build/make-kit-mipsel ================================================================== --- build/make-kit-mipsel +++ build/make-kit-mipsel @@ -0,0 +1,11 @@ +#! /bin/sh + +PATH="${PATH}:/home/rkeene/root/cross-compilers/mipsel-unknown-linux-uclibc/bin" +AR=mipsel-unknown-linux-uclibc-ar +CC=mipsel-unknown-linux-uclibc-gcc +CXX=mipsel-unknown-linux-uclibc-g++ +RANLIB=mipsel-unknown-linux-uclibc-ranlib +STRIP=mipsel-unknown-linux-uclibc-strip +export PATH AR CC CXX RANLIB STRIP + +./build/make-minkit "$@" --host=mipsel-unknown-linux-uclibc Index: build/makearch.info ================================================================== --- build/makearch.info +++ build/makearch.info @@ -14,11 +14,11 @@ # each time a "makearch" is done. # # If @@SVNLCR@@ is used anywhere in this version number, it will be # replaced with the highest last-changed-rev from the output of # svn info -R (or 0) -VERS="0.5.3" +VERS="0.5.4" # Space sperated list of documents, if they exist, they will be # prefixed with the contents of the DOC_HDR file and substitution # will occur: # @@UTIL@@ becomes the utility name ${UTIL} Index: build/test/do-nightly-tests-and-publish ================================================================== --- build/test/do-nightly-tests-and-publish +++ build/test/do-nightly-tests-and-publish @@ -17,19 +17,13 @@ # On Wednesday, do a distclean to force redownloading everything (mainly # for CVS Head) and force a rebuild to ensure up-to-date build status if [ "$(date '+%u')" = "3" ]; then ./kitcreator distclean || exit 1 - - touch "${KITCREATORDIR}/build/test/force_nightly" -fi - -if [ -d "${WEBROOTDIR}/${TESTNAME}" ]; then - # Don't re-run the tests if nothing has changed - if [ -f "${KITCREATORDIR}/build/test/force_nightly" ]; then - rm -f "${KITCREATORDIR}/build/test/force_nightly" - else +else + if [ -d "${WEBROOTDIR}/${TESTNAME}" ]; then + # Don't re-run the tests if nothing has changed exit 0 fi fi cd build/test || exit 1 @@ -56,9 +50,13 @@ rm -rf "${WEBROOTDIR}"/svn_r*/ "${WEBROOTDIR}"/fossil_*/ # Publish New Results ./publish-tests "${TESTNAME}" +# Create nightly symlink +rm -f "${WEBROOTDIR}/nightly" +ln -s "${TESTNAME}" "${WEBROOTDIR}/nightly" + # Clean rm -f '__AUTO_TESTS_RUNNING__' exit 0 Index: build/test/index.ttml ================================================================== --- build/test/index.ttml +++ build/test/index.ttml @@ -1,11 +1,11 @@ KitCreator Build and Test Status -

KitCreator Build and Test Status

+

KitCreator Build and Test Status

The follow versions of KitCreator have test suite results:

-

The actual tests can be found in the "tests" directory

+

The actual tests can be found in the "tests" directory

Index: build/test/publish-tests ================================================================== --- build/test/publish-tests +++ build/test/publish-tests @@ -203,18 +203,33 @@ # Store kit information with all kits set key [list $tclversion $kitos $kitcpu] lappend allkitinfo($key) [array get kitinfo] } + +# Determine human readable name, and URL +if {[string match "fossil_*" $kitcreator_vers]} { + set work [split $kitcreator_vers _] + + set kitcreator_fossil_vers [lindex $work 1] + + set kitcreator_readable_vers "Fossil trunk check-in ${kitcreator_fossil_vers}" + + set url "http://kitcreator.rkeene.org/fossil/tarball/kitcreator-${kitcreator_vers}.tar.gz?uuid=${kitcreator_fossil_vers}" +} else { + set kitcreator_readable_vers $kitcreator_vers + + set url "http://www.rkeene.org/devel/kitcreator-${kitcreator_vers}.tar.gz" +} puts $fd "" puts $fd " " puts $fd " KitCreator Build and Test Status" puts $fd " " puts $fd " " -puts $fd "

KitCreator Build and Test Status

" -puts $fd "

The following table represents the status of the test results from the KitCreator test suite.

" +puts $fd "

KitCreator Build and Test Status

" +puts $fd "

The following table represents the status of the test results from the KitCreator test suite for KitCreator ${kitcreator_readable_vers}.

" puts $fd " " foreach key [lsort -dictionary [array names allkitinfo]] { puts $fd " " puts $fd " " puts $fd " " Index: build/test/test ================================================================== --- build/test/test +++ build/test/test @@ -51,11 +51,11 @@ )" DISPLAY=:31 export DISPLAY failed="" -for kit in normal normal-zip normal-threaded normal-threaded-zip normal-statictk normal-notk normal-threaded-notk normal-threaded-zip-notk normal-nomk4 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 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-arm-min linux-arm-min-kitdll; do +for kit in normal normal-zip normal-threaded normal-threaded-zip normal-statictk normal-notk normal-threaded-notk normal-threaded-zip-notk normal-nomk4 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 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-kitdll; do kitcreator="./kitcreator" args="" runnable="1" iszip="0" statictk="0" @@ -87,16 +87,22 @@ win32|win32-*) kitcreator="./build/make-kit-win32" xcompile="1" kitruncmd="wine" ;; - linux-arm-min|linux-arm-min-kitdll) - kitcreator="./build/make-kit-arm" + linux-mipsel-min|linux-mipsel-min-kitdll) + kitcreator="./build/make-kit-mipsel" runnable="0" xcompile="1" notk="1" iszip="1" + ;; + linux-amd64|linux-amd64-*) + kitcreator="./build/make-kit-linux-amd64" + runnable="0" + xcompile="1" + iszip="0" ;; esac if [ "${xcompile}" != "0" ]; then kit="${kit}-xcompile" Index: build/test/tests/12-threads.tcl ================================================================== --- build/test/tests/12-threads.tcl +++ build/test/tests/12-threads.tcl @@ -1,31 +1,36 @@ #! /usr/bin/env tclsh -set buildflags [split [lindex $argv 1] -] - -# Determine if Threads was requested (or in 8.6+, unrequested) -if {$tcl_version == "8.6"} { - if {[lsearch -exact $buildflags "unthreaded"] == -1} { - set isthreaded 1 - } else { - set isthreaded 0 - } -} else { - if {[lsearch -exact $buildflags "threaded"] == -1} { - set isthreaded 0 - } else { - set isthreaded 1 - } -} - -# Static builds don't come with threads. -if {[lsearch -exact $buildflags "static"] != -1} { - set isthreaded 0 -} - -if {!$isthreaded} { - exit 0 -} - -package require Thread - -exit 0 +if {[catch { + set buildflags [split [lindex $argv 1] -] + + # Determine if Threads was requested (or in 8.6+, unrequested) + if {$tcl_version == "8.6"} { + if {[lsearch -exact $buildflags "unthreaded"] == -1} { + set isthreaded 1 + } else { + set isthreaded 0 + } + } else { + if {[lsearch -exact $buildflags "threaded"] == -1} { + set isthreaded 0 + } else { + set isthreaded 1 + } + } + + # Minimal builds don't come with threads. + if {[lsearch -exact $buildflags "min"] != -1} { + set isthreaded 0 + } + + if {!$isthreaded} { + exit 0 + } + + package require Thread + + exit 0 +}]} { + puts "Error in Thread Test: $errorInfo" + exit 1 +} ADDED build/test/tests/16-itcl.tcl Index: build/test/tests/16-itcl.tcl ================================================================== --- build/test/tests/16-itcl.tcl +++ build/test/tests/16-itcl.tcl @@ -0,0 +1,23 @@ +#! /usr/bin/env tclsh + +if {[catch { + set buildflags [split [lindex $argv 1] -] + + # Determine if Itcl was was requested + ## Minimal builds don't come with Itcl + set hasitcl 1 + if {[lsearch -exact $buildflags "min"] != -1} { + set hasitcl 0 + } + + if {!$hasitcl} { + exit 0 + } + + package require Itcl + + exit 0 +}]} { + puts "Error in Itcl Test: $errorInfo" + exit 1 +} Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -24,10 +24,12 @@ # Define the list of all packages, for cleaning purposes KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread kitdll" for pkg in ${KITCREATOR_ALLPKGS}; do rm -f "${pkg}/build.log" rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build" + + rm -rf "${pkg}/src"/tmp-* if [ "${mode}" = "distclean" ]; then rm -rf "${pkg}/src" fi done @@ -82,10 +84,23 @@ STATICMK4="0" export STATICMK4 fi fi fi + +# Find Windows resource-related files +if [ -f "kit.ico" ]; then + KITCREATOR_ICON="$(pwd)/kit.ico" +else + KITCREATOR_ICON="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.ico)" +fi +if [ -f "kit.rc" ]; then + KITCREATOR_RC="$(pwd)/kit.rc" +else + KITCREATOR_RC="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.rc)" +fi +export KITCREATOR_ICON KITCREATOR_RC failedpkgs="" buildfailed="0" for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} "${KITTARGET}"; do echo -n "Building ${pkg} ..." Index: kitdll/buildsrc/kitdll-0.0/Makefile.in ================================================================== --- kitdll/buildsrc/kitdll-0.0/Makefile.in +++ kitdll/buildsrc/kitdll-0.0/Makefile.in @@ -1,13 +1,15 @@ CC = @CC@ +OBJCOPY = @OBJCOPY@ CFLAGS = @CFLAGS@ @SHOBJFLAGS@ -Wall CPPFLAGS = @CPPFLAGS@ @DEFS@ -DKITDLL_MAKE_LOADABLE=1 WISH_CFLAGS = @WISH_CFLAGS@ LDFLAGS = @LDFLAGS@ SHOBJLDFLAGS = @SHOBJLDFLAGS@ LIBS = @LIBS@ STATICLIBS = @ARCHS@ +STRIPLIBS = @STRIPLIBS@ @EXTRA_OBJS@ OBJS = vfs_kitdll_data_tcl.o kitInit.o rechan.o pwb.o zlib.o EXTRA_OBJS = @EXTRA_OBJS@ TCLSH_NATIVE = tclsh # Default target @@ -29,10 +31,11 @@ pwb.o: pwb.c zlib.o: zlib.c ## DLL Build libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@: $(OBJS) $(EXTRA_OBJS) + -for striplib in $(STRIPLIBS); do $(OBJCOPY) --weaken "$${striplib}"; done $(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) @WHOLEARCHIVE@ $(STATICLIBS) @NOWHOLEARCHIVE@ $(LIBS) # Test driver tclsh.o: tclsh.c tclsh: tclsh.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ Index: kitdll/buildsrc/kitdll-0.0/aclocal.m4 ================================================================== --- kitdll/buildsrc/kitdll-0.0/aclocal.m4 +++ kitdll/buildsrc/kitdll-0.0/aclocal.m4 @@ -283,10 +283,12 @@ DC_DO_STATIC_LINK_LIB([C++ Library (UNIX)], [-lstdc++]) ]) ]) AC_DEFUN(DC_FIND_TCLKIT_LIBS, [ + AC_CHECK_TOOL(OBJCOPY, objcopy, [:]) + DC_SETUP_TCL_PLAT_DEFS WISH_CFLAGS="" dnl We will need this for the Tcl project, which we will always have @@ -300,19 +302,23 @@ libfilesnostub="`find "${libdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`" for libfile in ${libfiles}; do LDFLAGS="${LDFLAGS} -L`dirname "${libfile}"`" done + + hide_symbols="1" if test "$proj" = "tcl"; then DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $libfilesnostub], [ libfiles="${libfilesnostub}" ], [ DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $libfiles], [ libfiles="${libfiles}" ]) ]) + + hide_symbols="0" fi if test "${proj}" = "mk4tcl"; then if test -n "$libfiles"; then AC_DEFINE(KIT_INCLUDES_MK4TCL, [1], [Specify this if you link against mkt4tcl]) @@ -338,20 +344,28 @@ fi if test "$host_os" = "mingw32msvc" -o "$host_os" = "mingw32"; then WISH_CFLAGS="-mwindows" fi + + hide_symbols="0" fi fi ARCHS="${ARCHS} ${libfiles}" AC_MSG_RESULT([${libfiles}]) + + if test "${hide_symbols}" = "1"; then + STRIPLIBS="${STRIPLIBS} ${libfiles}" + fi + done AC_SUBST(WISH_CFLAGS) AC_SUBST(ARCHS) + AC_SUBST(STRIPLIBS) ]) AC_DEFUN(DC_CHECK_FOR_ACCEPTABLE_DLADDR, [ AC_CHECK_HEADERS(dlfcn.h) AC_CHECK_FUNCS(dladdr) Index: kitsh/build.sh ================================================================== --- kitsh/build.sh +++ kitsh/build.sh @@ -41,26 +41,26 @@ if [ -z "${ZLIBDIR}" -o ! -f "${ZLIBDIR}/lib/libz.a" ]; then unset ZLIBDIR fi # Copy user specified kit.rc and kit.ico in to build directory, if found - if [ -f "${OTHERPKGSDIR}/kit.rc" ]; then - cp "${OTHERPKGSDIR}/kit.rc" "${BUILDDIR}" - fi - if [ -f "${OTHERPKGSDIR}/kit.ico" ]; then - cp "${OTHERPKGSDIR}/kit.ico" "${BUILDDIR}" - fi + cp "${KITCREATOR_ICON}" "${BUILDDIR}/kit.ico" + cp "${KITCREATOR_RC}" "${BUILDDIR}/kit.rc" # Include extra objects as required ## Initialize list of extra objects EXTRA_OBJS="" - ## Tk Resources (needed for Win32 support) + ## Tk Resources (needed for Win32 support) -- remove kit-found resources to prevent the symbols from being in conflict TKDIR="$(cd "${OTHERPKGSDIR}/tk/inst" && pwd)" TKRSRC="${TKDIR}/lib/tkbase.res.o" if [ -n "${TKDIR}" -a -f "${TKRSRC}" ]; then EXTRA_OBJS="${EXTRA_OBJS} ${TKRSRC}" + + echo ' *** Removing "kit.rc" since we have Tk with its own resource file' + + rm -f "${BUILDDIR}/kit.rc" fi ## Export to the environment, to be picked up by the "configure" script export EXTRA_OBJS @@ -98,20 +98,23 @@ ## 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 kit starpack.vfs \"${ENABLECOMPRESSION}\"" "${TCLKIT}" installvfs.tcl kit starpack.vfs "${ENABLECOMPRESSION}" else ## Bootstrap (cannot cross-compile) ### Call installer cp kit runkit echo "set argv [list kit starpack.vfs {${ENABLECOMPRESSION}}]" > setup.tcl echo 'if {[catch { clock seconds }]} { proc clock args { return 0 } }' >> setup.tcl echo 'source installvfs.tcl' >> setup.tcl + + echo 'Running: echo | ./runkit' echo | ./runkit fi exit 0 ) || exit 1 exit 0 Index: kitsh/buildsrc/kitsh-0.0/configure.ac ================================================================== --- kitsh/buildsrc/kitsh-0.0/configure.ac +++ kitsh/buildsrc/kitsh-0.0/configure.ac @@ -26,12 +26,15 @@ dnl Check for Windows Resource Compiler AC_CHECK_TOOL([RC], [windres], [false]) dnl If we found the resource compiler, add "kit.res.o" to our list of objects to build +dnl (as long as the source for such an object exists) if ! test "$RC" = "false"; then - EXTRA_OBJS="$EXTRA_OBJS kit.res.o" + if test -f kit.rc; then + EXTRA_OBJS="$EXTRA_OBJS kit.res.o" + fi fi dnl Check for Tcl features SAVE_LIBS="${LIBS}" LIBS="${ARCHS} ${LIBS}" Index: mk4tcl/build.sh ================================================================== --- mk4tcl/build.sh +++ mk4tcl/build.sh @@ -86,10 +86,11 @@ tryopts="--enable-shared" else tryopts="--disable-shared" fi + SAVE_CXXFLAGS="${CXXFLAGS}" for tryopt in $tryopts __fail__; do # Clean up, if needed make distclean >/dev/null 2>/dev/null rm -rf "${INSTDIR}" mkdir "${INSTDIR}" @@ -101,10 +102,17 @@ if [ "${tryopt}" == "--enable-shared" ]; then isshared="1" else isshared="0" fi + + # If build a static Mk4tcl for KitDLL, ensure that we use PIC + # so that it can be linked into the shared object + if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then + CXXFLAGS="${SAVE_CXXFLAGS} -fPIC" + export CXXFLAGS + fi ( echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --with-tcl=\"${TCLCONFIGDIR}/../generic\" ${CONFIGUREEXTRA}" ./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --with-tcl="${TCLCONFIGDIR}/../generic" ${CONFIGUREEXTRA} ADDED mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff Index: mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff ================================================================== --- mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff +++ mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff @@ -0,0 +1,26 @@ +Binary files metakit-2.4.9.7.orig/unix/.Makefile.in.swp and metakit-2.4.9.7-1rsk/unix/.Makefile.in.swp differ +Binary files metakit-2.4.9.7.orig/unix/.configure.in.swp and metakit-2.4.9.7-1rsk/unix/.configure.in.swp differ +diff -uNr metakit-2.4.9.7.orig/unix/configure metakit-2.4.9.7-1rsk/unix/configure +--- metakit-2.4.9.7.orig/unix/configure 2007-06-15 18:26:40.000000000 -0500 ++++ metakit-2.4.9.7-1rsk/unix/configure 2011-03-09 07:39:59.000000000 -0600 +@@ -1482,7 +1482,7 @@ + if test $SHARED_BUILD = 1; then + SHLIB_FLAGS="-shared" + SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS" +- SHLIB_LD="g++ -shared" ++ SHLIB_LD="${CXX} -shared" + else + SHLIB_FLAGS="" + SHLIB_CFLAGS="" +diff -uNr metakit-2.4.9.7.orig/unix/configure.in metakit-2.4.9.7-1rsk/unix/configure.in +--- metakit-2.4.9.7.orig/unix/configure.in 2007-06-15 18:26:40.000000000 -0500 ++++ metakit-2.4.9.7-1rsk/unix/configure.in 2011-03-09 07:39:29.000000000 -0600 +@@ -117,7 +117,7 @@ + if test $SHARED_BUILD = 1; then + SHLIB_FLAGS="-shared" + SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS" +- SHLIB_LD="g++ -shared" ++ SHLIB_LD="${CXX} -shared" + else + SHLIB_FLAGS="" + SHLIB_CFLAGS="" Index: tcl/build.sh ================================================================== --- tcl/build.sh +++ tcl/build.sh @@ -26,21 +26,47 @@ if [ ! -f "${SRC}" ]; then mkdir 'src' >/dev/null 2>/dev/null if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then CVSTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g') + if [ "${CVSTAG}" = "HEAD" ]; then + CVSTAG="trunk" + fi export CVSTAG ( cd src || exit 1 - cvs -z3 -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tcl co -r "${CVSTAG}" -P tcl + workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}" + rm -rf "${workdir}" + + mkdir "${workdir}" || exit 1 + cd "${workdir}" || exit 1 + + wget -O "tmp-tcl.tar.gz" "http://core.tcl.tk/tcl/tarball/tcl-fossil.tar.gz?uuid=${CVSTAG}" || rm -f 'tmp-tcl.tar.gz' + wget -O "tmp-itcl.tar.gz" "http://core.tcl.tk/itcl/tarball/itcl-fossil.tar.gz?uuid=${CVSTAG}" || rm -f 'tmp-itcl.tar.gz' + wget -O "tmp-thread.tar.gz" "http://core.tcl.tk/thread/tarball/thread-fossil.tar.gz?uuid=${CVSTAG}" || rm -f "tmp-thread.tar.gz" + wget -O "tmp-tclconfig.tar.gz" "http://core.tcl.tk/tclconfig/tarball/tclconfig-fossil.tar.gz?uuid=${CVSTAG}" || rm -f "tmp-tclconfig.tar.gz" + + gzip -dc 'tmp-tcl.tar.gz' | tar -xf - + gzip -dc "tmp-itcl.tar.gz" | tar -xf - + gzip -dc "tmp-thread.tar.gz" | tar -xf - + gzip -dc "tmp-tclconfig.tar.gz" | tar -xf - + + mv "tcl-fossil" "tcl${TCLVERS}" + mv "itcl-fossil" "tcl${TCLVERS}/pkgs/itcl" + mv "thread-fossil" "tcl${TCLVERS}/pkgs/thread" + cp -r "tclconfig-fossil" "tcl${TCLVERS}/pkgs/itcl/tclconfig" + cp -r "tclconfig-fossil" "tcl${TCLVERS}/pkgs/thread/tclconfig" + mv "tclconfig-fossil" "tcl${TCLVERS}/tclconfig" + + tar -cf - "tcl${TCLVERS}" | gzip -c > "../../${SRC}" - mv tcl "tcl${TCLVERS}" + cd .. - tar -cf - "tcl${TCLVERS}" | gzip -c > "../${SRC}" - ) + rm -rf "${workdir}" + ) || exit 1 else rm -f "${SRC}.tmp" wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 mv "${SRC}.tmp" "${SRC}" fi @@ -77,21 +103,10 @@ . "${patchscript}" ) fi done - # Patch Win32 builds to always provide DllMain if we are building KitDLL - if [ "${KITTARGET}" = "kitdll" ]; then - ## DllMain is needed when building KitDLL - for filetopatch in win/tclWin32Dll.c win/tclWinInit.c; do - echo "Undefining STATIC_BUILD in \"${filetopatch}\"" - - sed 's@STATIC_BUILD@NEVER_STATIC_BUILD@g' "${filetopatch}" > "${filetopatch}.new" && cat "${filetopatch}.new" > "${filetopatch}" - rm -f "${filetopatch}.new" - done - fi - for dir in unix win macosx __fail__; do if [ "${dir}" = "__fail__" ]; then # If we haven't figured out how to build it, reject. exit 1 ADDED tcl/patchscripts/minbuild-nopkgs.sh Index: tcl/patchscripts/minbuild-nopkgs.sh ================================================================== --- tcl/patchscripts/minbuild-nopkgs.sh +++ tcl/patchscripts/minbuild-nopkgs.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +if [ -n "${KITCREATOR_MINBUILD}" ]; then + rm -rf 'pkgs' +fi ADDED tcl/patchscripts/visibility-unhidden.sh Index: tcl/patchscripts/visibility-unhidden.sh ================================================================== --- tcl/patchscripts/visibility-unhidden.sh +++ tcl/patchscripts/visibility-unhidden.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +for file in unix/configure; do + sed 's@-fvisibility@-__disabled__fvisibility@' "${file}" > "${file}.new" + cat "${file}.new" > "${file}" + rm -f "${file}.new" +done ADDED tcl/patchscripts/win32-dllmain.sh Index: tcl/patchscripts/win32-dllmain.sh ================================================================== --- tcl/patchscripts/win32-dllmain.sh +++ tcl/patchscripts/win32-dllmain.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +## DllMain is needed when building KitDLL +for filetopatch in win/tclWin32Dll.c win/tclWinInit.c; do + echo "Undefining STATIC_BUILD in \"${filetopatch}\"" + + sed 's@STATIC_BUILD@NEVER_STATIC_BUILD@g' "${filetopatch}" > "${filetopatch}.new" && cat "${filetopatch}.new" > "${filetopatch}" + rm -f "${filetopatch}.new" +done Index: tclvfs/build.sh ================================================================== --- tclvfs/build.sh +++ tclvfs/build.sh @@ -83,15 +83,15 @@ echo "Running: ${MAKE:-make}" ${MAKE:-make} || exit 1 echo "Running: ${MAKE:-make} install" - ${MAKE:-make} install + ${MAKE:-make} install || exit 1 mkdir "${OUTDIR}/lib" || exit 1 cp -r "${INSTDIR}/lib"/vfs* "${OUTDIR}/lib/" rm -f "${OUTDIR}/lib"/vfs*/*.a "${OUTDIR}/lib"/vfs*/*.so exit 0 ) || exit 1 exit 0 Index: tk/build.sh ================================================================== --- tk/build.sh +++ tk/build.sh @@ -15,11 +15,12 @@ SRCURL="http://prdownloads.sourceforge.net/tcl/tk${TCLVERS}-src.tar.gz" BUILDDIR="$(pwd)/build/tk${TCLVERS}" PATCHDIR="$(pwd)/patches" OUTDIR="$(pwd)/out" INSTDIR="$(pwd)/inst" -export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR +PATCHSCRIPTDIR="$(pwd)/patchscripts" +export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR rm -rf 'build' 'out' 'inst' mkdir 'build' 'out' 'inst' || exit 1 # Determine Tcl version @@ -33,20 +34,33 @@ if [ ! -f "${SRC}" ]; then mkdir 'src' >/dev/null 2>/dev/null if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then CVSTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g') + if [ "${CVSTAG}" = "HEAD" ]; then + CVSTAG="trunk" + fi export CVSTAG ( cd src || exit 1 - cvs -z3 -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tktoolkit co -r "${CVSTAG}" -P tk + workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}" + rm -rf "${workdir}" + + mkdir "${workdir}" || exit 1 + cd "${workdir}" || exit 1 + + wget -O "tmp-tk.tar.gz" "http://core.tcl.tk/tk/tarball/tk-${CVSTAG}.tar.gz?uuid=${CVSTAG}" || rm -f 'tmp-tk.tar.gz' + gzip -dc "tmp-tk.tar.gz" | tar -xf - - mv tk "tk${TCLVERS}" + mv "tk-${CVSTAG}" "tk${TCLVERS}" + + tar -cf - "tk${TCLVERS}" | gzip -c > "../../${SRC}" - tar -cf - "tk${TCLVERS}" | gzip -c > "../${SRC}" + cd .. + rm -rf "${workdir}" ) else rm -f "${SRC}.tmp" wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 mv "${SRC}.tmp" "${SRC}" @@ -84,10 +98,21 @@ echo "Applying: ${patch}" ${PATCH:-patch} -p1 < "${patch}" done ) + + # Apply patch scripts if needed + for patchscript in "${PATCHSCRIPTDIR}"/*.sh; do + if [ -f "${patchscript}" ]; then + echo "Running patch script: ${patchscript}" + + ( + . "${patchscript}" + ) + fi + done for dir in unix win macosx win64 __fail__; do if [ "${dir}" = "__fail__" ]; then exit 1 fi @@ -141,10 +166,16 @@ echo "Running: ${MAKE:-make} install" ${MAKE:-make} install || continue # Update to include resources, if found if [ "${dir}" = "win" ]; then + echo ' *** Importing user-specified icon' + cp "${KITCREATOR_ICON}" rc/tk.ico + + echo ' *** Importing user-specified resources' + cat "${KITCREATOR_RC}" | grep -v '^ *tclsh *ICON' >> "./rc/tk_base.rc" + echo ' *** Creating tkbase.res.o to support Windows build' echo "\"${RC:-windres}\" -o tkbase.res.o --define STATIC_BUILD --include \"./../generic\" --include \"${TCLCONFIGDIR}/../generic\" --include \"${TCLCONFIGDIR}\" --include \"./rc\" \"./rc/tk_base.rc\"" "${RC:-windres}" -o tkbase.res.o --define STATIC_BUILD --include "./../generic" --include "${TCLCONFIGDIR}/../generic" --include "${TCLCONFIGDIR}" --include "./rc" "./rc/tk_base.rc" if [ -f "tkbase.res.o" ]; then ADDED tk/patchscripts/visibility-unhidden.sh Index: tk/patchscripts/visibility-unhidden.sh ================================================================== --- tk/patchscripts/visibility-unhidden.sh +++ tk/patchscripts/visibility-unhidden.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +for file in unix/configure; do + sed 's@-fvisibility@-__disabled__fvisibility@' "${file}" > "${file}.new" + cat "${file}.new" > "${file}" + rm -f "${file}.new" +done
Tclkit for [pretty_print_key $key]