TclTKAqua8.5.2 with ruby-tk on 10.3.9

View: New views
7 Messages — Rating Filter:   Alert me  

TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Ryutaro Amano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all. I am Ryutaro Amano.

I installed TclTkAqua-8.5.2 on 10.3.9 (PowerPCMac, XCode1.5,  
november2004gccupdater_7k579).

And I installed ruby-1.8.7-p22.
extconf.rb of ruby-1.8.7-p22/ext/tk/extconf.rb can't find header files  
of tcltk.
patch
------------------------------------------------------------------
--- extconf.rb (revision 17422)
+++ extconf.rb (working copy)
@@ -378,11 +378,11 @@

tclver, tkver = check_tcltk_version(tcltk_version)

-if have_header("tcl.h") && have_header("tk.h") &&
-    ( tcltk_framework ||
-        ( ( !use_X || find_X11(x11_ldir2, x11_ldir) ) &&
-            find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) &&
-            find_tk(tklib, stubs, tkver, *tk_ldir_list) ) )
+if ( tcltk_framework ||
+       ( have_header("tcl.h") && have_header("tk.h") &&
+           ( !use_X || find_X11(x11_ldir2, x11_ldir) ) &&
+           find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) &&
+           find_tk(tklib, stubs, tkver, *tk_ldir_list) ) )
   $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
   $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
-----------------------------------------------------------------------

./configure --enable-shared --enable-pthread --enable-tcltk-framework
make

compiling tk
*****************************************************************************
**
** PTHREAD SUPPORT MODE WARNING:
**
**   Ruby is compiled with --enable-pthread, but your Tcl/Tk library
**   seems to be compiled without pthread support. Although you can
**   create the tcltklib library, this combination may cause errors
**   (e.g. hangs or segmentation faults). If you have no reason to
**   keep the current pthread support status, we recommend you  
reconfigure
**   and recompile the libraries so that both or neither support  
pthreads.
**
**   If you want change the status of pthread support, please recompile
**   Ruby without "--enable-pthread" configure option or recompile Tcl/
Tk
**   with "--enable-threads" configure option (if your Tcl/Tk is later
**   than or equal to Tcl/Tk 8.1).
**
*****************************************************************************
gcc -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_TCL_H -DHAVE_TK_H -
DHAVE_RB_HASH_LOOKUP -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=
\"2008-06-20\"  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Library/
Frameworks/Tcl.framework/Headers -I/Library/Frameworks/Tk.framework/
Headers -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2  -fno-common -
pipe -fno-common   -c stubs.c
gcc -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_TCL_H -DHAVE_TK_H -
DHAVE_RB_HASH_LOOKUP -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=
\"2008-06-20\"  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Library/
Frameworks/Tcl.framework/Headers -I/Library/Frameworks/Tk.framework/
Headers -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2  -fno-common -
pipe -fno-common   -c tcltklib.c
cc -dynamic -bundle -undefined suppress -flat_namespace -o ../../.ext/
powerpc-darwin7.9.0/tcltklib.bundle stubs.o tcltklib.o -L. -L../.. -
L.  -framework Tk -framework Tcl    -lruby -ldl  -lpthread -ldl -lobjc
ld: Undefined symbols:
_copyfile referenced from Tcl expected to be defined in libSystem
_OSSpinLockLock referenced from Tcl expected to be defined in libSystem
_OSSpinLockTry referenced from Tcl expected to be defined in libSystem
_OSSpinLockUnlock referenced from Tcl expected to be defined in  
libSystem
_pthread_atfork referenced from Tcl expected to be defined in libSystem
_HIThemeSetFill referenced from Tk expected to be defined in Carbon
_HIThemeSetStroke referenced from Tk expected to be defined in Carbon
_HIThemeSetTextFill referenced from Tk expected to be defined in Carbon
_CGContextFillEllipseInRect referenced from Tk expected to be defined  
in Carbon
_CGContextStrokeEllipseInRect referenced from Tk expected to be  
defined in Carbon
_HIShapeCreateEmpty referenced from Tk expected to be defined in Carbon
_HIShapeIntersectsRect referenced from Tk expected to be defined in  
Carbon
_HIWindowGetProxyFSRef referenced from Tk expected to be defined in  
Carbon
_HIWindowSetProxyFSRef referenced from Tk expected to be defined in  
Carbon
make[1]: *** [../../.ext/powerpc-darwin7.9.0/tcltklib.bundle] Error 1
make: *** [all] Error 1

I removed  TclTkAqua-8.5.2 and installed tcltk-8.5.2 from source.

tcl-8.5.2
cd macosx
./configure --enable-threads --enable-shared --enable-framework
make
sudo make install

tk-8.5.2
cd macosx
./configure --enable-threads --enable-shared --enable-aqua --enable-
framework
make
sudo make install

ruby-1.8.7-p22

./configure --enable-shared --enable-pthread --enable-tcltk-framework
make (no error)
sudo make install

Widget of riby-tk works fine.

On 10.4.11 or 10.5.3, TclTkAqua-8.5.2 has no problem with ruby-tk.

What's wrong on 10.3.9 ?

Ryutaro Amano
wn9r-amn@...



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Daniel A. Steffen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ryutaro,

On 28/06/2008, at 6:11, Ryutaro Amano wrote:

> I installed TclTkAqua-8.5.2 on 10.3.9 (PowerPCMac, XCode1.5,  
> november2004gccupdater_7k579).

is this a TclTkAqua distro you got from my site (i.e. http://www.categorifiedcoder.info/tcltk/ 
  ), or where does your TclTkAqua-8.5.2 come from?

> ld: Undefined symbols:
> _copyfile referenced from Tcl expected to be defined in libSystem
...
> _HIThemeSetFill referenced from Tk expected to be defined in Carbon


these are all symbols that are available on 10.4 and later only. I  
build the TclTkAqua distros on 10.4 with  
MACOSX_DEPLOYMENT_TARGET=10.3, which should ensure that those symbols  
are weak-linked so that the binary can also run on 10.3.

you can check if weak-linking is in effect in your binary with nm,  
with the 10.5.3-rc0 distro I get:

        $ nm -m /Library/Frameworks/Tk.framework/Tk | fgrep HIThemeSetFill
                 (undefined) weak external _HIThemeSetFill (from Carbon)

note the 'weak'. Can you confirm you see the same?

if not, you have a distro that requires 10.4.

if yes, try setting the MACOSX_DEPLOYMENT_TARGET env var to 10.3 when  
you build ruby (if unset it defaults to 10.2), that may be required to  
make the weak-linking effective.

> On 10.4.11 or 10.5.3, TclTkAqua-8.5.2 has no problem with ruby-tk.
>
> What's wrong on 10.3.9 ?

have you tried running Wish from that distro directly on 10.3, do you  
get errors there as well?

Unfortunately I no longer have access to a 10.3.9 system for testing,  
so it is possible that the 10.3 compatibility of the distros is  
broken...

Cheers,

Daniel

--
** Daniel A. Steffen                   **
** <mailto:das@...>  **



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Ryutaro Amano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Daniel,


I have downloaded 8.5.2 from "http://rutherglen.ics.mq.edu.au/~steffen/tcltk/TclTkAqua-8.5.2.dmg 
".

I installed 8.5.3-rc0 downloaded from http://www.categorifiedcoder.info/tcltk/ 
.

nm -m /Library/Frameworks/Tk.framework/Tk | fgrep HIThemeSetFill
(undefined) weak external _HIThemeSetFill (from Carbon)

I installed ruby.

export MACOSX_DEPLOYMENT_TARGET=10.3

./configure --enable-shared --enable-pthread --enable-tcltk-framework
make

But, the same error.


Ryutaro Amano
wn9r-amn@...



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Daniel A. Steffen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ryutaro,

On 28/06/2008, at 17:37, Ryutaro Amano wrote:

> I have downloaded 8.5.2 from "http://rutherglen.ics.mq.edu.au/~steffen/tcltk/TclTkAqua-8.5.2.dmg

> I installed 8.5.3-rc0 downloaded from http://www.categorifiedcoder.info/tcltk/

ah good, that is actually the same place now, the first redirects to  
the second...

> nm -m /Library/Frameworks/Tk.framework/Tk | fgrep HIThemeSetFill
> (undefined) weak external _HIThemeSetFill (from Carbon)

can you check if Wish actually works on 10.3.9 ? e.g. try to run
        /Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish

if it does, the only other thing I can think of is that the -
flat_namespace option passed at tcltklib.bundle link time is at fault,  
my guess is that it is not really needed and might cause problems, can  
you try removing it?

> cc -dynamic -bundle -undefined suppress -flat_namespace -o ../../.ext/
> powerpc-darwin7.9.0/tcltklib.bundle stubs.o tcltklib.o -L. -L../.. -
> L.  -framework Tk -framework Tcl    -lruby -ldl  -lpthread -ldl -lobjc

