Wednesday, July 12, 2017

Building Tcl / Tk

Let's build an updated version of Tcl / Tk.
Solaris 11.3 (GA / Release) packages version 8.5.12.
The packaged seems good enough, but I'm running after the latest.

I won't repeat myself with respect to philosophies and preparations, but refer to another very similar post: Building SQLite. By the way, it's better to build an updated Tcl / Tk before building an updated SQLite.

The ZFS infra-structure is somewhat lengthy as I'm building 2 targets (gnu32 and gnu64) for each version series (8.5.19 and 8.6.6). Note that, in this particular scenario, the -X-gnuNN datasets are clones of their respective X@source.

NOTE
There's a little annoyance as the tarballs' names don't have the usually dash before the version numbers. It takes extra steps to adjust it.
$ DS=.../software
$ zfs list -t all -o name -r $DS/tcl $DS/tk |sed "s,$DS,...,"
NAME
.../tcl
.../tcl/tcl-8.5.19
.../tcl/tcl-8.5.19@source
.../tcl/tcl-8.5.19-gnu32
 
.../tcl/tcl-8.5.19-gnu32@start
.../tcl/tcl-8.5.19-gnu64

.../tcl/tcl-8.5.19-gnu64@start
.../tcl/tcl-8.6.6
.../tcl/tcl-8.6.6@source
.../tcl/tcl-8.6.6-gnu32

.../tcl/tcl-8.6.6-gnu32@start
.../tcl/tcl-8.6.6-gnu64
.../tcl/tcl-8.6.6-gnu64@start
.../tk
.../tk/tk-8.5.19
.../tk/tk-8.5.19@source
.../tk/tk-8.5.19-gnu32

.../tk/tk-8.5.19-gnu32@start
.../tk/tk-8.5.19-gnu64
.../tk/tk-8.5.19-gnu64@start
.../tk/tk-8.6.6
.../tk/tk-8.6.6@source
.../tk/tk-8.6.6-gnu32

.../tk/tk-8.6.6-gnu32@start 
.../tk/tk-8.6.6-gnu64
.../tk/tk-8.6.6-gnu64@start

NOTE
For proper operation of packages requiring Tk in tclsh, the configuration step must specify the same --prefix given during the Tcl configuration. Hence, there's no Tk separate dataset / directory for the build results.

$ DS=rpool/VARSHARE
$ zfs list -t all -o name,mountpoint -r $DS |egrep tcl
rpool/VARSHARE/tcl-8.5.19           /opt/tcl-8.5.19
rpool/VARSHARE/tcl-8.5.19/gnu32     /opt/tcl-8.5.19/gnu32
rpool/VARSHARE/tcl-8.5.19/gnu64     /opt/tcl-8.5.19/gnu64

rpool/VARSHARE/tcl-8.6.6            /opt/tcl-8.6.6
rpool/VARSHARE/tcl-8.6.6/gnu32      /opt/tcl-8.6.6/gnu32
rpool/VARSHARE/tcl-8.6.6/gnu64      /opt/tcl-8.6.6/gnu64


The whole process is simple and follows the GNU style, but this time, the "pitfall" is that first I should build Tcl and then refer to this build results (--with-tcl=) when configuring Tk itself. The building processes take place under each unix subdirectory.

$ DS=.../software

For GNU32:

$ cd ~/software/tcl/tcl-8.5.19-gnu32/unix
 
$ source ../../setenv-tcl-8.5.19 32
CONFIG_SHELL=/bin/bash

CC=/usr/bin/gcc CFLAGS=-m32 -march=core2 -std=gnu89
CXX=/usr/bin/g++ CXXFLAGS=-m32 -march=core2 -std=gnu++03

PATH=/opt/libtool-2.4.6/gnu32/bin:/opt/m4-1.4.18/gnu32/bin:/opt/autoconf-2.69/gnu32/bin:/opt/automake-1.15/gnu32/bin:/usr/gnu/bin:/usr/bin:/usr/sbin
PKG_CONFIG_PATH=

 

$ ./configure \
  --prefix=/opt/tcl-8.5.19/gnu32 \

  --enable-threads \
  --enable-rpath \
  --enable-dtrace 
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ANSI C... none needed
checking for inline... inline
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dirent.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking values.h usability... yes
checking values.h presence... yes
checking for values.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking if the compiler understands -pipe... yes
checking for pthread_mutex_init in -lpthread... yes
checking for pthread_attr_setstacksize... yes
checking for pthread_atfork... yes
checking for pthread_attr_get_np... no
checking for pthread_getattr_np... no
checking for pthread_get_stacksize_np... no
checking for building with threads... yes
checking for sin... no
checking for main in -lieee... no
checking for main in -linet... no
checking net/errno.h usability... no
checking net/errno.h presence... no
checking for net/errno.h... no
checking for connect... no
checking for setsockopt... no
checking for setsockopt in -lsocket... yes
checking for gethostbyname... no
checking for gethostbyname in -lnsl... yes
checking how to build libraries... shared
checking for ranlib... ranlib
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking if compiler supports visibility "hidden"... yes
checking if rpath support is requested... yes
checking system version... SunOS-5.11
checking for dlopen in -ldl... yes
checking for ar... ar
checking for cast to union support... yes
checking for build with symbols... no
checking for required early compiler flags... none
checking for 64-bit integer type... long long
checking for struct dirent64... yes
checking for struct stat64... yes
checking for open64... yes
checking for lseek64... yes
checking for off64_t... yes
checking whether byte ordering is bigendian... no
checking for getcwd... yes
checking for opendir... yes
checking for strtol... yes
checking for waitpid... yes
checking for strerror... yes
checking for getwd... yes
checking for wait3... yes
checking for uname... yes
checking for realpath... yes
checking for getaddrinfo... yes
checking for working getaddrinfo... yes
checking for getpwuid_r... yes
checking for getpwuid_r with 5 args... yes
checking for getpwnam_r... yes
checking for getpwnam_r with 5 args... yes
checking for getgrgid_r... yes
checking for getgrgid_r with 5 args... yes
checking for getgrnam_r... yes
checking for getgrnam_r with 5 args... yes
checking for gethostbyname_r... yes
checking for gethostbyname_r with 6 args... no
checking for gethostbyname_r with 5 args... yes
checking for gethostbyaddr_r... yes
checking for gethostbyaddr_r with 7 args... yes
checking sys/modem.h usability... no
checking sys/modem.h presence... no
checking for sys/modem.h... no
checking termios vs. termio vs. sgtty... termios
checking for fd_set in sys/types... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for gmtime_r... yes
checking for localtime_r... yes
checking for mktime... yes
checking tm_tzadj in struct tm... no
checking tm_gmtoff in struct tm... no
checking long timezone variable... yes
checking for struct stat.st_blocks... yes
checking for struct stat.st_blksize... yes
checking for blkcnt_t... yes
checking for fstatfs... yes
checking for working memcmp... yes
checking for memmove... yes
checking for strstr... yes
checking proper strstr implementation... ok
checking for strtoul... yes
checking proper strtoul implementation... ok
checking for strtod... yes
checking proper strtod implementation... ok
checking for strtod... (cached) yes
checking for Solaris2.4/Tru64 strtod bugs... ok
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for socklen_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for opendir... (cached) yes
checking union wait... no
checking for strncasecmp... yes
checking for gettimeofday... yes
checking for gettimeofday declaration... present
checking whether char is unsigned... no
checking signed char declarations... yes
checking for a putenv() that copies the buffer... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking whether to use nl_langinfo... yes
checking for chflags... no
checking isnan... yes
checking for fts... no
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/filio.h usability... yes
checking sys/filio.h presence... yes
checking for sys/filio.h... yes
checking system version... (cached) SunOS-5.11
checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... O_NONBLOCK
checking whether to use dll unloading... yes
checking for timezone data... /usr/share/lib/zoneinfo
checking sys/sdt.h usability... yes
checking sys/sdt.h presence... yes
checking for sys/sdt.h... yes
checking for dtrace... /usr/sbin/dtrace
checking whether to enable DTrace support... yes
checking if the C stack grows upwards in memory... no
checking whether the cpuid instruction is usable... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating dltest/Makefile
config.status: creating tclConfig.sh
config.status: creating tcl.pc


Safeguard this milestone:

$ zfs snapshot $DS/tcl/tcl-8.5.19-gnu32@config

Now, for the make:

$ gmake
...

The build is comparably fast, even on a slow machine.
Safeguard this milestone:

$ zfs snapshot $DS/tcl/tcl-8.5.19-gnu32@build

The verification was interesting: the skips seemed reasonable as the build machine was a Solaris 11.3 guest on a VirturalBox Solaris 11.3 host. By looking at the errors they all seemed related to VirtualBox as well. By the way, my localtime is GMT-3. Here were the results:

$ gmake test
...
Tests began at Wed Jul 12 16:27:22 BRT 2017
...
clock.test
==== clock-38.1 regression - 

     convertUTCToLocalViaC - east of Greenwich FAILED
==== Contents of test case:

    clock format 0 -format %H:%M:%S \

    -timezone :localtime
   
---- Result was:
21:00:00
---- Result should have been (exact matching):
01:00:00
==== clock-38.1 FAILED
==== clock-40.1 regression - 

     bad month with -timezone :localtime FAILED
==== Contents of test case:

    clock scan 2000-01-01T00:00:00 \

    -timezone :localtime  -format %Y-%m-%dT%H:%M:%S
   
---- Result was:
946692000
---- Result should have been (exact matching):
946684800
==== clock-40.1 FAILED
==== clock-42.1 regression test - 

     %z in :localtime when west of Greenwich FAILED
==== Contents of test case:

    clock format 0 -format %z \

    -timezone :localtime
   
---- Result was:
-0300
---- Result should have been (exact matching):
-0500
==== clock-42.1 FAILED

...

Tests ended at Wed Jul 12 16:33:08 BRT 2017
all.tcl:    Total    27201    Passed    26204    Skipped    994    Failed    3
Sourced 138 Test Files.
Files with failing tests: clock.test
Number of tests skipped for each constraint:
    9    !ieeeFloatingPoint
    3    asyncPipeChan
    76    bigEndian
    6    bug-05489ce335
    5    bug-3057639
    4    dontCopyLinks
    61    emptyTest
    2    hasIsoLocale
    1    knownBadTest
    40    knownBug
    100    localeRegexp
    12    longIs64bit
    14    macosxFileAttr
    18    memory
    43    nonPortable
    5    notNetworkFilesystem
    9    nt
    1    pcOnly
    4    readonlyAttr
    7    testaccessproc
    1    testexprparser && !ieeeFloatingPoint
    8    testopenfilechannelproc
    7    teststatproc
    1    testwinclock
    21    testwordend
    1    thread
    2    unthreaded
    520    win
    2    win2000orXP


