Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1137779
  • 博文数量: 254
  • 博客积分: 1242
  • 博客等级: 少尉
  • 技术积分: 1581
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-03 21:49
文章分类

全部博文(254)

文章存档

2017年(16)

2016年(4)

2013年(94)

2012年(140)

分类: LINUX

2012-05-28 22:56:37

创建Tcl

 


 

Tcl下载:

expect 下载:

        

Expect 补丁下载:


Introduction to Expect

The Expect package was installed in the LFS temporary tools directory for testing other packages. These procedures install it in a prmanent location. It contains tools for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect is also useful for testing these same applications as well as easing all sorts of tasks that are prohibitively difficult with anything else.

This package is known to build and work properly using an LFS-7.1 platform.

Installation of Expect

Install Expect by running the following commands:

./configure --prefix=/usr \
                   --with-tcl=/usr/lib \
                   --with-tclinclude=/usr/include \
                   --enable-shared &&
                   make

To test the results, issue: make test.

Now, as the root user:

make install &&
ln -svf expect5.45/libexpect5.45.so /usr/lib


Command Explanations

-with-tcl=/usr/lib: This parameter is used to tell the configure script where the tclConfig.sh is located.

--enable-shared: This option enables building the shared library.

ln -sf ...: This command creates a required link to the shared library.

Configuring Expect
Config Files

$exp_library/expect.rc and ~/.expect.rc

Configuration Information

Reference the expect man page for information about utilizing the expect.rc configuration files. Additionally, many of the tools contained in the Expect package will use their own configuration files. Reference the respective man page, or examine the script directly for configuration file information.

Contents
Installed Programs: autoexpect, autopasswd, cryptdir, decryptdir, dislocate, expect, ftp-rfc, kibitz, lpunlock, mkpasswd, passmass, rftp, rlogin-cwd, timed-read, timed-run, unbuffer, weather, and optionally (if Expect was linked against Tk), expectk, multixterm, tknewsbiff, tkpasswd, xkibitz, and xpstat
Installed Library: libexpect5.45.so
Installed Directory: /usr/lib/expect5.45
Short Descriptions

autoexpect

generates an Expect script from watching a session.

autopasswd

is a wrapper to make passwd(1) be non-interactive.

cryptdir

encrypts all files in a directory.

decryptdir

decrypts all files in a directory.

dislocate

allows processes to be disconnected and reconnected to a terminal.

expect

is a program that “talks” to other interactive programs according to a script.

ftp-rfc

retrieves an RFC (or the index) from UUNET.

kibitz

allows two (or more) people to interact with one shell (or any arbitrary program).

lpunlock

unhangs a printer which claims it is “waiting for lock”.

mkpasswd

generates passwords and can apply them automatically to users.

passmass

changes a password on multiple machines.

rftp

is much like ftp except it uses ~g and ~p instead of mget and mput.

rlogin-cwd

is rlogin except it uses the local current directory as the current working directory on the remote machine.

timed-read

reads a complete line from stdin and aborts after a given number of seconds.

timed-run

runs a program for a given amount of time.

unbuffer

disables the output buffering that occurs when program output is redirected.

weather

retrieves a weather report (courtesy University of Michigan) for a given city or geographical area.

expectk

is a combination of Expect with Tk and should run any wish or Expect script.

multixterm

creates multiple xterms that can be driven together or separately.

tknewsbiff

pops up a window when there is unread news in your favorite newsgroups and removes the window after you've read the news.

tkpasswd

is a script to change passwords using expectk.

xkibitz

allows users in separate xterms to share one shell (or any program that runs in an xterm).

xpstat

is a script that acts as a front-end for xpilot.

libexpect5.45.so

contains functions that allow Expect to be used as a Tcl extension or to be used directly from C or C++ (without Tcl).

其他参照:

 

解压缩源代码包,并进入源代码目录:

 

    #tar -zvxf tcl8.4.19-src.tar.gz

    #cd tcl8.4.19

 

现在为创建Tcl作准备工作:

 

    #cd unix

    #./configure --prefix=/usr/tcl

 

开始创建:

 

    #make

 

安装:

 

    #make install

 

安装完毕以后,进入tcl源代码的根目录,把子目录unix下面的tclUnixPort.h copy到子目录generic中。暂时不要删除tcl源代码,因为expect的安装过程还需要用。

 

 

创建Expect

 

    首先解压缩源代码,进入源代码目录:

 

    #tar -zvxf expect-5.39.0.tar.gz

    #cd expect-5.39

 

打补丁,修Bug

 

    #patch -Np1 -i ../expect-5.39.0-spawn-1.patch

 

作准备工作:

 

    #./configure --prefix=/usr/expect --with-tcl=/usr/tcl/lib --with-x=no --with-tclinclude=/tmp/tcl/tcl8.4.19/generic/

 

各选项的含义是:

 

    --with-tcl=/usr/tcl/lib

    告诉configure脚本,Tcl解释器在哪里。这里要用刚刚创建的Tcl,否则就会使用你系统的Tcl了。

 

    --with-tclinclude=/tmp/tcl/tcl8.4.19/generic

    告诉configure脚本,Tcl的头文件位置。

 

    --with-x=no

    不使用X图形系统支持,因为没有TkTcl的图形用户界面组件)。

 

开始创建:

 

    #make

 

安装:

 

    #make install
阅读(3481) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~