2014-08-31

Build TclX 8.4.1 on Windows x86 platform, using MinGW/MSYS

編譯的環境為 Windows XP SP3 32bit,編譯器為 MinGW/MSYS。

使用 configure 的時候,因為沒有 random/srandom function,使用下列的方式定義:
CPPFLAGS="-Drandom=rand -Dsrandom=srand" ./configure --enable-threads --with-tcl=/opt/tcl/lib


造出 Makefile 以後,需要進行一些修改:
找到 PKG_OBJECTS,然後移除 random.o (不然會編譯錯誤)
random/srandom function 不是標準的 C standard function,所以 TclX 會預設有一個 random.c 要編譯,但是我使用了在 CPPFLAGS 定義的方式,所以移除 random.o,這是不需要的(總不能造一個空的給 GCC 吧,雖然應該也可以)。

再來修改 win\tclXwinPort.h,將 random 的定義修改如下(由 long 改為 int):
extern int    random(void);

再來 TclX 就可以編譯成功了。


執行 make test,會在 profile.test crash 掉,如果移掉 profile.test 不測試,下面是進行 test 以後的結果:
all.tcl:        Total   1481    Passed  1447    Skipped 23      Failed  11

2014-08-23

透過 WMI 取得目前 BIOS 的版本資料 (on WIndows platform)

使用 TWAPI 透過 WMI 取得目前 BIOS 的版本資料,下面是一個測試的 sample code:
package require twapi_wmi
package require twapi_process
namespace path twapi

set wmi [comobj_object winmgmts:root/cimv2]
set wql {SELECT * FROM Win32_BIOS}
set BIOS [$wmi ExecQuery $wql]

$BIOS -iterate bios_info {    
    puts -nonewline "Description: "
    set DescriptionVal [$bios_info -with {Properties_ {Item Description}} Value]          
    puts $DescriptionVal
    
    puts -nonewline "BIOS Manufacturer: "
    set ManufacturerVal [$bios_info -with {Properties_ {Item Manufacturer}} Value]          
    puts $ManufacturerVal
    
    puts -nonewline "Name: "
    set NameVal [$bios_info -with {Properties_ {Item Name}} Value]          
    puts $NameVal        
    
    puts -nonewline "SMBIOSBIOSVersion: "
    set SMBIOSBIOSVersionVal [$bios_info -with {Properties_ {Item SMBIOSBIOSVersion}} Value]          
    puts $SMBIOSBIOSVersionVal
    
    puts -nonewline "Version: "
    set VersionVal [$bios_info -with {Properties_ {Item Version}} Value]          
    puts $VersionVal        

    $bios_info -destroy
}

$BIOS -destroy
$wmi -destroy

2014-08-04

Tclqrencode v0.2

更新了libqrencode 的 code base,所以版本升為 v0.2。 


連結網址:
Tclqrencode


我只有使用 Tclqrencode v0.1 這篇文章的範例進行測試,希望不會有什麼問題。

2014-07-14

Remove Itcl and Itk 3.4 if using ActiveTcl 8.6

ActiveTcl 8.6 在 Tcl\lib\teapot\package\win32-x86_64\lib 或者是 Tcl\lib\teapot\package\win32-ix86\lib 下仍然有提供 Itcl/Itk 3.4,而 Tcl/Tk 8.6 所增加的 Itcl 4 為使用 TclOO 改寫的版本。

如果怕使用上可能會造成問題,可以使用 teacup 移除:
teacup remove Itcl 3.4
teacup remove Itk 3.4

將 ITcl 3.4 與 Itk 3.4 移除,避免 ITcl 3.4 在 Tcl/Tk 8.6 環境下執行會 crash 的問題。

2014-07-01

Tcl on Windows FAQ link

Tcl on Windows FAQ


在網路上搜尋東西的時候發現的,我根據這個 FAQ 的資料,加了幾個我有興趣的 extension 的連結到部落格的右側。


另外就是最近在 Tcler's Wiki 看到的書籍資訊:
BOOK Tcl Programming for Windows

2014-06-27

Tcl Modules

Tcl Modules
TIP #189: Tcl Modules
TIP #190: Implementation Choices for Tcl Modules
TIP #191: Managing Tcl Packages and Modules in a Multi-Version Environment


A Tcl module is a package in a single file that can be sourced. (DLLs may still be embedded in that). There is no pkgIndex.tcl file, the package name and version are expressed in the module filename itself, so that version 3.14 of package foo must be named foo-3.14.tm.

"Tcl Modules" on the other hand is designed with less flexibility in mind and to allow implementations to glean as much information as possible without having to perform lots of accesses to the filesystem.

Additional benefits of the proposed design are a simplified deployment of packages, akin to the way starkits made application deployment simple, and from that an easier implementation and management of repositories.


Tcl Modules (.tm) 檔案的文件。

2014-05-17

Img extension

在 Windows 平台下,使用 ActiveTcl,可以用 teacup 來安裝:
teacup install Img

在 openSUSE,則是安裝 tkimg 這個套件就可以了。可以使用下列的指令安裝:
sudo zypper in tkimg

套件說明 @ openSUSE RPM:
This package contains a collection of image format handlers for the Tk photo image type, and a new image type, pixmaps. The provided format handlers include bmp, gif, ico, jpeg, pcx, png, ppm, ps, sgi, sun, tga, tiff, xbm, and xpm.

2014-05-14

Get Wub snapshot code

Wub snapshot tarball at https://code.google.com/p/wub/ link is "Oops, you've found a dead link." now.


所以後來只好使用 SVN 下載目前的 code base:
svn checkout http://wub.googlecode.com/svn/trunk/ wub


不知道 Wub 什麼時候會釋出新版本,不過如果要使用比 0.5 版更新的 code 來測試,之前是下載 snapshot tarball 就可以了,現在則需要使用 SVN  才行。

2014-04-22

Tcl Extension Archive (teapot)

Tcl Extension Archive


From Tcler's Wiki 的解釋:

The Tcl Extension Archive is a repository of Tcl extensions hosted by ActiveState. Both pure-Tcl and compiled extensions are included, for Windows, Unix and MacOS X platforms. The URL of the archive is http://teapot.activestate.com/


如果使用 ActiveTcl,可以使用 Tcl Extension Archive (teapot) client - Teacup 來查詢與安裝 package,比較常用的應該都可以找到。


Teapot Repos

根據 Tcler's Wiki 的資料,有下列的 Repos 可以使用:
http://teapot.activestate.com/
http://teapot.rkeene.org/
 
 
而網頁的列表,就是目前有收集的 packages。