Building Mk4py 2.01 on Unix

The 2.01 release of Metakit has a few problems, which show up when building the Python interface on Unix.

First of all, get the latest version of 'configure':

    https://www.equi4.com/previews/configure
    https://www.equi4.com/previews/configure.in

These supercede the version in the unix/ directory, and remove a dependency on Tcl.

Second, if your Python headers are in in /usr/include, but you are installing in /usr/local/, then apply the following patch, either to the Makefile after configuration, or to Makefile.in before that:

 *** Makefile   Wed Jul  5 12:22:44 2000
 --- Makefile.orig      Wed Jul  5 12:28:52 2000
 ***************
 *** 49,55 ****
   CXX_SWITCHES_TCL  = $(CXXFLAGS) -I../include -I../../include \
                         -I$(TCL_BIN_DIR)/../generic -DUSE_TCL_STUBS
   CXX_SWITCHES_PY   = $(CXXFLAGS) -I../include -I../python/scxx \
 !                      -I/usr/include/python1.5
   #---------- The targets normally specified when calling "make"
 --- 49,55 ----
   CXX_SWITCHES_TCL  = $(CXXFLAGS) -I../include -I../../include \
                         -I$(TCL_BIN_DIR)/../generic -DUSE_TCL_STUBS
   CXX_SWITCHES_PY   = $(CXXFLAGS) -I../include -I../python/scxx \
 !                      -I$(includedir)/python1.5
   #---------- The targets normally specified when calling "make"

Lastly, there are some const initialization problem in PyView.cpp which gcc 2.95 rejects (rightly so). To fix them, apply the following patch to python/PyView.cpp:

 *** PyView.cpp Wed Jul  5 12:27:27 2000
 --- PyView.cpp.orig    Tue Mar 14 11:49:56 2000
 ***************
 *** 959,966 ****
         PWOTuple tmp(1);
         for (int i=0; i<GetSize(); ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(i));
 !              PWOBase r2 (row);
 !              tmp.setItem(0,r2);
                 func.call(tmp);
                 Py_DECREF(row);
         }
 --- 959,965 ----
         PWOTuple tmp(1);
         for (int i=0; i<GetSize(); ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(i));
 !              tmp.setItem(0,PWOBase(row));
                 func.call(tmp);
                 Py_DECREF(row);
         }
 ***************
 *** 970,977 ****
         PWOTuple tmp(1);
         for (int i=0; i<sz; ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(GetIndexOf(subset.GetAt(i)))
 !              PWOBase r2 (row);
 !              tmp.setItem(0,r2);
                 func.call(tmp);
                 Py_DECREF(row);
         }
 --- 969,975 ----
         PWOTuple tmp(1);
         for (int i=0; i<sz; ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(GetIndexOf(subset.GetAt(i)))
 !              tmp.setItem(0,PWOBase(row));
                 func.call(tmp);
                 Py_DECREF(row);
         }
 ***************
 *** 999,1006 ****
         PWOTuple tmp(1);
         for (int i=0; i<GetSize(); ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(i));
 !              PWOBase r2 (row);
 !              tmp.setItem(0,r2);
                 PWOBase rslt(func.call(tmp));
                 if (rslt.isTrue()) {
                         _index(ndx) = i;
 --- 997,1003 ----
         PWOTuple tmp(1);
         for (int i=0; i<GetSize(); ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(i));
 !              tmp.setItem(0,PWOBase(row));
                 PWOBase rslt(func.call(tmp));
                 if (rslt.isTrue()) {
                         _index(ndx) = i;
 ***************
 *** 1015,1022 ****
         PWOTuple tmp(2);
         for (int i=0; i<GetSize(); ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(i));
 !              PWOBase r2 (row);
 !              tmp.setItem(0,r2);
                 tmp.setItem(1,accum);
                 PWOBase rslt(func.call(tmp));
                 accum = rslt;
 --- 1012,1018 ----
         PWOTuple tmp(2);
         for (int i=0; i<GetSize(); ++i) {
                 PyRowRef *row = new PyRowRef(GetAt(i));
 !              tmp.setItem(0,PWOBase(row));
                 tmp.setItem(1,accum);
                 PWOBase rslt(func.call(tmp));
                 accum = rslt;

These above changes have been incorporated in MK 2.3.x, and are therefore no longer an issue with more recent builds.