Fixed windows builds. We now produce a kit-dyn as windows needs some extra options...
authorPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 5 Apr 2007 20:44:42 +0000 (20:44 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 5 Apr 2007 20:44:42 +0000 (20:44 +0000)
git-svn-id: svn://svn.equi4.com/kitgen/trunk@1403 9e558909-932a-0410-a563-af77432da1eb

config.sh
kitInit.c
makefile.include
setupvfs.tcl

index 8604b2914edebff8265234ed87a748be20f5e788..d0b8773595b4d97af07733c3ad1a7828a706d44e 100755 (executable)
--- 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
       ;;
 
index 3dd1a8fdf3611e5a99acb3dfab6f5166d9e0f580..e50b9e2a6341df8641da594fbdd853e11391b5be 100644 (file)
--- 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"
 ;
index 7025bd732e57b665930a53788b36e1d20a4e5154..bc210b50bf337a616427feade260b3efe3e76358 100644 (file)
 #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 $<
index bf075b514a125c492b64479e1ed8953414d17702..1895de18f1ff2eefd9bf52bc7d4de9e372c7c4fd 100644 (file)
@@ -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