Fix unix tclkit build to statically link libstdc++ and use dynamic Tk.
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 25 Nov 2009 22:39:58 +0000 (22:39 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 25 Nov 2009 22:39:58 +0000 (22:39 +0000)
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
git-svn-id: svn://svn.equi4.com/kitgen/trunk@4724 9e558909-932a-0410-a563-af77432da1eb

config.sh
makefile.include

index e665e151702888cf5b6ca3579e2ba9e8f1b6d405..b9832151d0b1ff155e839e24a4d85b96b48e90d1 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -68,7 +68,9 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac
       ;;
       
     Linux)
+      echo "CXX        = gcc"
       echo "LDFLAGS    = -ldl -lm"
+      echo "LDXXFLAGS  = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic"
       echo "GUI_OPTS   = -L/usr/X11R6/lib -lX11 -lXss"
       if [ $root != "8.4" ]; then
           echo "GUI_OPTS  += -lXft -lXext"
@@ -106,8 +108,10 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac
       ;;
 
     SunOS)
+      echo "CXX        = gcc"
       echo "CFLAGS    += -I/usr/openwin/include"
       echo "LDFLAGS    = -ldl -lsocket -lnsl -lm"
+      echo "LDXXFLAGS  = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic"
       echo "GUI_OPTS   = -L/usr/openwin/lib -lX11 -lXext"
       if [ $root != "8.4" ]; then
           echo "GUI_OPTS  += -L/usr/sfw/lib -lXft -lfreetype -lz -lfontconfig -lXrender"
index d7d06c6e2c0c62558c0affea5aeb27602d7952b0..9b02778c113b099fbed65919c9fd02efc38dc7bb 100644 (file)
@@ -152,9 +152,16 @@ tclkitsh$(EXE): kitsh$(EXE) ../../setupvfs.tcl build/files
        cp kitsh$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
        ./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ cli
 
+# the windows executable uses tk not tkdyn and is linked differently
+ifeq ($(PLAT),win)
 tclkit$(EXE): kitsh$(EXE) kit$(EXE) ../../setupvfs.tcl build/files
        cp kit$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
        ./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui
+else
+tclkit$(EXE): kitsh$(EXE) build/tkdyn ../../setupvfs.tcl build/files
+       cp kitsh$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
+       ./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ dyn
+endif
 
 kitsh$(EXE): build/tcl build/tclvfs build/mk build/itcl build/zlib $(CLIOBJ)
        $(CC) -o $(OUTDIR)/kitInit$O $(CFLAGS) -DSTATIC_BUILD \
@@ -164,7 +171,7 @@ kitsh$(EXE): build/tcl build/tclvfs build/mk build/itcl build/zlib $(CLIOBJ)
          -Ibuild/include -DSTATIC_BUILD \
          build/lib/vfs1*/*vfs1*$A build/lib/Mk4tcl*/*Mk4tcl*$A \
          build/lib/itcl*/*itcl3*$A \
-         build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS)
+         build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS) $(LDXXFLAGS)
 
 kit$(EXE): build/tcl build/tk build/tclvfs build/mk build/itcl build/zlib $(GUIOBJ)
        $(CC) -o $(OUTDIR)/kitInit$O $(CFLAGS) -DSTATIC_BUILD \
@@ -174,7 +181,8 @@ kit$(EXE): build/tcl build/tk build/tclvfs build/mk build/itcl build/zlib $(GUIO
          -Ibuild/include -DSTATIC_BUILD \
          build/lib/vfs1*/*vfs1*$A build/lib/Mk4tcl*/*Mk4tcl*$A \
          build/lib/libtk8*$A build/lib/itcl*/*itcl3*$A \
-         build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS) $(GUI_OPTS)
+         build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS)  $(LDXXFLAGS) \
+         $(GUI_OPTS)
 
 build/mk: build/tcl
        mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \