Skip to content

Commit fdff3af

Browse files
Make EcoLab buildable without TCL being present.
1 parent b4ff5c2 commit fdff3af

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

include/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ endif
498498
ifdef TK
499499
FLAGS+=-DTK
500500
endif
501+
ifdef TCL
502+
FLAGS+=-DTCL
503+
endif
501504

502505
# this conditional ensure TCL is present before doing this stuff, as
503506
# otherwise Make hangs

src/analysis.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "plot.h"
1919
#endif
2020

21+
#ifdef TCL
2122
#include "tcl++.h"
23+
#endif
2224

2325
#include <fstream>
2426
#include <sstream>
@@ -40,7 +42,7 @@ int palette_class::size=0;
4042

4143
palette_class::palette_class()
4244
{
43-
Tcl_Size elemc;
45+
// Tcl_Size elemc;
4446

4547
if (size==0)
4648
{

src/ecolab.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
Open source licensed under the MIT license. See LICENSE for details.
77
*/
88

9+
#ifdef TCL
910
#include "tcl++.h"
10-
#define TK 1
11+
#endif
1112
#undef None
1213
#include "cairoSurfaceImage.h"
1314
#undef None
@@ -87,8 +88,10 @@ void* ecolab::reallocSycl(void* pp,size_t s)
8788

8889
namespace ecolab
8990
{
91+
#ifdef TCL
9092
bool interpExiting=false;
9193
void interpExitProc(ClientData cd) {}
94+
#endif
9295

9396
#ifdef MPI_SUPPORT
9497
unsigned myid() {return graphcode::myid();}
@@ -99,13 +102,15 @@ namespace ecolab
99102
#endif
100103

101104

105+
#ifdef TCL
102106
const char* TCL_args::str()
103107
#if (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION==0)
104108
{return Tcl_GetStringFromObj(pop_arg(),NULL);}
105109
#else
106110
{return Tcl_GetString(pop_arg());}
107111
#endif
108-
112+
#endif
113+
109114
int addEcoLabPath()
110115
{
111116
if (Py_IsInitialized())
@@ -246,7 +251,7 @@ namespace ecolab
246251

247252
CLASSDESC_PYTHON_MODULE(ecolab);
248253

249-
254+
#ifdef TCL
250255
// place for initialising any EcoLab extensions to the TCL
251256
// interpreter, to be called by tkinter's Tk() object
252257
extern "C" int Ecolab_Init(Tcl_Interp* interp)
@@ -257,4 +262,4 @@ extern "C" int Ecolab_Init(Tcl_Interp* interp)
257262

258263
// some linkers add an _
259264
extern "C" int _Ecolab_Init(Tcl_Interp* interp) {return Ecolab_Init(interp);}
260-
265+
#endif

0 commit comments

Comments
 (0)