From: Pat Thoyts Date: Tue, 16 Mar 2010 20:52:26 +0000 (+0000) Subject: support building a static thread extension X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=7f44f53680be896bbf75affbb18f2e9c4661f16d;p=kitgen support building a static thread extension This lets us link the thread extension statically into the kit binary. Signed-off-by: Pat Thoyts --- diff --git a/makefile.include b/makefile.include index 192e436..8a4302c 100644 --- a/makefile.include +++ b/makefile.include @@ -68,6 +68,12 @@ build/threaddyn: build/tcl sh $(EXTDIR)/thread/configure $(TCLDIR) $(THREADDYN_OPTS) && \ $(MAKE) install-binaries install-libraries +thread: build/thread +build/thread: build/tcl + mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \ + sh $(EXTDIR)/thread/configure $(STATIC) $(TCLDIR) $(THREAD_OPTS) && \ + $(MAKE) install-binaries install-libraries + build/tk: build/tcl mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \ sh ../../../tk/$(PLAT)/configure $(STATIC) $(TCLDIR) $(TK_OPTS) && \ diff --git a/setupvfs.tcl b/setupvfs.tcl index 803c3dd..5317b62 100644 --- a/setupvfs.tcl +++ b/setupvfs.tcl @@ -14,7 +14,7 @@ set argv [lrange $argv 2 end] ;# strip off the leading "-init- setupvfs.tcl" set debugOpt 0 set encOpt 0 set msgsOpt 0 -set threadOpt 0 +set threadOpt none set tzOpt 0 set customOpt {} @@ -23,7 +23,8 @@ while {1} { -d { incr debugOpt } -e { incr encOpt } -m { incr msgsOpt } - -t { incr threadOpt } + -t { set threadOpt dynamic } + -T { set threadOpt static } -z { incr tzOpt } -c { set customOpt [lindex $argv 1] @@ -225,8 +226,15 @@ if {$encOpt} { } } -if {$threadOpt} { - lappend clifiles lib/[glob -tails -dir build/lib thread2*] +switch -exact -- $threadOpt { + static { + foreach file [glob -tails -dir build/lib/thread2.6.5 *.tcl] { + lappend clifiles lib/Thread/$file + } + } + dynamic { + lappend clifiles lib/[glob -tails -dir build/lib thread2*] + } } if {$tcl_version eq "8.4"} { @@ -419,6 +427,7 @@ switch [info sharedlibext] { set exts {rechan} if {![package vsatisfies [package provide Tcl] 8.6]} { lappend exts zlib } if {[package vcompare [package provide Tcl] 8.4] == 0} { lappend exts pwb } +if {$threadOpt eq "static"} { lappend exts Thread } foreach ext $exts { staticpkg $ext }