aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlecoanet2004-10-01 15:30:41 +0000
committerlecoanet2004-10-01 15:30:41 +0000
commit8a91f58d9e3541e9abc4c5e44948fd4e38804f56 (patch)
tree68be04b05642238dc00cb7fc8ffac96c0295b1b4
parent059cb213a9a7d18f7b74a82d542f6216621f0720 (diff)
downloadtkzinc-8a91f58d9e3541e9abc4c5e44948fd4e38804f56.zip
tkzinc-8a91f58d9e3541e9abc4c5e44948fd4e38804f56.tar.gz
tkzinc-8a91f58d9e3541e9abc4c5e44948fd4e38804f56.tar.bz2
tkzinc-8a91f58d9e3541e9abc4c5e44948fd4e38804f56.tar.xz
Compilation for linux and windows now included
-rw-r--r--starkit.tcl.in63
1 files changed, 63 insertions, 0 deletions
diff --git a/starkit.tcl.in b/starkit.tcl.in
index 07453b3..8ce35bb 100644
--- a/starkit.tcl.in
+++ b/starkit.tcl.in
@@ -31,6 +31,60 @@ set PATCHLEVEL @PATCHLEVEL@
# main.tcl
#
+proc crossCompile {} {
+ global MAJOR_VERSION MINOR_VERSION PATCHLEVEL
+ global env
+
+ #
+ # Try to find the Tcl/Tk headers and stubs cache
+ set kit [file normalize [file join [pwd] .. .kittmp]]
+ if { ! [file exists $kit] } {
+ puts "Unable to find the Tcl/Tk headers and stubs in $kit, exiting."
+ exit
+ }
+ puts "Using Tcl/Tk headers and stubs in: $kit"
+
+ set sources {
+ libtess/dict.c libtess/geom.c libtess/memalloc.c libtess/mesh.c
+ libtess/normal.c libtess/priorityq.c libtess/render.c
+ libtess/sweep.c libtess/tess.c libtess/tessmono.c
+ generic/Track.c generic/Tabular.c generic/Reticle.c generic/Map.c
+ generic/Rectangle.c generic/Arc.c generic/Curve.c generic/Item.c
+ generic/PostScript.c generic/MapInfo.c generic/Attrs.c
+ generic/Draw.c generic/Geo.c generic/List.c generic/perfos.c
+ generic/Transfo.c generic/Group.c generic/Icon.c generic/Text.c
+ generic/Image.c generic/Color.c generic/Field.c generic/Triangles.c
+ generic/Window.c generic/tkZinc.c generic/OverlapMan.c
+ win/WinPort.c
+ }
+ set cFlags [list -I$kit -I$kit/generic -I$kit/xlib -Igeneric -Ilibtess \
+ -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 \
+ -DVERSION=\"$MAJOR_VERSION.$MINOR_VERSION.$PATCHLEVEL\" \
+ -DGL=1 -DGL_DAMAGE=1 -DOM=1 -O2 -DBUILD_Tkzinc=1 ]
+ set lFlags [list -shared -s -L$kit/Windows-x86 -ltclstub -ltkstub \
+ -lopengl32 -lgdi32 -lwsock32 -luser32 ]
+ set objs [list]
+
+ set envSave $env(PATH)
+ set env(PATH) $env(HOME)/cross-tools/bin:$env(PATH)
+ set logFile [open starkit.log w]
+
+ foreach f $sources {
+ lappend objs [file rootname [file tail $f]].o
+ set cmdLine "gcc $cFlags -c $f >&@ $logFile"
+ puts $logFile $cmdLine
+ catch {eval exec $cmdLine} result
+ puts $logFile $result
+ }
+ set cmdLine "gcc $objs $lFlags -o Tkzinc$MAJOR_VERSION$MINOR_VERSION$PATCHLEVEL.dll >&@ $logFile"
+ puts $logFile $cmdLine
+ catch {eval exec $cmdLine} result
+ puts $logFile $result
+
+ close $logFile
+ set env(PATH) $envSave
+}
+
proc updateKit {} {
global MAJOR_VERSION MINOR_VERSION PATCHLEVEL
@@ -110,6 +164,15 @@ proc Platform {} {
}
#
+# Build the Windows variant
+crossCompile
+
+#
+# Build the linux variant
+catch {exec make clean}
+catch {exec make}
+
+#
# If the starkit Tkzinc.kit already exist in the top directory
# simply update it else build a new one according to the layout
# above. In this later case one need to make sure there is a