Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

metakit doesn't compile with TCL8.6 + solution to fix it

0 views
Skip to first unread message

Sébastien Santoro

unread,
Feb 7, 2009, 8:56:21 AM2/7/09
to sta...@googlegroups.com, freebs...@freebsd.org, m...@freebsd.org
Hi,

Metakit port doesn't compile with TCL 8.6 (port lang/tcl86-threads
package tcl-threads-8.6.b.1) .

It should, as http://wiki.tcl.tk/15781 specifies Wub requires TCL 8.6
to run WubWikit, built on the top of Mk.

3 things are to modify. After that, that compiles fine and passes the
make test (strangely, you have to make install before make test to
allow him to find libraries)

The FreeBSD port compilation output is at the end of the mail.

FIRST PROBLEM - STUBS
=====================

To fix the problem, USE_TCL_STUBS should be defined at 0 but mk4tcl.h
defines it auto at 1 if PIC is defined. I didn't investigate on the
PIC define.

So to compile it:
(1) In builds/Makefile, removes -DUSE_TCL_STUBS
(2) a patch to ask mk4tcl.h not to define USE_TCL_STUBS

SECOND PROBLEM - Tcl_Interp struct errorLine member
=============================================

errorLine isn't enabled anymore by default.

USE_INTERP_ERRORLINE must be defined.

FIX : add -DUSE_INTERP_ERRORLINE in Makefile

typedef struct Tcl_Interp {
/* TIP #330: Strongly discourage extensions from using the string result. */
#ifdef USE_INTERP_RESULT
char *result; /* If the last command returned a string
* result, this points to it. */
void (*freeProc) (char *blockPtr);
/* Zero means the string result is statically
* allocated. TCL_DYNAMIC means it was
* allocated with ckalloc and should be freed
* with ckfree. Other values give the address
* of function to invoke to free the result.
* Tcl_Eval must free it before executing next
* command. */
#else
char* unused3;
void (*unused4) (char*);
#endif
#ifdef USE_INTERP_ERRORLINE
int errorLine; /* When TCL_ERROR is returned, this gives the
* line number within the command where the
* error occurred (1 if first line). */
#else
int unused5;
#endif
} Tcl_Interp;

THIRD PROBLEM
==============

g++ -c -g -O2 -fPIC -I../unix/../include
-I/usr/local/include/tcl8.6/generic -I/usr/local/include/tcl8.6
-DUSE_INTERP_ERRORLINE ../unix/../tcl/mk4tcl.cpp
../unix/../tcl/mk4tcl.cpp: In function 'const c4_Property&
AsProperty(Tcl_Obj*, const c4_View&)':
../unix/../tcl/mk4tcl.cpp:982: error: invalid conversion from 'const
Tcl_ObjType*' to 'Tcl_ObjType*'
../unix/../tcl/mk4tcl.cpp: In function 'int
SetCursorFromAny(Tcl_Interp*, Tcl_Obj*)':
../unix/../tcl/mk4tcl.cpp:1086: error: invalid conversion from 'const
Tcl_ObjType*' to 'Tcl_ObjType*'

Indeed, in tcl.h, *typePtr is a constant:

typedef struct Tcl_Obj {
const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
* corresponds to the type of the object's
* internal rep. NULL indicates the object has
* no internal rep (has no type). */

}

Solution: at lines 982 and 1086, declares the types as const Tcl_ObjType*

Cf. patch

PORT MAKE OUTPUT
=================

/usr/ports/databases/metakit ] uname -a
FreeBSD daventry.espace-win.org 7.0-RELEASE FreeBSD 7.0-RELEASE #0:
Wed May 21 10:13:51 UTC 2008
ro...@localhost.localdomain:/usr/obj/usr/src/sys/OVH7 amd64

