From cbd2cc564f0ccf6623fcf382423b17e09f336eee Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 30 Apr 1997 07:26:05 +0000 Subject: [PATCH] Added support for shared libaries (if supported by Tcl itself). --- CHANGELOG | 3 ++- Makefile.in | 25 ++++++++++++++++++------- configure.in | 19 +++++++++++++++++-- tclmain.c | 8 +++++++- 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b506fa3..b7e70a2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.31 1997-04-13 19:05:26 adam Exp $ +$Id: CHANGELOG,v 1.32 1997-04-30 07:26:05 adam Exp $ 06/19/95 Release of ir-tcl-1.0b ------------------------------------------------------ @@ -118,3 +118,4 @@ $Id: CHANGELOG,v 1.31 1997-04-13 19:05:26 adam Exp $ 04/13/97 Added ir-log-init command. +04/30/97 Added shared library support. diff --git a/Makefile.in b/Makefile.in index 3d81224..c2fc1a7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # (c) Index Data 1995-1996 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.42 1996-11-14 17:11:04 adam Exp $ +# $Id: Makefile.in,v 1.43 1997-04-30 07:26:06 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -32,6 +32,12 @@ TCLINC=@TCLINC@ TKLIB=@TKLIB@ TKINC=@TKINC@ +# Shared libraries definitions +SHLIB_CFLAGS = @SHLIB_CFLAGS@ +SHLIB_LD = @SHLIB_LD@ +SHLIB_SUFFIX = @SHLIB_SUFFIX@ +SHLIB_VERSION = @SHLIB_VERSION@ + # MOSI settings, directory with libmosi.a and source MOSI=@MOSI@ MOSIDIR=@MOSIDIR@ @@ -51,6 +57,7 @@ DEFS=-DCCL2RPN=0 @DEFS@ -DMOSI=$(MOSI) -DIRTCLDIR=\"$(IRTCLDIR)\" \ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ + RANLIB = @RANLIB@ O=ir-tcl.o marc.o queue.o mem.o grs.o explain.o select.o @@ -63,6 +70,15 @@ ir-tk: libirtcl.a tkmain.o ir-tcl: libirtcl.a tclmain.o $(CC) $(CFLAGS) tclmain.o -o ir-tcl libirtcl.a $(YAZLIB) $(TCLLIB) +libirtcl.a: $(O) + rm -f libirtcl.a + ar qc libirtcl.a $(O) + $(RANLIB) libirtcl.a + +@SHLIB_IRTCL@: $(O) + rm -f @SHLIB_IRTCL@ + ${SHLIB_LD} -o @SHLIB_IRTCL@ $(O) $(YAZLIB) + WAISDIR=../freeWAIS-sf-2.0 wais-tcl: libirtcl.a wais-tcl.o waismain.o @@ -75,11 +91,6 @@ waismain.o: tclmain.c wais-tcl.o: wais-tcl.c $(CC) -c $(CFLAGS) -I$(WAISDIR)/ir $(DEFS) wais-tcl.c -libirtcl.a: $(O) - rm -f libirtcl.a - ar qc libirtcl.a $(O) - $(RANLIB) libirtcl.a - install.man: @echo "Installation of man-pages" @if [ ! -d $(MANDIR) ]; then \ @@ -176,7 +187,7 @@ distribution: rm -fr tmp .c.o: - $(CC) -c $(CFLAGS) $(DEFS) $< + $(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(DEFS) $< $(O) tkmain.o tclmain.o wais-tcl.o waismain.o: ir-tcl.h ir-tclp.h diff --git a/configure.in b/configure.in index a113902..2e9b2d3 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl IR toolkit for tcl/tk -dnl (c) Index Data 1996 +dnl (c) Index Data 1996-1997 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.20 1997-04-13 19:00:42 adam Exp $ +dnl $Id: configure.in,v 1.21 1997-04-30 07:26:07 adam Exp $ AC_INIT(ir-tcl.h) CC=${CC-cc} dnl ------ Substitutions @@ -15,6 +15,11 @@ AC_SUBST(MOSI) AC_SUBST(MOSIDIR) AC_SUBST(MOSILIB) AC_SUBST(MOSIINC) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_LD) +AC_SUBST(SHLIB_SUFFIX) +AC_SUBST(SHLIB_VERSION) +AC_SUBST(SHLIB_IRTCL) dnl dnl ------ Preliminary settings AC_PROG_INSTALL @@ -78,8 +83,18 @@ if test -r ${tryprefix}/lib/tclConfig.sh; then TCLLIB="${TCL_LIB_SPEC} ${TCL_LIBS}" TCLINC=-I${TCL_PREFIX}/include RANLIB=$TCL_RANLIB + SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS + SHLIB_LD=$TCL_SHLIB_LD + SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX + SHLIB_VERSION=$TCL_SHLIB_VERSION + SHLIB_IRTCL=irtcl${TCL_SHLIB_SUFFIX} AC_MSG_RESULT($TCL_VERSION) else + SHLIB_CFLAGS="" + SHLIB_LD="shared-linker" + SHLIB_SUFFIX="" + SHLIB_VERSION="" + SHLIB_IRTCL="irtcl-shared" AC_PROG_RANLIB checkBoth=0 AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1) diff --git a/tclmain.c b/tclmain.c index 7239aed..b2f37f2 100644 --- a/tclmain.c +++ b/tclmain.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tclmain.c,v $ - * Revision 1.19 1996-08-20 09:27:49 adam + * Revision 1.20 1997-04-30 07:26:08 adam + * Added support for shared libaries (if supported by Tcl itself). + * + * Revision 1.19 1996/08/20 09:27:49 adam * More work on explain. * Renamed tkinit.c to tkmain.c. The tcl shell uses the Tcl 7.5 interface * for socket i/o instead of the handcrafted one (for Tcl 7.3 and Tcl7.4). @@ -39,6 +42,7 @@ int Tcl_AppInit (Tcl_Interp *interp) } #if TCL_MAJOR_VERSION > 7 || (TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION > 4) +/* new version of tcl: version > 7.4 */ extern int matherr (); int *tclDummyMathPtr = (int*) matherr; @@ -49,6 +53,8 @@ int main (int argc, char **argv) } #else +/* old version of tcl: version <= 7.4 */ + static char *fileName = NULL; extern int main (); int *tclDummyMainPtr = (int*) main; -- 1.7.10.4