Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace outdated convenience copy of Tcl with system provided one #14

Merged
merged 4 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ addons:
- libxmu-dev
- libxpm-dev
- xaw3dg-dev
- tcl-dev
- iraf-dev
- xauth
- xvfb
Expand Down
2 changes: 1 addition & 1 deletion X11IRAF.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

/* Libraries: */
#ifndef LibObm
#define LibObm -lobm
#define LibObm -lobm -ltcl
#endif
#ifndef LibXpm
#define LibXpm -lXpm
Expand Down
7 changes: 3 additions & 4 deletions obm/Imakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ X11IRAFDIR = ../
ARADD = ar rul
#endif

LIBDIRS = Tcl ObmW
LIBDIRS = ObmW
SUBDIRS = $(LIBDIRS)

HEADERS = Obm.h ObmP.h widget.h
SRCS = Obm.c client.c param.c server.c widget.c gterm.c marker.c \
html.c geom.c
OBJS = Obm.o client.o param.o server.o widget.o gterm.o marker.o \
html.o geom.o
ALL_OBJS = Tcl/[A-Za-z]*.o ObmW/[A-Za-z]*.o $(OBJS)
ALL_DONE = Tcl/DONE ObmW/DONE
ALL_OBJS = ObmW/[A-Za-z]*.o $(OBJS)
ALL_DONE = ObmW/DONE
RESOBJ = obmres.o

all:: libobm.a
Expand All @@ -48,7 +48,6 @@ World:

libobm.a: $(LIBDIRS) $(ALL_DONE) $(OBJS)
$(RM) $@
@(cd Tcl; $(MAKE) $(MFLAGS) all X11IRAFDIR=../../)
@(cd ObmW; $(MAKE) $(MFLAGS) all X11IRAFDIR=../../)
$(AR) $@ $(OBJS)
$(ARADD) $@ $(ALL_OBJS)
Expand Down
34 changes: 30 additions & 4 deletions obm/Obm.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@
static void obm_call_activate_callbacks();


#if (TCL_MAJOR_VERSION < 8)
#error Tcl 8 or higher is required
#endif

/* Backward compatibility patch for errorLine access. These functions were
* introduced only in Tcl 8.6, and direct access to errorLine is deprecated
* since then.
*/
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
char *
Tcl_GetErrorLine(tcl)
Tcl_Interp *tcl;
{
return tcl->errorLine;
}

void
Tcl_SetErrorLine(tcl, s)
Tcl_Interp *tcl;
char *s;
{
tcl->errorLine = s;
}
#endif


/* ObmOpen -- Open the object manager.
*/
ObmContext
Expand Down Expand Up @@ -377,8 +403,8 @@ int state;
if (status != TCL_OK) {
char *errstr = Tcl_GetVar (obm->tcl, "errorInfo", 0);
fprintf (stderr, "Error on line %d in activate: %s\n",
obm->tcl->errorLine,
errstr ? errstr : obm->tcl->result);
Tcl_GetErrorLine (obm->tcl),
errstr ? errstr : Tcl_GetStringResult (obm->tcl));
}
}
}
Expand Down Expand Up @@ -458,8 +484,8 @@ char *message;
if (status != TCL_OK) {
char *errstr = Tcl_GetVar (obm->tcl, "errorInfo", 0);
fprintf (stderr, "Error in message to %s, line %d: %s\n",
object, obm->tcl->errorLine,
errstr ? errstr : obm->tcl->result);
object, Tcl_GetErrorLine (obm->tcl),
errstr ? errstr : Tcl_GetStringResult (obm->tcl));
}
} else
status = TCL_OK;
Expand Down
2 changes: 1 addition & 1 deletion obm/ObmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#include <X11/Xraw/Table.h>

#include <X11/xpm.h>
#include <Tcl/tcl.h>
#include <tcl/tcl.h>

/* Size limiting definitions. */
#define SZ_NAME 128 /* class or object name */
Expand Down
217 changes: 0 additions & 217 deletions obm/Tcl/Imakefile

This file was deleted.

Loading