TCL/tk arm 移植

1. 下載tcl 主程式 這邊以8.4做範例
wget http://prdownloads.sourceforge.net/tcl/tcl8.4.19-src.tar.gz
2. 解壓縮它
tar xzf http://prdownloads.sourceforge.net/tcl/tcl8.4.19-src.tar.gz


3. 設定連結檔環境
cd tcl8.4.19-src/unix

設定暫時環境變數
export CROSS_COMPILE=arm-linux //编译时所用的编译器
export CC=arm-linux-gcc
export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1


./configure --prefix=$PUBLIC/tcl --target=arm-linux --host=arm-linux --build=i386-pc-linux --with-endianness=little --with-cc=arm-linux-gcc --with-ar=arm-linux-ar --with-install-prefix=../.. --with-cflags="-O0 -msoft-float -march=armv4t -mtune=arm920t -mcpu=arm920t"

make

make install

當執行 tclsh 時出現

./eggdrop: error while loading shared libraries: libtcl8.5.so: cannot open shared object file: No such file or directory

這時將 libtcl8.5.so 放到 /lib 下即可
或許在config 時加上
./configure --with-tcllib=libtcl8.5.so --with-tclinc=<path-to-tcl-inc>
可解決

../configure --prefix=$PUBLIC/tk --target=arm-linux --host=arm-linux --build=i386-pc-linux --with-endianness=little --with-cc=arm-linux-gcc --with-ar=arm-linux-ar --with-install-prefix=_install --with-cflags="-O2"

make

make install

http://www.cs.sfu.ca/CourseCentral/433/bfraser/other/2011-student-howtos/TclLameLinphone.pdf

fatal error: X11/Xlib.h: No such file or directory

./configure --prefix=~/tcl-for-arm --host=arm-linux --build=i386-pc-linux --with-endianness=little --with-cc=arm-linux-gcc --with-ar=arm-linux-ar --with-install-prefix=_install--with-cflags="-O2"
./configure --host=arm --prefix=/home/oknow/tk-for-arm --withtcl=/home/oknow/tcl-for-arm/lib/ --with-cc=arm-linux-gcc --with-ar=armlinux-ar --with-ld=arm-linux-ld --with-cflags="-O2"  --x-includes=/usr/include/X11 --x-libraries=/usr/lib/X11/

TCL 的linux官方編譯說明如下:

Configure

The configure script tests your system for different compilation and linking options and generates a Makefile. The configure script is created by GNU autoconf. There are two commonly-specified configure options:

--prefix=directory
This flag specifies the installation directory. The default is /usr/local.
--exec-prefix=directory
This flag specifies the installation directory for architecture-specific (i.e., binary) files. The default is to install architecture-specific files into the location specified by --prefix. This is typically set to a subdirectory of the main prefix, (e.g., /usr/local/solaris-sparc) for sites that want to maintain binaries for multiple architectures. If you just have a single system type, then you can ignore this option.
Note: be sure to use only absolute path names (those starting with "/") in the --prefix and --exec-prefix options.

To install into the directories /home/user/tcl/bin and /home/user/tcl/lib, for example, you should configure with:

  configure --prefix=/home/user/tcl
Tcl's configure supports several options in addition to the standard ones. Calling configure --help will list them all, but common options are:

--enable-threads
If this switch is set, Tcl will compile itself with multithreading support.
--enable-shared
If this switch is specified (the default), Tcl will compile itself as a shared library if it can figure out how to do that on this platform. Add =no will create a static build.
--enable-symbols
If this switch is specified, Tcl will build with debugging symbols.
If you wish to specify a particular compiler, set the CC environment variable before calling configure. You can also specify CFLAGS prior to configure and they will be used during compilation.
http://www.tcl.tk/doc/howto/compile.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值