/usr/ports/databases/metakit ] make
===> Building for metakit-2.4.9.7
c++ -c -O2 -fno-strict-aliasing -pipe -fPIC -DUSE_TCL_STUBS
-I./../unix/../include -I/usr/local/include/tcl8.6/generic
-I/usr/local/include/tcl8.6 ./../unix/../tcl/mk4tcl.cpp
In file included from ./../unix/../tcl/mk4tcl.cpp:26:
./../unix/../tcl/stubtcl.h:3: error: conflicting declaration
'TclStubs* tclStubsPtr'
/usr/local/include/tcl8.6/generic/tclDecls.h:4465: error:
'tclStubsPtr' has a previous declaration as 'const TclStubs*
tclStubsPtr'
./../unix/../tcl/stubtcl.h:4: error: conflicting declaration
'TclPlatStubs* tclPlatStubsPtr'
/usr/local/include/tcl8.6/generic/tclPlatDecls.h:98: error:
'tclPlatStubsPtr' has a previous declaration as 'const TclPlatStubs*
tclPlatStubsPtr'
./../unix/../tcl/stubtcl.h: In function 'int MyInitStubs(Tcl_Interp*)':
./../unix/../tcl/stubtcl.h:19: error: 'struct Tcl_Interp' has no
member named 'result'
./../unix/../tcl/stubtcl.h:20: error: 'struct Tcl_Interp' has no
member named 'freeProc'
./../unix/../tcl/stubtcl.h:33: error: invalid conversion from 'const
TclIntStubs* const' to 'TclIntStubs*'
./../unix/../tcl/stubtcl.h:34: error: invalid conversion from 'const
TclIntPlatStubs* const' to 'TclIntPlatStubs*'
./../unix/../tcl/mk4tcl.cpp: In function 'const c4_Property&
AsProperty(Tcl_Obj*, const c4_View&)':
./../unix/../tcl/mk4tcl.cpp:982: error: invalid conversion from 'const
Tcl_ObjType*' to 'Tcl_ObjType*'
./../unix/../tcl/mk4tcl.cpp: In function 'int
SetCursorFromAny(Tcl_Interp*, Tcl_Obj*)':
./../unix/../tcl/mk4tcl.cpp:1086: error: invalid conversion from
'const Tcl_ObjType*' to 'Tcl_ObjType*'
./../unix/../tcl/mk4tcl.cpp: In member function 'int MkTcl::LoopCmd()':
./../unix/../tcl/mk4tcl.cpp:2159: error: 'struct Tcl_Interp' has no
member named 'errorLine'
*** Error code 1

Stop in /usr/ports/databases/metakit/work/metakit-2.4.9.7/builds.
*** Error code 1

Stop in /usr/ports/databases/metakit.
*** Error code 1

Stop in /usr/ports/databases/metakit.

--
Sébastien Santoro aka Dereckson

metakit-const-Tcl_Obj.patch

Sébastien Santoro

unread,
Feb 7, 2009, 10:58:46 AM2/7/09
to starkit, freebs...@freebsd.org, j...@equi4.com, m...@freebsd.org
I confirm the last SVN version compiles fine.

The last stable version published on
http://www.equi4.com/metakit/overview.html is the 2.4.9.7 version,
released the 2007-06-23.

( Speaking of SVN, CHANGES haven't updated since this date. )

TCL 8.6 is in beta stage, with release date planned for March.

> ---------- Forwarded message ----------
> From: Pat Thoyts <patt...@googlemail.com>
> Date: 2009/2/7
> Subject: Re: [starkit] metakit doesn't compile with TCL8.6 + solution to fix it
> To: Sébastien Santoro <dere...@espace-win.org>
>
> This is fixed already in the metakit subversion repository. It is not
> clear where you got your copy of the source from but this is a problem
> for either the FreeBSD port contact to fetch the latest version or
> possibly for the upstream maintainer (jcw) to produce another release
> tarball that includes the fixes currently on the HEAD version. It may
> be that if a metakit release will only be because of 8.6 changes that
> he will wait until 8.6 becomes final before making such a release.
>
> In case you are unaware, the subversion repository for metakit is
> currently svn://svn.equi4.com/metakit/trunk
>
> Pat Thoyts

Jean-Claude Wippler

unread,
Feb 10, 2009, 3:39:27 AM2/10/09
to Sébastien Santoro, starkit, m...@freebsd.org, freebs...@freebsd.org
On 7 Feb 2009, at 16:58, Sébastien Santoro wrote:

> I confirm the last SVN version compiles fine.

Great!

> The last stable version published on
> http://www.equi4.com/metakit/overview.html is the 2.4.9.7 version,
> released the 2007-06-23.
>
> ( Speaking of SVN, CHANGES haven't updated since this date. )

Thanks, I've just updated it.

> TCL 8.6 is in beta stage, with release date planned for March.

Yes, would be a good idea to have a packaged release in time for that.
I've made a note, but if I forget - could someone please help remind
me to do this before the Tcl 8.6 release?

-jcw


0 new messages