On 08/09/2014 08:01 PM, Hidetoshi NAGAI wrote:
> Hi,
>
> From: Joel VanderWerf <joelvanderwerf / gmail.com>
> Subject: building ext/tk on Ubuntu 14.04
> Date: Sat, 09 Aug 2014 15:34:42 -0700
> Message-ID: <53E6A202.7050106 / gmail.com>
>
>> I don't know why the packaged tk8.5 doesn't work, even with all
>> relevant CONFIGURE_ARGS set for extconf.rb.
>
> Would you try to give proper options for tcltklib decribed in
> "ext/tk/README.tcltklib" ?
> tcltklib.so should be compiled, when extconf.rb finds proper
> tclConfig.sh/tkConfig.sh by auto or configure options.
> If multiple versions of Tcl/Tk on your environment, please teach
> the proper files by configure options.
>
> When you fail to compile even if give enough options,
> please report messages and logs.

Here's what I tried first:

cd ext/tk && make distclean && 
CONFIGURE_ARGS='--with-tcl-include=/usr/include/tcl8.5 
--with-tcllib=tcl8.5 --with-tklib=tk8.5' ruby extconf.rb

This used to work for me a few years ago (ubuntu 12.04 and ruby 2.0, 
IIRC). (Building tkutil the same way.)

After doing this, `ldd *.so` says that libtk8.6.so is a dependency, and 
the examples segfault, probably as expected. In the makefile, I noticed 
"-ltk", which should have been "-ltk8.5".

I tried more options:

CONFIGURE_ARGS='--with-tcl-include=/usr/include/tcl8.5 
--with-tcllib=tcl8.5 --with-tklib=tk8.5 --with-tcltkversion=8.5 
--with-tk-include=/usr/include/tcl8.5 
--with-tcl-lib=/usr/lib/x86_64-linux-gnu/ 
--with-tk-lib=/usr/lib/x86_64-linux-gnu/ 
--with-tclConfig-file=/usr/lib/tcl8.5/tclConfig.sh 
--with-tkConfig-file=/usr/lib/tk8.5/tkConfig.sh'

I also removed the 8.6 installation. IIRC, this got me to the point of 
correctly linking with 8.5, but then there was something else... IIRC it 
was the warning that pthreads should be enabled in both or disabled in 
both. Anyway, I wanted to keep 8.6 because some other packages depend on 
it. So I gave up and built from source.