Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Feb 2009 14:56:21 +0100
From:      =?ISO-8859-1?Q?S=E9bastien_Santoro?= <dereckson@espace-win.org>
To:        starkit@googlegroups.com, freebsd-ports@freebsd.org
Cc:        mm@freebsd.org
Subject:   metakit doesn't compile with TCL8.6 + solution to fix it
Message-ID:  <5ea6cb100902070556w7592703euae7432fcfdafbb6@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--0015174c16de9fd076046254806a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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 resul=
t. */
#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 statical=
ly
                                 * allocated. TCL_DYNAMIC means it was
                                 * allocated with ckalloc and should be fre=
ed
                                 * with ckfree. Other values give the addre=
ss
                                 * of function to invoke to free the result=
.
                                 * Tcl_Eval must free it before executing n=
ext
                                 * command. */
#else
    char* unused3;
    void (*unused4) (char*);
#endif
#ifdef USE_INTERP_ERRORLINE
    int errorLine;              /* When TCL_ERROR is returned, this gives t=
he
                                 * line number within the command where the
                                 * error occurred (1 if first line). */
#else
    int unused5;
#endif
} Tcl_Interp;

THIRD PROBLEM
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

/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
root@localhost.localdomain:/usr/obj/usr/src/sys/OVH7  amd64

/usr/ports/databases/metakit ] make
=3D=3D=3D>  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.

--=20
S=E9bastien Santoro aka Dereckson

--0015174c16de9fd076046254806a
Content-Type: application/octet-stream; name="metakit-const-Tcl_Obj.patch"
Content-Disposition: attachment; filename="metakit-const-Tcl_Obj.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fqwc3uz70

LS0tIG1rNHRjbC5jcHAgIDIwMDctMDYtMTggMjE6MDU6MjQuMDAwMDAwMDAwICswMDAwDQorKysg
bWs0dGNsLmNwcCAgMjAwOS0wMi0wNyAxMzozNDowOC4wMDAwMDAwMDAgKzAwMDANCkBAIC05Nzks
NyArOTc5LDcgQEANCiAgIHZvaWQgKnRhZyA9ICgmdmlld19bMF0pLl9zZXE7IC8vIGhvcnJpZmlj
IGhhY2sgdG8gZ2V0IGF0IGM0X1NlcXVlbmNlIHBvaW50ZXINCiAgIGlmIChvYmpQdHItPnR5cGVQ
dHIgIT0gICZta1Byb3BlcnR5VHlwZSB8fCBvYmpQdHINCiAgICAgLT5pbnRlcm5hbFJlcC50d29Q
dHJWYWx1ZS5wdHIxICE9IHRhZykgew0KLSAgICBUY2xfT2JqVHlwZSAqb2xkVHlwZVB0ciA9IG9i
alB0ci0+dHlwZVB0cjsNCisgICAgY29uc3QgVGNsX09ialR5cGUgKm9sZFR5cGVQdHIgPSBvYmpQ
dHItPnR5cGVQdHI7DQoNCiAgICAgY2hhciB0eXBlID0gJ1MnOw0KDQpAQCAtMTA4Myw3ICsxMDgz
LDcgQEANCiAgIH0NCg0KICAgaWYgKG9ialB0ci0+dHlwZVB0ciAhPSAgJm1rQ3Vyc29yVHlwZSkg
ew0KLSAgICBUY2xfT2JqVHlwZSAqb2xkVHlwZVB0ciA9IG9ialB0ci0+dHlwZVB0cjsNCisgICAg
Y29uc3QgVGNsX09ialR5cGUgKm9sZFR5cGVQdHIgPSBvYmpQdHItPnR5cGVQdHI7DQoNCiAgICAg
Y29uc3QgY2hhciAqc3RyaW5nID0gVGNsX0dldFN0cmluZ0Zyb21PYmoob2JqUHRyLCAwKTsNCg0K
--0015174c16de9fd076046254806a--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ea6cb100902070556w7592703euae7432fcfdafbb6>