From c2bda0610df05ef20d2a97ae39dc3bfd4d479cca Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Wed, 25 Nov 2009 22:39:58 +0000 Subject: [PATCH] Fix unix tclkit build to statically link libstdc++ and use dynamic Tk. Signed-off-by: Pat Thoyts git-svn-id: svn://svn.equi4.com/kitgen/trunk@4724 9e558909-932a-0410-a563-af77432da1eb --- config.sh | 4 ++++ makefile.include | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config.sh b/config.sh index e665e15..b983215 100755 --- 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" diff --git a/makefile.include b/makefile.include index d7d06c6..9b02778 100644 --- a/makefile.include +++ b/makefile.include @@ -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 && \ -- 2.23.0