Ads 468x60px

##EasyReadMore##

24 5月, 2013

編譯arm 使用的 tcl

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

0 意見:

張貼留言

 
Blogger Templates