From: Pat Thoyts Date: Thu, 5 Apr 2007 20:44:42 +0000 (+0000) Subject: Fixed windows builds. We now produce a kit-dyn as windows needs some extra options... X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=80a4345944083d566cf090b1c35ae94bf3833aeb;p=kitgen Fixed windows builds. We now produce a kit-dyn as windows needs some extra options. Fixed dde and registry package versioning. git-svn-id: svn://svn.equi4.com/kitgen/trunk@1403 9e558909-932a-0410-a563-af77432da1eb --- diff --git a/config.sh b/config.sh index 8604b29..d0b8773 100755 --- a/config.sh +++ b/config.sh @@ -84,11 +84,14 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac ;; MINGW*) - echo "LDFLAGS = build/lib/dde1*/tcldde1*.a build/lib/reg1*/tclreg1*.a" - echo "GUI_OPTS = -lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32" - echo "GUI_OPTS += -lole32 -loleaut32 -luuid" - echo "GUI_OPTS += build/tk/wish.res.o -mwindows" - echo "EXE = .exe" + echo 'LDFLAGS = build/lib/dde1*/tcldde1*.a build/lib/reg1*/tclreg1*.a' + echo 'GUI_OPTS = -lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32' + echo 'GUI_OPTS += -lole32 -loleaut32 -luuid' + echo 'GUI_OPTS += build/tk/wish.res.o -mwindows' + echo 'DYNOBJ = $(CLIOBJ) $(OUTDIR)/tk/wish.res.o' + echo 'GUIOBJ = $(OBJ) $(OUTDIR)/winMain.o $(OUTDIR)/tk/wish.res.o' + echo 'PRIV = install-private-headers' + echo 'EXE = .exe' plat=win ;; diff --git a/kitInit.c b/kitInit.c index 3dd1a8f..e50b9e2 100644 --- a/kitInit.c +++ b/kitInit.c @@ -115,16 +115,6 @@ static char preInitCmd[] = "set tcl_library [file join $noe lib tcl$tcl_version]\n" "set tcl_libPath [list $tcl_library [file join $noe lib]]\n" "set tcl_pkgPath [list $tcl_library [file join $noe lib]]\n" -/* - * XXX: We should consider adding mk4tcl, pwb, rechan, zlib, vfs, Thread - * XXX: and Tk as pre-defined packages here as well. - * XXX: Currently Thread has a special pkgIndex.tcl in the starkit, but - * XXX: several of the other packages won't be auto-recognized. - */ -#ifdef _WIN32 - "package ifneeded dde 1.2.3 {load {} dde}\n" - "package ifneeded registry 1.1.3 {load {} registry}\n" -#endif "}\n" "tclKitPreInit" ; diff --git a/makefile.include b/makefile.include index 7025bd7..bc210b5 100644 --- a/makefile.include +++ b/makefile.include @@ -13,10 +13,12 @@ #LDSTRIP = -x EXTDIR = ../../../../8.x -KITSRC = ../../kitInit.c ../../pwb.c ../../rechan.c ../../zlib.c \ - ../tcl/$(PLAT)/tclAppInit.c STATIC = --disable-shared OUTDIR = $(shell pwd)/build +OBJ = $(OUTDIR)/pwb.o $(OUTDIR)/rechan.o $(OUTDIR)/zlib.o +CLIOBJ = $(OBJ) $(OUTDIR)/tclAppInit.o +DYNOBJ ?= $(CLIOBJ) +GUIOBJ ?= $(CLIOBJ) TCLDIR = --with-tcl=../lib --prefix=$(OUTDIR) --exec-prefix=$(OUTDIR) STRIP ?= strip @@ -24,23 +26,29 @@ tclkit-cli$(EXE): kit-cli$(EXE) ../../setupvfs.tcl build/files cp kit-cli$(EXE) $@ && $(STRIP) $@ ./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ cli -tclkit-dyn$(EXE): kit-cli$(EXE) build/tkdyn ../../setupvfs.tcl build/files - cp kit-cli$(EXE) $@ && $(STRIP) $@ +tclkit-dyn$(EXE): kit-dyn$(EXE) build/tkdyn ../../setupvfs.tcl build/files + cp kit-dyn$(EXE) $@ && $(STRIP) $@ ./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ dyn tclkit-gui$(EXE): kit-cli$(EXE) kit-gui$(EXE) ../../setupvfs.tcl build/files cp kit-gui$(EXE) $@ && $(STRIP) $@ ./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui -kit-cli$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(KITSRC) - $(CC) -o $@ $(CFLAGS) $(KITSRC) -Ibuild/include \ - -DKIT_LITE -DTCL_LOCAL_APPINIT=TclKit_AppInit -DSTATIC_BUILD \ +kit-cli$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(CLIOBJ) + $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(CLIOBJ) \ + -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \ + build/lib/vfs1*/*vfs1*.a build/lib/vqtcl4*/*vqtcl4*.a \ + build/lib/libz.a build/lib/libtcl8*.a $(LDFLAGS) + +kit-dyn$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(CLIOBJ) + $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(DYNOBJ) \ + -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \ build/lib/vfs1*/*vfs1*.a build/lib/vqtcl4*/*vqtcl4*.a \ build/lib/libz.a build/lib/libtcl8*.a $(LDFLAGS) -kit-gui$(EXE): build/tcl build/tk build/tclvfs build/vqtcl build/zlib $(KITSRC) - $(CC) -o $@ $(CFLAGS) $(KITSRC) -Ibuild/include \ - -DKIT_LITE -DTCL_LOCAL_APPINIT=TclKit_AppInit -DSTATIC_BUILD \ +kit-gui$(EXE): build/tcl build/tk build/tclvfs build/vqtcl build/zlib $(GUIOBJ) + $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(GUIOBJ) \ + -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \ build/lib/vfs1*/*vfs1*.a build/lib/vqtcl4*/*vqtcl4*.a \ -DKIT_INCLUDES_TK build/lib/libtk8*.a \ build/lib/libz.a build/lib/libtcl8*.a $(LDFLAGS) $(GUI_OPTS) @@ -63,7 +71,7 @@ build/threaddyn: build/tcl build/tk: build/tcl mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \ sh ../../../tk/$(PLAT)/configure $(STATIC) $(TCLDIR) $(TK_OPTS) && \ - $(MAKE) install-binaries install-libraries + $(MAKE) install-binaries install-libraries $(PRIV) build/tkdyn: build/tcl mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \ @@ -90,12 +98,29 @@ base: build/tcl build/tk tidy: rm -rf build/tcl build/tclvfs build/thread build/tk \ - build/tkdyn build/vqtcl build/zlib - + build/tkdyn build/vqtcl build/zlib build/*.o + clean: - rm -rf build kit-cli$(EXE) kit-gui$(EXE) + rm -rf build kit-cli$(EXE) kit-gui$(EXE) kit-dyn$(EXE) distclean: clean rm -f tclkit-cli$(EXE) tclkit-dyn$(EXE) tclkit-gui$(EXE) .PHONY: all base clean distclean threaded tidy + +$(OUTDIR)/pwb.o: ../../pwb.c + $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $< + +$(OUTDIR)/rechan.o: ../../rechan.c + $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $< + +$(OUTDIR)/zlib.o: ../../zlib.c + $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $< + +$(OUTDIR)/tclAppInit.o: ../tcl/$(PLAT)/tclAppInit.c + $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \ + -DTCL_LOCAL_APPINIT=TclKit_AppInit -c $< + +$(OUTDIR)/winMain.o: ../tk/$(PLAT)/winMain.c + $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \ + -DTK_LOCAL_APPINIT=TclKit_AppInit -c $< diff --git a/setupvfs.tcl b/setupvfs.tcl index bf075b5..1895de1 100644 --- a/setupvfs.tcl +++ b/setupvfs.tcl @@ -202,6 +202,9 @@ proc vfscopy {argv} { } } +set vfs [lindex $argv 0] +vfs::m2m::Mount $vfs $vfs + switch [info sharedlibext] { .dll { catch { @@ -212,6 +215,17 @@ switch [info sharedlibext] { file copy -force $dll build/lib/libthread$vsn.dll unset dll vsn } + # create dde and registry pkgIndex files with the right version + foreach ext {dde registry} { + if {[catch { + load {} $ext + set extdir [file join $vfs lib $ext] + file mkdir $extdir + set f [open $extdir/pkgIndex.tcl w] + puts $f "package ifneeded $ext [package provide $ext] {load {} $ext}" + close $f + } err]} { puts "ERROR: $err"} + } catch { file delete [glob build/lib/libtk8?.a] ;# so only libtk8?s.a will be found } @@ -227,9 +241,6 @@ switch [info sharedlibext] { } } -set vfs [lindex $argv 0] -vfs::m2m::Mount $vfs $vfs - switch [lindex $argv 1] { cli { vfscopy $clifiles