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

沒有留言: