#1647 Tk accesses Tcl_*StartupScript*() which is private to Tcl

obsolete: 8.5a0
closed-accepted
Don Porter
75. wish (49)
7
2009-01-07
2004-01-11
Francisco Leon
No

DynamicLibrary /Users/espectro/tk/macosx/../../build/tk/
Tk.framework/Versions/8.5/Tk

DynamicLibrary.LinkUsingFileList /Users/espectro/tk/macosx/
../../build/tk/Tk.framework/Versions/8.5/Tk
/usr/bin/gcc-3.3 -o /Users/espectro/tk/macosx/../../
build/tk/Tk.framework/Versions/8.5/Tk "-L/Users/espectro/
tk/macosx/../../build/tk" "-F/Users/espectro/tk/macosx/../
../build/tk" "-F/Users/espectro/tk/macosx/../../build/tcl"
-filelist /Users/espectro/tk/macosx/../../build/tk/
Development.build/Wish.build/TkLibrary.build/Objects-
normal/LinkFileList "-framework" "Tcl" "-framework"
"Carbon" "-framework" "ApplicationServices" "-arch" "ppc"
"-prebind" "-Wl,-single_module" "-dynamiclib" "-
compatibility_version" "8.5" "-current_version" "8.5" "-
seg1addr" "0xb000000" "-prebind" -install_name "`echo "/
Library/Frameworks/Tk.framework/Versions/8.5/Tk" | /usr/
bin/sed 's!//*!/!g'`"
ld: warning prebinding disabled because of undefined
symbols
ld: Undefined symbols:
_TclUtfToUniChar
/usr/bin/libtool: internal link edit command failed
...failed DynamicLibrary.LinkUsingFileList /Users/espectro/tk/
macosx/../../build/tk/Tk.framework/Versions/8.5/Tk ...
** BUILD FAILED **
make: *** [develop] Error 1

8.4.5 compiles fine
Using OSX Panther

BTW, pbxbuild doesn't exist anymore. It's xcodebuild now

Discussion

  • Logged In: YES
    user_id=90580

    This error is due to a missing '#include <tclInt.h>' in tk/generic/
    tkTextIndex.c, as that file uses the TclUtfToUniChar macro from
    tclInt.h. The reason this works on other platforms is that they
    include tclInt.h in their tk*Port.h, but tkMacOSXPort.h doesn't
    (maybe it should?).
    Fix checked into HEAD & core-8-4-branch, c.f. diff below.

    As far as the missing pbxbuild on Panther goes, you can
    workaround this by saying 'make PBXBUILD=xcodebuild'; a fix
    to the Makefile that works on both Jaguar & Panther has been
    checked in.

    Index: generic/tkTextIndex.c

    ==========================
    RCS file: /cvsroot/tktoolkit/tk/generic/tkTextIndex.c,v
    retrieving revision 1.15
    diff -u -p -r1.15 tkTextIndex.c
    --- generic/tkTextIndex.c 13 Jan 2004 02:06:01 -0000 1.15
    +++ generic/tkTextIndex.c 27 Jan 2004 10:06:33 -0000
    @@ -17,6 +17,7 @@
    #include "tkPort.h"
    #include "tkInt.h"
    #include "tkText.h"
    +#include <tclInt.h>

    /*
    * Index to use to select last character in line (very large
    integer):

     
    • status: open --> closed-fixed
     
  • Don Porter
    Don Porter
    2004-01-29

    Logged In: YES
    user_id=80530

    Would be better to fix the broken
    code. We should be weaning
    Tk off of Tcl internals, not adding
    more uses of them.

    Re-open.

     
  • Don Porter
    Don Porter
    2004-01-29

    • assigned_to: das --> vincentdarley
    • labels: 318655 --> 104346
    • milestone: --> obsolete: 8.5a0
    • status: closed-fixed --> open-remind
     
  • Logged In: YES
    user_id=90580

    Donald,
    makes sense, should have looked into that, this was just the
    quickest fix to gets things linking again.
    To prevent such unilateral platform breakage in the future,
    maybe tclInt.h should be removed from tkUnixPort.h/
    tkWinPort.h then ?

     
  • Don Porter
    Don Porter
    2004-01-29

    Logged In: YES
    user_id=80530

    I don't mind this as a temp fix
    in the HEAD. The HEAD should
    compile after all. :)

    Just didn't want to see this closed,
    and accept this as our "final answer".

    Yes, moving the #include of tclInt.h
    out of the tcl*Port.h files and into
    just those tcl*.c files that have
    internal access needs might give us
    a clearer picture of how much
    weaning is left to do.

     
  • Joe English
    Joe English
    2004-01-31

    Logged In: YES
    user_id=68433

    Just removed "#include <tclInt.h>" from tkUnixPort.h and
    only got the following warnings:

    tkUnixEvent.c: In function `TkUnixDoOneXEvent':
    tkUnixEvent.c:473: warning: implicit declaration of function
    `TclpGetTime'
    tkUnixWm.c: In function `WaitForEvent': tkUnixWm.c:4428:
    warning: implicit declaration of function `TclpGetTime'

    These can be replaced with Tcl_GetTime() added by TIP #73 (done)

     
  • Joe English
    Joe English
    2004-01-31

    Logged In: YES
    user_id=68433

    In generic/tkTextIndex.c, TclUtfToUniChar() can be replaced
    with the public interface Tcl_UtfToUniChar().

    The only remaining tclInt.h dependency (on Unix at least) is
    the use of Tcl_GetStartupScript() and Tcl_SetStartupScript()
    in generic/tkMain.c(Tk_MainEx). Those probably aren't even
    necessary -- at the first call to Tcl_GetStartupScript(),
    nothing has happened that could have set the startup script
    *except* when called from macosx/tkMacOSXAppInit.c (or when
    called from a user app that's previously called
    Tcl_SetStartupScript, but that's an internal API so those
    apps get what they deserve). The second time it's called,
    it will either return the same thing as before or the value
    that Tk_MainEx just passed to Tcl_SetStartupScript() itself.

    So if we can disentangle tkMacOSXAppInit, these can probably
    go away too.

     
  • Don Porter
    Don Porter
    2004-02-01

    Logged In: YES
    user_id=80530

    FWIW, the Tcl_*StartupScript*()
    routines have public-looking names
    (even through they are private
    currently) because I expect to
    propose their addition to Tcl's
    public interface for 8.5.

     
  • Vince Darley
    Vince Darley
    2004-02-28

    Logged In: YES
    user_id=32170

    Fixed tkTextIndex.c issue. Only remaining one is
    Tcl_*StartupScript*() according to information below.

     
  • Vince Darley
    Vince Darley
    2004-02-28

    • assigned_to: vincentdarley --> dgp
     
  • Vince Darley
    Vince Darley
    2004-06-03

    • summary: cvs doesn't compile on macosx --> Tk accesses Tcl_StartupScript() which is private to Tcl
     
  • Vince Darley
    Vince Darley
    2004-06-03

    Logged In: YES
    user_id=32170

    Changing summary line to reflect only remaining issues here.

     
  • Don Porter
    Don Porter
    2004-06-03

    • priority: 5 --> 7
     
  • Vince Darley
    Vince Darley
    2005-09-01

    • labels: 104346 --> 75. wish
     
  • Don Porter
    Don Porter
    2009-01-07

    • status: open-remind --> closed-accepted
     
  • Don Porter
    Don Porter
    2009-01-07

    TIP 338 solved this.