From 0c0f4bafa42aef56194f418b884603e600c2a93d Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Tue, 5 Feb 2008 23:08:30 +0000 Subject: [PATCH] Added support for building old style metakit based tclkit binaries. git-svn-id: svn://svn.equi4.com/kitgen/trunk@2117 9e558909-932a-0410-a563-af77432da1eb --- config.sh | 32 +++++++++++++++++++++++++++++--- makefile.include | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/config.sh b/config.sh index f875091..6cf01aa 100755 --- a/config.sh +++ b/config.sh @@ -14,7 +14,7 @@ path=$root/$base if test ! -d $root then echo "error: directory '$root' does not exist"; exit 1; fi -for v in allenc allmsgs aqua b64 cli dyn gui ppc \ +for v in allenc allmsgs aqua b64 cli dyn gui ppc mk \ gcov gprof sym thread tzdata univ x86 do eval $v=0; done @@ -99,8 +99,16 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac ;; SunOS) + echo "CFLAGS += -I/usr/openwin/include" echo "LDFLAGS = -ldl -lsocket -lnsl -lm" - echo "GUI_OPTS = -lX11 -lXext" + if [ $root = "8.5" ]; then + echo "GUI_OPTS = -L/usr/openwin/lib -L/usr/sfw/lib -lXft -lfreetype -lz -lfontconfig -lXrender -lX11 -lXext" + else + echo "GUI_OPTS = -L/usr/openwin/lib -lX11 -lXext" + fi + case $b64 in 1) + echo "CFLAGS += -m64" ;; + esac ;; *) echo "warning: no settings known for '$mach'" >&2 ;; @@ -114,7 +122,10 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac echo "TCL_OPTS += --enable-64bit" echo "TK_OPTS += --enable-64bit" echo "VFS_OPTS += --enable-64bit" - echo "VLERQ_OPTS += --enable-64bit" ;; + echo "VLERQ_OPTS += --enable-64bit" + echo "MK_OPTS += --enable-64bit" + echo "ITCL_OPTS += --enable-64bit" + ;; esac #case $verbose in 1) kitopts=" -d" ;; esac @@ -153,12 +164,19 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac echo "TKDYN_OPTS += --enable-symbols" echo "VFS_OPTS += --enable-symbols" echo "VLERQ_OPTS += --enable-symbols" + echo "MK_OPTS += --enable-symbols" + echo "ITCL_OPTS += --enable-symbols" echo ;; esac case $cli in 1) targets="$targets tclkit-cli" ;; esac case $dyn in 1) targets="$targets tclkit-dyn" ;; esac case $gui in 1) targets="$targets tclkit-gui" ;; esac + case $mk in + 1) case $cli in 1) targets="$targets tclkitsh" ;; esac + case $gui in 1) targets="$targets tclkit" ;; esac + ;; + esac case $thread in 1) echo "all: threaded$targets" ;; @@ -170,6 +188,9 @@ case $cli-$dyn-$gui in 0-0-0) cli=1 dyn=1 gui=1 ;; esac echo "tclkit-cli: tclkit-cli.exe" echo "tclkit-dyn: tclkit-dyn.exe" echo "tclkit-gui: tclkit-gui.exe" + case $mk in 1) echo "tclkitsh: tclkitsh.exe" + echo "tclkit: tclkit.exe" ;; + esac esac echo @@ -192,6 +213,11 @@ case $verbose in 1) case $cli in 1) echo " $path/tclkit-cli (command-line)" ;; esac case $dyn in 1) echo " $path/tclkit-dyn (Tk as shared lib)" ;; esac case $gui in 1) echo " $path/tclkit-gui (Tk linked statically)" ;; esac + case $mk in 1) + case $cli in 1) echo " $path/tclkitsh (old-style command line)" ;; esac + case $gui in 1) echo " $path/tclkit (old-style with Tk)" ;; esac + ;; + esac echo echo "To remove all intermediate builds, use 'make clean'." echo "To remove all executables as well, use 'make distclean'." diff --git a/makefile.include b/makefile.include index b073829..de94e59 100644 --- a/makefile.include +++ b/makefile.include @@ -142,3 +142,50 @@ $(OUTDIR)/tclkit.res.o: ../../tclkit.rc $(OUTDIR)/tclkitsh.res.o: ../../tclkit.rc windres -o $@ --define STATIC_BUILD --include build/include \ --include ../../files $< + +#------------------------------------------------------------------------- +# Old-style builds - +# This section produces an old-style tclkit and tclkitsh that use +# metakit and include incr-tcl statically linked in. + +tclkitsh$(EXE): kitsh$(EXE) ../../setupvfs.tcl build/files + cp kitsh$(EXE) $@ && $(STRIP) $@ && $(UPX) $@ + ./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ cli + +tclkit$(EXE): kitsh$(EXE) kit$(EXE) ../../setupvfs.tcl build/files + cp kit$(EXE) $@ && $(STRIP) $@ && $(UPX) $@ + ./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui + +kitsh$(EXE): build/tcl build/tclvfs build/mk build/itcl build/zlib $(CLIOBJ) + $(CC) -o $(OUTDIR)/kitInit$O $(CFLAGS) -DSTATIC_BUILD \ + -DKIT_INCLUDES_ITCL \ + -Ibuild/include -c ../../kitInit.c + $(CXX) -o $@ $(CFLAGS) $(OUTDIR)/kitInit$O $(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) + +kit$(EXE): build/tcl build/tk build/tclvfs build/mk build/itcl build/zlib $(GUIOBJ) + $(CC) -o $(OUTDIR)/kitInit$O $(CFLAGS) -DSTATIC_BUILD \ + -DKIT_INCLUDES_ITCL -DKIT_INCLUDES_TK \ + -Ibuild/include -c ../../kitInit.c + $(CXX) -o $@ $(CFLAGS) $(OUTDIR)/kitInit$O $(GUIOBJ) \ + -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/mk: build/tcl + mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \ + sh $(EXTDIR)/mk/tcl/configure $(STATIC) $(TCLDIR) $(MK_OPTS) && \ + $(MAKE) install-binaries install-libraries + +build/itcl: build/tcl + mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \ + sh $(EXTDIR)/itcl/configure $(STATIC) $(TCLDIR) $(ITCL_OPTS) && \ + $(MAKE) install-binaries install-libraries + +# end +#------------------------------------------------------------------------- + -- 2.23.0