Ads 468x60px


24 5月, 2013

編譯arm 使用的 tcl

1. 下載tcl 主程式 這邊以8.4做範例
2. 解壓縮它
tar xzf

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 install

當執行 tclsh 時出現

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

這時將 放到 /lib 下即可
或許在config 時加上
./configure --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 install

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官方編譯說明如下:


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:

This flag specifies the installation directory. The default is /usr/local.
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:

If this switch is set, Tcl will compile itself with multithreading support.
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.
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.

0 意見:


Blogger Templates