if that does not help, I am stumped, you could try adding/removing  
other linker options, c.f. 'man ld', the linker debug options might  
also help you figure out why the weak linking is being ignored .

Cheers,

Daniel

--
** Daniel A. Steffen                   **
** <mailto:das@...>  **



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Ryutaro Amano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Daniel,

can you check if Wish actually works on 10.3.9 ? e.g. try to run
/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish

It works fine.

if it does, the only other thing I can think of is that the -flat_namespace option passed at tcltklib.bundle link time is at fault, my guess is that it is not really needed and might cause problems, can you try removing it?

How remove it ?

Removing it from Makefile occurs error when making

-----------------------------------------------------------------------------------------------
make

rbconfig.rb updated
cc -dynamiclib -undefined suppress -install_name /usr/local/lib/libruby.dylib -current_version 1.8.7 -compatibility_version 1.8   array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o alloca.o dmyext.o  -o libruby.1.8.7.dylib
ld: -undefined error or -undefined define_a_way must be used when -twolevel_namespace is in effect
/usr/bin/libtool: internal link edit command failed
make: *** [libruby.1.8.7.dylib] Error 1
-------------------------------------------------------------------------------------------------

I installed TclTkAqua-8.4.10.0

$ nm -m /Library/Frameworks/Tk.framework/Tk | fgrep HIThemeSetFill
[19:41:59 ryutaro:~]
$

I installed ruby

./configure --enable-shared --enable-pthread --enable-tcltk-framework
make

no errors
sudo make install

TclTkAqua-8.4.15-preview

$ nm -m /Library/Frameworks/Tk.framework/Tk | fgrep HIThemeSetFill
             (undefined) weak external _HIThemeSetFill (from Carbon)

I installed ruby

./configure --enable-shared --enable-pthread --enable-tcltk-framework
make

the same error

What's diffrenece 8.4.10.0 and 8.4.15-preview ?


Ryutaro Amano



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Daniel A. Steffen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 29/06/2008, at 12:49, Ryutaro Amano wrote:

>> if it does, the only other thing I can think of is that the -
>> flat_namespace option passed at tcltklib.bundle link time is at  
>> fault, my guess is that it is not really needed and might cause  
>> problems, can you try removing it?
>
> How remove it ?

I don't know anything about the ruby buildsystem, from whatever  
generates the Makefile would be best, but from the Makefile directly  
should work for the purposes of experimentation. You could also just  
execute the failing 'cc -dynamic -bundle ...' link line for  
tcltklib.bundle manually and vary the linker options until you find  
something that works...

> Removing it from Makefile occurs error when making
>
> -----------------------------------------------------------------------------------------------
> make
>
> rbconfig.rb updated
> cc -dynamiclib -undefined suppress -install_name /usr/local/lib/
> libruby.dylib -current_version 1.8.7 -compatibility_version 1.8    
> array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o  
> error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o  
> numeric.o object.o pack.o parse.o process.o prec.o random.o range.o  
> re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o  
> util.o variable.o version.o alloca.o dmyext.o  -o libruby.1.8.7.dylib
> ld: -undefined error or -undefined define_a_way must be used when -
> twolevel_namespace is in effect

as the error says, you also need to remove the '-undefined suppress'  
option...
>

> What's diffrenece 8.4.10.0 and 8.4.15-preview ?

AFAIR (both of these were built quite a long time ago...)

8.4.10 is powerpc only and was built on 10.3 with a 10.2 deployment  
target

8.4.15 is universal and was built on 10.4 with a 10.3 deployment target

also, 8.4.10 probably did not yet use some of the 10.4-only symbols  
that cause problems for you

Cheers,

Daniel

--
** Daniel A. Steffen                   **
** <mailto:das@...>  **



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: TclTKAqua8.5.2 with ruby-tk on 10.3.9

by Ryutaro Amano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Daniel

I remove also '-undefined suppress' option, but the same error.

Another problem.
After installing TclTkAqua-8.5.2 on 10.5.3, I installed ruby-1.9.0-2.

Ruby-tk program causes on PowerPC Mac.

--------------------------------------------------------------------
Tk_MacOSXSetupTkNotifier: first [load] of TkAqua has to occur in the main thread!
Abort trap
--------------------------------------

Intel mac user has no problem on 10.5.3.
Du you have any idea about difference PowerPC Mac and Intel mac ?

Ryutaro Amano



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac
LightInTheBox - Buy quality products at wholesale price