I did repeat the tests outside the VM by sending / receiving the containing ZFS file-system to the VM host where the resulting builds were also already installed (I also had to fix a few path references in the Makefiles) and all the clock tests were successful, although more tests were skipped (and I'm still not certain why, except that the system configurations are "only slightly" different). Apart from that, I got new (but somewhat understandable and harmless) errors:

...
socket.test

==== socket-5.1 byte order problems, 

     socket numbers, htons FAILED
==== Contents of test case:

    set x {couldn't open socket: not owner}
    if {![catch {socket -server dodo 0x1} msg]} {
        set x {htons problem, should be disallowed, 

               are you running as SU?}
    close $msg
    }
    set x

---- Result was:
htons problem, should be disallowed, are you running as SU?
---- Result should have been (exact matching):
couldn't open socket: not owner
==== socket-5.1 FAILED

==== socket-5.3 byte order problems, 

     socket numbers, htons FAILED
==== Contents of test case:

    set x {couldn't open socket: not owner}
    if {![catch {socket -server dodo 21} msg]} {
    set x {htons problem, should be disallowed, 

           are you running as SU?}
    close $msg
    }
    set x

---- Result was:
htons problem, should be disallowed, are you running as SU?
---- Result should have been (exact matching):
couldn't open socket: not owner
==== socket-5.3 FAILED

...

Actually, if the above tests were run as root, then they would have succeeded, as I subsequently confirmed. But I became curious again why they have succeeded in the first place while in the VM under the presumable same circumstances.

$ sudo gmake install
Making directory /opt/tcl-8.5.19/gnu32/lib
Making directory /opt/tcl-8.5.19/gnu32/bin
Installing libtcl8.5.so to /opt/tcl-8.5.19/gnu32/lib/
Installing tclsh as /opt/tcl-8.5.19/gnu32/bin/tclsh8.5
Installing tclConfig.sh to /opt/tcl-8.5.19/gnu32/lib/
Installing libtclstub8.5.a to /opt/tcl-8.5.19/gnu32/lib/
Installing pkg-config file to /opt/tcl-8.5.19/gnu32/lib/pkgconfig/
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/msgs
Installing message catalog files to /opt/tcl-8.5.19/gnu32/lib/tcl8.5/msgs/
Making directory /opt/tcl-8.5.19/gnu32/include
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/opt0.4
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/http1.0
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/encoding
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/../tcl8
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/../tcl8/8.4
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/../tcl8/8.4/platform
Making directory /opt/tcl-8.5.19/gnu32/lib/tcl8.5/../tcl8/8.5
Installing header files to /opt/tcl-8.5.19/gnu32/include/
Installing library files to /opt/tcl-8.5.19/gnu32/lib/tcl8.5/
Installing package http1.0 files to /opt/tcl-8.5.19/gnu32/lib/tcl8.5/http1.0/
Installing package http 2.7.13 as a Tcl Module
Installing package opt0.4 files to /opt/tcl-8.5.19/gnu32/lib/tcl8.5/opt0.4/
Installing package msgcat 1.5.2 as a Tcl Module
Installing package tcltest 2.3.8 as a Tcl Module
Installing package platform 1.0.14 as a Tcl Module
Installing package platform::shell 1.1.4 as a Tcl Module
Installing encoding files to /opt/tcl-8.5.19/gnu32/lib/tcl8.5/encoding/
Making directory /opt/tcl-8.5.19/gnu32/man
Making directory /opt/tcl-8.5.19/gnu32/man/man1
Making directory /opt/tcl-8.5.19/gnu32/man/man3
Making directory /opt/tcl-8.5.19/gnu32/man/mann
Installing and cross-linking top-level (.1) docs to /opt/tcl-8.5.19/gnu32/man/man1/
Installing and cross-linking C API (.3) docs to /opt/tcl-8.5.19/gnu32/man/man3/
Installing and cross-linking command (.n) docs to /opt/tcl-8.5.19/gnu32/man/mann/


$ ls -1 /opt/tcl-8.5.19/gnu32/*
/opt/tcl-8.5.19/gnu32/bin:
tclsh8.5

...

/opt/tcl-8.5.19/gnu32/include:
tcl.h
tclDecls.h
tclPlatDecls.h
tclTomMath.h
tclTomMathDecls.h

/opt/tcl-8.5.19/gnu32/lib:
libtcl8.5.so
libtclstub8.5.a
pkgconfig
tcl8
tcl8.5
tclConfig.sh

/opt/tcl-8.5.19/gnu32/man:
man1
man3
mann



NOTE
One may notice that under /opt/.../bin the tclsh was installed as tclsh8.5.  This is most probably happens because a previous version has been detected on /usr/bin. In fact, what I want hereafter is that new version gets detected before the legacy version, so I can create a symbolic link in /opt/.../bin as follows:
 
# ln -s tclsh8.5/ tclsh

Now it's time to build the Tk modules.
 

NOTE
With respect to the following configuration using --with-x, as usual on UNIX one doesn't need to install a full-blown desktop in order to take advantage of a remote host for X displaying. For instance, on a Solaris 11 Express text-install, one only needs to install the package X-redistributable (under Solaris 11.3 the package has been renamed to X-all or X-incorporation).

$ cd ~/software/tk/tk-8.5.19-gnu32/unix
 
$ source ../../setenv-tk-8.5.19 32
CONFIG_SHELL=/bin/bash

CC=/usr/bin/gcc CFLAGS=-m32 -march=core2 -std=gnu89
CXX=/usr/bin/g++ CXXFLAGS=-m32 -march=core2 -std=gnu++03

PATH=/opt/tcl-8.5.19/gnu32/bin:/opt/libtool-2.4.6/gnu32/bin:/opt/m4-1.4.18/gnu32/bin:/opt/autoconf-2.69/gnu32/bin:/opt/automake-1.15/gnu32/bin:/usr/gnu/bin:/usr/bin:/usr/sbin
PKG_CONFIG_PATH=/opt/tcl-8.5.19/gnu32/lib/pkgconfig
 

$ ./configure \
  --prefix=/opt/tcl-8.5.19/gnu32 \

  --enable-threads \
  --enable-rpath \
  --enable-dtrace \
  --with-tcl=/opt/tcl-8.5.19/gnu32/lib \
  --with-x 
schecking for Tcl configuration... found /opt/tcl-8.5.19/gnu32/lib/tclConfig.sh
checking for existence of /opt/tcl-8.5.19/gnu32/lib/tclConfig.sh... loading
checking for tclsh... /opt/tcl-8.5.19/gnu32/bin/tclsh8.5
checking for tclsh in Tcl build directory... /opt/tcl-8.5.19/gnu32/lib/tclsh
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking if the compiler understands -pipe... yes
checking for pthread_mutex_init in -lpthread... yes
checking for pthread_attr_setstacksize... yes
checking for pthread_atfork... yes
checking for pthread_attr_get_np... no
checking for pthread_getattr_np... no
checking for pthread_get_stacksize_np... no
checking for building with threads... yes (threaded core)
checking how to build libraries... shared
checking for ranlib... ranlib
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking if compiler supports visibility "hidden"... yes
checking if rpath support is requested... yes
checking system version... SunOS-5.11
checking for dlopen in -ldl... yes
checking for ar... ar
checking for cast to union support... yes
checking for build with symbols... no
checking for required early compiler flags... none
checking for 64-bit integer type... long long
checking for struct dirent64... yes
checking for struct stat64... yes
checking for open64... yes
checking for lseek64... yes
checking for off64_t... yes
checking whether byte ordering is bigendian... no
checking for fd_set in sys/types... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for strtod... yes
checking for Solaris2.4/Tru64 strtod bugs... ok
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking pw_gecos in struct pwd... yes
checking for X... libraries , headers
checking for main in -lXbsd... no
checking whether to use xft... yes
checking for X11/Xft/Xft.h... yes
checking for XftFontOpen in -lXft... yes
checking for FcFontSort in -lfontconfig... yes
checking for X11/XKBlib.h... yes
checking for XkbKeycodeToKeysym in -lX11... yes
checking whether to try to use XScreenSaver... yes
checking for X11/extensions/scrnsaver.h... yes
checking for XScreenSaverQueryInfo... no
checking for XScreenSaverQueryInfo in -lXext... yes
checking whether char is unsigned... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tkConfig.sh
config.status: creating tk.pc

 
$ zfs snapshot $DS/tk/tk-8.5.19-gnu32@config

$ gmake
...

$ zfs snapshot $DS/tk/tk-8.5.19-gnu32@build

NOTE
The gmake test or
the gmake test TESTFLAGS="-constraints userInteraction" must be run under an X session. The tests are somewhat fun to follow, but under a VM guest there were some erros yet to investigate.
$ gmake test
...
Tests ended at Thu Jul 13 14:11:30 BRT 2017
all.tcl:    Total    8957    Passed    7980    Skipped    944    Failed    33
Sourced 87 Test Files.
Files with failing tests: focus.test font.test id.test scrollbar.test textWind.test unixFont.test unixWm.test wm.test
Number of tests skipped for each constraint:
    14    altDisplay
    1    aqua
    16    colorsFree
    3    colorsLeftover
    21    defaultPseudocolor8
    6    emptyTest
    140    fonts
    1    hasArial
    1    hasCourierNew
    1    hasTimesNew
    1    havePseudocolorVisual
    8    knownBug
    1    memory
    166    nonPortable
    33    nt
    5    pseudocolor8
    11    testmetrics
    7    testwinevent
    143    textfonts
    1    unthreaded
    1    userInteraction
    312    win
    51    winSend

...
==== focus-6.1 miscellaneous - embedded application in same process FAILED


==== font-4.9 font command: actual FAILED
==== font-24.5 Tk_ComputeTextLayout: break line FAILED
==== font-44.1 TkFontGetPixels: size < 0 FAILED

==== id-1.1 WindowIdCleanup, delaying window release FAILED

==== scrollbar-3.36 ScrollbarWidgetCmd procedure, "fraction" option FAILED
==== scrollbar-3.38 ScrollbarWidgetCmd procedure, "fraction" option FAILED
==== scrollbar-6.12 ScrollbarPosition procedure FAILED
==== scrollbar-6.29 ScrollbarPosition procedure FAILED
==== scrollbar-6.35 ScrollbarPosition procedure FAILED
==== scrollbar-6.44 ScrollbarPosition procedure FAILED

==== textWind-10.6.1 EmbWinLayoutProc procedure, error in creating window FAILED

==== unixfont-1.2 TkpGetNativeFont procedure: native FAILED
==== unixfont-2.6 TkpGetFontFromAttributes: fallback to fixed family FAILED
==== unixfont-2.8 TkpGetFontFromAttributes: loop over returned font names FAILED
==== unixfont-2.9 TkpGetFontFromAttributes: reject adobe courier if possible FAI
==== unixfont-5.9 Tk_MeasureChars procedure: TK_PARTIAL_OK FAILED
==== unixfont-8.4 AllocFont procedure: classify characters FAILED
==== unixfont-8.5 AllocFont procedure: setup widths of normal chars FAILED
==== unixfont-8.6 AllocFont procedure: setup widths of special chars FAILED
==== unixfont-9.1 GetControlCharSubst procedure: 2 chars subst FAILED
==== unixfont-9.2 GetControlCharSubst procedure: 4 chars subst FAILED

==== unixWm-4.3 moving window while withdrawn FAILED
==== unixWm-45.2 UpdateSizeHints procedure FAILED
==== unixWm-45.4 UpdateSizeHints procedure, not resizable with menu FAILED
==== unixWm-51.7 TkWmRestackToplevel procedure, other window isn't mapped FAILED

==== 2.2 testing bevel.tcl FAILED
==== 2.8 testing canvPsBmap.tcl FAILED
==== 2.11 testing canvPsBmap.tcl FAILED

==== wm-stackorder-2.2 stacking order FAILED
==== wm-stackorder-2.3 stacking order FAILED
==== wm-stackorder-2.4 stacking order FAILED
==== wm-stackorder-2.5 stacking order FAILED
==== wm-stackorder-4.3 wm stackorder isabove|isbelow FAILED
==== wm-stackorder-4.4 wm stackorder isabove|isbelow FAILED
 ==== wm-stackorder-5.1 a menu is not a toplevel FAILED
...
Tests ended at Thu Jul 13 14:11:42 BRT 2017
all.tcl:    Total    460    Passed    442    Skipped    17    Failed    1
Sourced 17 Test Files.
Files with failing tests: ttk.test
Number of tests skipped for each constraint:
    2    NA
    4    coreEntry
    3    coreScrollbar
    5    nyi
    3    xpnative

... 
==== ttk-2.8 bug 3223850: button state disabled during click FAILED

NOTE
In fact there are some errors and I don't know yet if they are due to running the tests from inside a VM. By their titles, they may or may not be significant. And I started wondering about how many the Solaris 11.3 (GA / Release) packaged older version would have...
$ sudo gmake install
Making directory /opt/tcl-8.5.19/gnu32/lib/tk8.5
Creating package index /opt/tcl-8.5.19/gnu32/lib/tk8.5/pkgIndex.tcl
Installing libtk8.5.so to /opt/tcl-8.5.19/gnu32/lib/
Installing wish as /opt/tcl-8.5.19/gnu32/bin/wish8.5
Installing tkConfig.sh to /opt/tcl-8.5.19/gnu32/lib/
Installing libtkstub8.5.a to /opt/tcl-8.5.19/gnu32/lib/
Installing pkg-config file to /opt/tcl-8.5.19/gnu32/lib/pkgconfig/
Making directory /opt/tcl-8.5.19/gnu32/lib/tk8.5/images
Making directory /opt/tcl-8.5.19/gnu32/lib/tk8.5/msgs
Making directory /opt/tcl-8.5.19/gnu32/lib/tk8.5/ttk
Installing Tk library files to /opt/tcl-8.5.19/gnu32/lib/tk8.5/
Installing Ttk library files to /opt/tcl-8.5.19/gnu32/lib/tk8.5/ttk/
Installing library image files to /opt/tcl-8.5.19/gnu32/lib/tk8.5/images/
Installing message catalog files to /opt/tcl-8.5.19/gnu32/lib/tk8.5/msgs/
Installing and cross-linking top-level (.1) docs to /opt/tcl-8.5.19/gnu32/man/man1/
Installing and cross-linking C API (.3) docs to /opt/tcl-8.5.19/gnu32/man/man3/
Installing and cross-linking command (.n) docs to /opt/tcl-8.5.19/gnu32/man/mann/
Installing header files to /opt/tcl-8.5.19/gnu32/include/
Making directory /opt/tcl-8.5.19/gnu32/lib/tk8.5/demos
Making directory /opt/tcl-8.5.19/gnu32/lib/tk8.5/demos/images
Installing demo files to /opt/tcl-8.5.19/gnu32/lib/tk8.5/demos/
Installing demo image files to /opt/tcl-8.5.19/gnu32/lib/tk8.5/demos/images/


$ sudo ln -s /opt/.../bin/wish8.5 /opt/.../bin/wish
 $ sudo zfs snapshot rpool/VARSHARE/tcl-8.5.19/gnu32@release
 
If necessary, package the results in a tarball or some other method of choice.
Now, it rests setting up PATH and PKG_CONFIG_PATH as necessary.

For GNU64:

$ cd ~/software/tcl/tcl-8.5.19-gnu64/unix

$ source ../../setenv-tcl-8.5.19 64 
CONFIG_SHELL=/bin/bash

CC=/usr/bin/gcc CFLAGS=-m64 -march=core2 -std=gnu89
CXX=/usr/bin/g++ CXXFLAGS=-m64 -march=core2 -std=gnu++03

PATH=/opt/libtool-2.4.6/gnu64/bin:/opt/m4-1.4.18/gnu64/bin:/opt/autoconf-2.69/gnu64/bin:/opt/automake-1.15/gnu64/bin:/usr/gnu/bin:/usr/bin:/usr/sbin
PKG_CONFIG_PATH=


$ ./configure \
  --prefix=/opt/tcl-8.5.19/gnu64 \
  --enable-threads \
  --enable-64bit \
  --enable-rpath \
  --enable-dtrace
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ANSI C... none needed
checking for inline... inline
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dirent.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking values.h usability... yes
checking values.h presence... yes
checking for values.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking if the compiler understands -pipe... yes
checking for pthread_mutex_init in -lpthread... yes
checking for pthread_attr_setstacksize... yes
checking for pthread_atfork... yes
checking for pthread_attr_get_np... no
checking for pthread_getattr_np... no
checking for pthread_get_stacksize_np... no
checking for building with threads... yes
checking for sin... no
checking for main in -lieee... no
checking for main in -linet... no
checking net/errno.h usability... no
checking net/errno.h presence... no
checking for net/errno.h... no
checking for connect... no
checking for setsockopt... no
checking for setsockopt in -lsocket... yes
checking for gethostbyname... no
checking for gethostbyname in -lnsl... yes
checking how to build libraries... shared
checking for ranlib... ranlib
checking if 64bit support is requested... yes
checking if 64bit Sparc VIS support is requested... no
checking if compiler supports visibility "hidden"... yes
checking if rpath support is requested... yes
checking system version... SunOS-5.11
checking for dlopen in -ldl... yes
checking for ar... ar
checking for cast to union support... yes
checking for build with symbols... no
checking for required early compiler flags... none
checking for 64-bit integer type... using long
checking whether byte ordering is bigendian... no
checking for getcwd... yes
checking for opendir... yes
checking for strtol... yes
checking for waitpid... yes
checking for strerror... yes
checking for getwd... yes
checking for wait3... yes
checking for uname... yes
checking for realpath... yes
checking for getaddrinfo... yes
checking for working getaddrinfo... yes
checking for getpwuid_r... yes
checking for getpwuid_r with 5 args... yes
checking for getpwnam_r... yes
checking for getpwnam_r with 5 args... yes
checking for getgrgid_r... yes
checking for getgrgid_r with 5 args... yes
checking for getgrnam_r... yes
checking for getgrnam_r with 5 args... yes
checking for gethostbyname_r... yes
checking for gethostbyname_r with 6 args... no
checking for gethostbyname_r with 5 args... yes
checking for gethostbyaddr_r... yes
checking for gethostbyaddr_r with 7 args... yes
checking sys/modem.h usability... no
checking sys/modem.h presence... no
checking for sys/modem.h... no
checking termios vs. termio vs. sgtty... termios
checking for fd_set in sys/types... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for gmtime_r... yes
checking for localtime_r... yes
checking for mktime... yes
checking tm_tzadj in struct tm... no
checking tm_gmtoff in struct tm... no
checking long timezone variable... yes
checking for struct stat.st_blocks... yes
checking for struct stat.st_blksize... yes
checking for blkcnt_t... yes
checking for fstatfs... yes
checking for working memcmp... yes
checking for memmove... yes
checking for strstr... yes
checking proper strstr implementation... ok
checking for strtoul... yes
checking proper strtoul implementation... ok
checking for strtod... yes
checking proper strtod implementation... ok
checking for strtod... (cached) yes
checking for Solaris2.4/Tru64 strtod bugs... ok
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for socklen_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for opendir... (cached) yes
checking union wait... no
checking for strncasecmp... yes
checking for gettimeofday... yes
checking for gettimeofday declaration... present
checking whether char is unsigned... no
checking signed char declarations... yes
checking for a putenv() that copies the buffer... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking whether to use nl_langinfo... yes
checking for chflags... no
checking isnan... yes
checking for fts... no
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/filio.h usability... yes
checking sys/filio.h presence... yes
checking for sys/filio.h... yes
checking system version... (cached) SunOS-5.11
checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... O_NONBLOCK
checking whether to use dll unloading... yes
checking for timezone data... /usr/share/lib/zoneinfo
checking sys/sdt.h usability... yes
checking sys/sdt.h presence... yes
checking for sys/sdt.h... yes
checking for dtrace... /usr/sbin/dtrace
checking whether to enable DTrace support... yes
checking if the C stack grows upwards in memory... no
checking whether the cpuid instruction is usable... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating dltest/Makefile
config.status: creating tclConfig.sh
config.status: creating tcl.pc


$ zfs snapshot $DS/tcl/tcl-8.5.19-gnu64@config

$ gmake
...

$ zfs snapshot $DS/tcl/tcl-8.5.19-gnu64@build

The test results for the 64-bits build were similar.

$ gmake test
...
Tests ended at Wed Jul 12 18:22:01 BRT 2017
all.tcl:        Total   27201   Passed  26164   Skipped 1034    Failed  3
Sourced 138 Test Files.
Files with failing tests: clock.test
Number of tests skipped for each constraint:
        9       !ieeeFloatingPoint
        3       asyncPipeChan
        76      bigEndian
        6       bug-05489ce335
        5       bug-3057639
        4       dontCopyLinks
        61      emptyTest
        2       hasIsoLocale
        1       knownBadTest
        40      knownBug
        100     localeRegexp
        50      longIs32bit
        14      macosxFileAttr
        18      memory
        43      nonPortable
        5       notNetworkFilesystem
        9       nt
        1       pcOnly
        4       readonlyAttr
        7       testaccessproc
        1       testexprparser && !ieeeFloatingPoint
        8       testopenfilechannelproc
        7       teststatproc
        1       testwinclock
        21      testwordend
        1       thread
        2       unthreaded
        2       wideBiggerThanInt
        520     win
        2       win2000orXP


$ sudo gmake install
Making directory /opt/tcl-8.5.19/gnu64/lib
Making directory /opt/tcl-8.5.19/gnu64/bin
Installing libtcl8.5.so to /opt/tcl-8.5.19/gnu64/lib/
Installing tclsh as /opt/tcl-8.5.19/gnu64/bin/tclsh8.5
Installing tclConfig.sh to /opt/tcl-8.5.19/gnu64/lib/
Installing libtclstub8.5.a to /opt/tcl-8.5.19/gnu64/lib/
Installing pkg-config file to /opt/tcl-8.5.19/gnu64/lib/pkgconfig/
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/msgs
Installing message catalog files to /opt/tcl-8.5.19/gnu64/lib/tcl8.5/msgs/
Making directory /opt/tcl-8.5.19/gnu64/include
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/opt0.4
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/http1.0
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/encoding
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/../tcl8
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/../tcl8/8.4
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/../tcl8/8.4/platform
Making directory /opt/tcl-8.5.19/gnu64/lib/tcl8.5/../tcl8/8.5
Installing header files to /opt/tcl-8.5.19/gnu64/include/
Installing library files to /opt/tcl-8.5.19/gnu64/lib/tcl8.5/
Installing package http1.0 files to /opt/tcl-8.5.19/gnu64/lib/tcl8.5/http1.0/
Installing package http 2.7.13 as a Tcl Module
Installing package opt0.4 files to /opt/tcl-8.5.19/gnu64/lib/tcl8.5/opt0.4/
Installing package msgcat 1.5.2 as a Tcl Module
Installing package tcltest 2.3.8 as a Tcl Module
Installing package platform 1.0.14 as a Tcl Module
Installing package platform::shell 1.1.4 as a Tcl Module
Installing encoding files to /opt/tcl-8.5.19/gnu64/lib/tcl8.5/encoding/
Making directory /opt/tcl-8.5.19/gnu64/man
Making directory /opt/tcl-8.5.19/gnu64/man/man1
Making directory /opt/tcl-8.5.19/gnu64/man/man3
Making directory /opt/tcl-8.5.19/gnu64/man/mann
Installing and cross-linking top-level (.1) docs to /opt/tcl-8.5.19/gnu64/man/man1/
Installing and cross-linking C API (.3) docs to /opt/tcl-8.5.19/gnu64/man/man3/
Installing and cross-linking command (.n) docs to /opt/tcl-8.5.19/gnu64/man/mann/


$ sudo ln -s /opt/.../bin/tclsh8.5 /opt/.../bin/tclsh
 
$ ls -1 /opt/tcl-8.5.19/gnu64/*
/opt/tcl-8.5.19/gnu64/bin:
tclsh8.5
...

/opt/tcl-8.5.19/gnu64/include:
tcl.h
tclDecls.h
tclPlatDecls.h
tclTomMath.h
tclTomMathDecls.h

/opt/tcl-8.5.19/gnu64/lib:
libtcl8.5.so
libtclstub8.5.a
pkgconfig
tcl8
tcl8.5
tclConfig.sh

/opt/tcl-8.5.19/gnu64/man:
man1
man3
mann


Now it's time to build the Tk modules.

$ cd ~/software/tk/tk-8.5.19-gnu64/unix
 
$ source ../../setenv-tk-8.5.19 64
CONFIG_SHELL=/bin/bash

CC=/usr/bin/gcc CFLAGS=-m64 -march=core2 -std=gnu89
CXX=/usr/bin/g++ CXXFLAGS=-m64 -march=core2 -std=gnu++03

PATH=/opt/libtool-2.4.6/gnu64/bin:/opt/m4-1.4.18/gnu64/bin:/opt/autoconf-2.69/gnu64/bin:/opt/automake-1.15/gnu64/bin:/opt/tcl-8.5.19/gnu64/bin:/usr/gnu/bin:/usr/bin:/usr/sbin
PKG_CONFIG_PATH=/opt/tcl-8.5.19/gnu64/lib/pkgconfig


$ ./configure \
  --prefix=/opt/tcl-8.5.19/gnu64 \

  --enable-threads \
  --enable-64bit \
  --enable-rpath \
  --enable-dtrace \
  --with-tcl=/opt/tcl-8.5.19/gnu64/lib \
  --with-x
checking for Tcl configuration... found /opt/tcl-8.5.19/gnu64/lib/tclConfig.sh
checking for existence of /opt/tcl-8.5.19/gnu64/lib/tclConfig.sh... loading
checking for tclsh... /opt/tcl-8.5.19/gnu64/bin/tclsh8.5
checking for tclsh in Tcl build directory... /opt/tcl-8.5.19/gnu64/lib/tclsh
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking if the compiler understands -pipe... yes
checking for pthread_mutex_init in -lpthread... yes
checking for pthread_attr_setstacksize... yes
checking for pthread_atfork... yes
checking for pthread_attr_get_np... no
checking for pthread_getattr_np... no
checking for pthread_get_stacksize_np... no
checking for building with threads... yes (threaded core)
checking how to build libraries... shared
checking for ranlib... ranlib
checking if 64bit support is requested... yes
checking if 64bit Sparc VIS support is requested... no
checking if compiler supports visibility "hidden"... yes
checking if rpath support is requested... yes
checking system version... SunOS-5.11
checking for dlopen in -ldl... yes
checking for ar... ar
checking for cast to union support... yes
checking for build with symbols... no
checking for required early compiler flags... none
checking for 64-bit integer type... using long
checking whether byte ordering is bigendian... no
checking for fd_set in sys/types... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for strtod... yes
checking for Solaris2.4/Tru64 strtod bugs... ok
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking pw_gecos in struct pwd... yes
checking for X... libraries , headers
checking for main in -lXbsd... no
checking whether to use xft... yes
checking for X11/Xft/Xft.h... yes
checking for XftFontOpen in -lXft... yes
checking for FcFontSort in -lfontconfig... yes
checking for X11/XKBlib.h... yes
checking for XkbKeycodeToKeysym in -lX11... yes
checking whether to try to use XScreenSaver... yes
checking for X11/extensions/scrnsaver.h... yes
checking for XScreenSaverQueryInfo... no
checking for XScreenSaverQueryInfo in -lXext... yes
checking whether char is unsigned... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tkConfig.sh
config.status: creating tk.pc

 
$ zfs snapshot $DS/tk/tk-8.5.19-gnu64@config

$ gmake
...

$ zfs snapshot $DS/tk/tk-8.5.19-gnu64@build

$ gmake test
...

The only differences in test results were:

==== font-44.1 TkFontGetPixels: size < 0 OK 
==== send-8.16 Tk_SendCmd procedure, bogusCommWindow FAILED
==== 2.2 testing bevel.tcl OK
==== 2.8 testing canvPsBmap.tcl OK
==== 2.11 testing canvPsBmap.tcl OK


$ sudo gmake install
Making directory /opt/tcl-8.5.19/gnu64/lib/tk8.5
Creating package index /opt/tcl-8.5.19/gnu64/lib/tk8.5/pkgIndex.tcl
Installing libtk8.5.so to /opt/tcl-8.5.19/gnu64/lib/
Installing wish as /opt/tcl-8.5.19/gnu64/bin/wish8.5
Installing tkConfig.sh to /opt/tcl-8.5.19/gnu64/lib/
Installing libtkstub8.5.a to /opt/tcl-8.5.19/gnu64/lib/
Installing pkg-config file to /opt/tcl-8.5.19/gnu64/lib/pkgconfig/
Making directory /opt/tcl-8.5.19/gnu64/lib/tk8.5/images
Making directory /opt/tcl-8.5.19/gnu64/lib/tk8.5/msgs
Making directory /opt/tcl-8.5.19/gnu64/lib/tk8.5/ttk
Installing Tk library files to /opt/tcl-8.5.19/gnu64/lib/tk8.5/
Installing Ttk library files to /opt/tcl-8.5.19/gnu64/lib/tk8.5/ttk/
Installing library image files to /opt/tcl-8.5.19/gnu64/lib/tk8.5/images/
Installing message catalog files to /opt/tcl-8.5.19/gnu64/lib/tk8.5/msgs/
Installing and cross-linking top-level (.1) docs to /opt/tcl-8.5.19/gnu64/man/man1/
Installing and cross-linking C API (.3) docs to /opt/tcl-8.5.19/gnu64/man/man3/
Installing and cross-linking command (.n) docs to /opt/tcl-8.5.19/gnu64/man/mann/
Installing header files to /opt/tcl-8.5.19/gnu64/include/
Making directory /opt/tcl-8.5.19/gnu64/lib/tk8.5/demos
Making directory /opt/tcl-8.5.19/gnu64/lib/tk8.5/demos/images
Installing demo files to /opt/tcl-8.5.19/gnu64/lib/tk8.5/demos/
Installing demo image files to /opt/tcl-8.5.19/gnu64/lib/tk8.5/demos/images/


$ sudo ln -s /opt/.../bin/wish8.5 /opt/.../bin/wish
 
$ sudo zfs snapshot rpool/VARSHARE/tcl-8.5.19/gnu64@release

If necessary, package the results in a tarball or some other method of choice.
Now, it rests setting up PATH and PKG_CONFIG_PATH as necessary.

That's it for Tcl / Tk version 8.5.19!

NOTE
For building version 8.6.6, being by making sure that version 8.5.19 is in PATH and in PKG_CONFIG_PATH, because version 8.6.6 searchs for a previous tclsh which could indicate that it would be better to make sure it gets the most updated instance of version 8.5 series (which would not be the version packaged with Solaris).
In the process of building version 8.6.6 some modules don't recognize the --enable-dtrace configuration option, but the messages are flagged as mere warnings so this shouldn't be a problem except that DTrace may not be available on such modules.

The whole process is pretty much the same, so I will only describe eventual differences in the procedures and some results which I've found more interesting (using the GNU32 target as an example). For instance, the tests results were pretty much better with only 2 errors not solvable by running as root (at least under a VM):

==== socket_inet-13.1 Testing use of shared socket between two threads FAILED
==== socket_inet6-13.1 Testing use of shared socket between two threads FAILED

During installation, it's somewhat interesting that the following "packages" get "installed" (although I'm still not aware of their usefulness):

Installing package 'sqlite3.13.0'
Installing package 'tdbc1.0.4'
Installing package 'tdbcmysql1.0.4'
Installing package 'tdbcpostgres1.0.4'
Installing package 'tdbcsqlite3-1.0.4'
Installing package 'thread2.8.0'

$ ls -1 /opt/tcl-8.6.6/gnu32/*
/opt/tcl-8.6.6/gnu32/bin:
sqlite3_analyzer
tclsh8.6

...

/opt/tcl-8.6.6/gnu32/include:
fakemysql.h
fakepq.h
fakesql.h
itcl.h
itcl2TclOO.h
itclDecls.h
itclInt.h
itclIntDecls.h
itclMigrate2TclCore.h
itclTclIntStubsFcn.h
mysqlStubs.h
odbcStubs.h
pqStubs.h
tcl.h
tclDecls.h
tclOO.h
tclOODecls.h
tclPlatDecls.h
tclThread.h
tclTomMath.h
tclTomMathDecls.h
tdbc.h
tdbcDecls.h
tdbcInt.h

/opt/tcl-8.6.6/gnu32/lib:

itcl4.0.5
libtcl8.6.so
libtclstub8.6.a
pkgconfig
sqlite3.13.0
tcl8
tcl8.6
tclConfig.sh
tclooConfig.sh
tdbc1.0.4
tdbcmysql1.0.4
tdbcodbc1.0.4
tdbcpostgres1.0.4
thread2.8.0

/opt/tcl-8.6.6/gnu32/man:
man1
man3
mann

/opt/tcl-8.6.6/gnu32/share:
man


$ cd ~/software/tk/tk-8.6.6-gnu32/unix

$ source ../../setenv-tk-8.6.6 32
CONFIG_SHELL=/bin/bash

CC=/usr/bin/gcc CFLAGS=-m32 -march=core2 -std=gnu89
CXX=/usr/bin/g++ CXXFLAGS=-m32 -march=core2 -std=gnu++03

PATH=/opt/tcl-8.6.6/gnu32/bin:/opt/libtool-2.4.6/gnu32/bin:/opt/m4-1.4.18/gnu32/bin:/opt/autoconf-2.69/gnu32/bin:/opt/automake-1.15/gnu32/bin:/usr/gnu/bin:/usr/bin:/usr/sbin
PKG_CONFIG_PATH=/opt/tcl-8.6.6/gnu32/lib/pkgconfig


$ ./configure \
  --prefix=/opt/tcl-8.6.6/gnu32 \
  --enable-threads \
  --enable-rpath \
  --enable-dtrace \
  --with-tcl=/opt/tcl-8.6.6/gnu32/lib \
  --with-x
...

$ zfs snapshot $DS/tk/tk-8.6.6-gnu32@config

$ gmake
...

$ zfs snapshot $DS/tk/tk-8.6.6-gnu32@build
 
$ gmake test # Under X!
...

$ sudo gmake install
...

$ sudo ln -s /opt/.../bin/wish8.6 /opt/.../bin/wish

$ sudo zfs snapshot rpool/VARSHARE/tcl-8.6.6/gnu32@release

If necessary, package the results in a tarball or some other method of choice.
Now, it rests setting up PATH and PKG_CONFIG_PATH as necessary.

For the GNU64 everything is analogous and as this post is already exremelly lengthy I'll omit this last part as I believe I've already made my point!
     
The next step is learning this beast! :-)