BBS水木清华站∶精华区

发信人: Watson (华生医生), 信区: Linux 
标  题: UNIX 下 irc client 的编译过程傻瓜书 (fwd) 
发信站: BBS 水木清华站 (Wed May 20 19:40:08 1998) WWW-POST 
 
发 表 人:Iam_Sh@bbs.ustc.edu.(沉默的雨衣) 版面名称:main[7884] 
文章提要:UNIX 下 irc client 的编译过程傻瓜书  
源 发 站:中国科大BBS站(Fri, 17 Apr 1998 09:30:56) 
 
在写这个简介之前, 作者认为读者已经知道如何通过FTP去下载一个文件. 在USTC,  
可以通过 http://202.38.75.11/cgi-bin/myarchie 查询到在如下的服务器上有UNIX  
下的 irc 客户程序(irc client), 其中有些是源码, 有些是可执行代码. 这里不推荐  
使用可执行代码, 因为它是在特定的UNIX上编译的, 并不能适合所有的UNIX平台.  
 
ftp://166.111.4.80 
 
可以查询到:  
ftp://202.38.75.11/pub/Linux/irc/irc-2.8.2.bin.tar.gz  
ftp://202.38.75.11/pub/Linux/irc/ircii-2.8.2-src.tgz  
ftp://ftp.ustc.edu.cn/.pubold/ustcnet/unix/irc/irc-2.8.2-ix86-linux-bin.tgz  
ftp://ftp.ustc.edu.cn/.pubold/ustcnet/unix/irc/ircii-2.8.2-src.tgz  
等等.  
 
下面作者把自己的步骤详细地说一下.  
 
首先我从 75.11 下载了 ircii-2.8.2-src.tgz 到我的当前目录 /usr/people/sh,  
(通过 pwd 命令可以知道自己的当前目录是什么), 然后我创建了 tmp 这个临时目录存  
放这个文件以及即将编译生成的文件, 下面:(注意, $ 在这里是提示符, 就象 DOS 下  
的 c:\ 一样)  
 
这些是我加的注释, 不必键入  
$ cp ircii-2.8.2-src.tgz tmp # 拷贝文件  
$ cd tmp # 进入目录  
$ gzip -d ircii-2.8.2-src.tgz # 将压缩文件解开  
$ tar xvf ircii-2.8.2-src.tar # 将打包文件解开  
 
最后一步, 会有如下类似的信息输出:  
ircii-2.8.2/  
ircii-2.8.2/doc/  
ircii-2.8.2/doc/BUGS  
ircii-2.8.2/doc/Copyright  
ircii-2.8.2/doc/HISTORY  
(后面略去)  
 
然后我得到了目录 ircii-2.8.2, 然后  
$ cd ircii-2.8.2  
$ ./configure --prefix=/usr/people/sh # 这是检测软件  
 
会有类似的输出:  
creating cache ./config.cache  
this is ircii version 2.8.2  
checking for gcc... gcc  
(中间略去)  
creating ./config.status  
creating Makefile  
creating source/Makefile  
creating include/defs.h  
well there we are, you now might want to look in include/config.h  
and see if there is anything you might want to tune, else you can  
just run a make here.. good luck!  
 
这就表示 configure 通过了.  
 
这里, 我想把编译生成的 irc 可执行代码放置在由 prefix 指定的目录下. 如果  
不写 --prefix=....., 那么程序会默认安装在 /usr/local 这个目录下. 然后,  
 
$ make # 编译  
 
如果在 configure 时没有加 prefix 参数, 在这里也可以加, 用 make prefix=...  
 
现在我看到了很多的输出:  
 
rm -f count.c  
lex count.l  
(后面略去)  
没有出现 error 或是 warning, 我很幸运 :), 然后,  
$ make install # 安装  
 
输出是:  
`ircserv' is up to date.  
`ircflush' is up to date.  
`wserv' is up to date.  
(后面略去)  
 
还是没出现 error 或是 warning, en? 这不是什么好事, 有了错误才能学到东西嘛~  
然后, 我去看编译生成的结果:  
 
$ cd /usr/people/sh # 到 prefix 指定的目录下  
$ ls -lF  
输出:  
total 2  
drwxr-xr-x 2 sh lion 512 Apr 17 08:45 bin/  
drwxr-xr-x 3 sh lion 512 Apr 17 08:45 lib/  
 
$ cd bin  
$ ls -lF  
输出:  
total 1957  
lrwxr-xr-x 1 sh lion 42 Apr 17 08:45 irc -> /usr/people/sh/  
bin/irc-2.8.2*  
-rwxr-xr-x 1 sh lion 823776 Apr 17 08:45 irc-2.8.2*  
-rwxr-xr-x 1 sh lion 59380 Apr 17 08:45 ircflush*  
-rwxr-xr-x 1 sh lion 61992 Apr 17 08:45 ircserv*  
-rwxr-xr-x 1 sh lion 55420 Apr 17 08:45 wserv*  
 
$ cd ../lib  
$ ls -lF  
输出:  
total 1  
drwxr-xr-x 4 sh lion 512 Apr 17 08:45 irc/  
 
$ cd irc  
$ ls -lF  
输出:  
total 3  
drwxr-xr-x 2 sh lion 1024 Apr 17 08:45 script/  
drwxr-xr-x 2 sh lion 512 Apr 17 08:45 translation/  
 
现在可以说已经成功了 99% 了, 剩下的还有:  
1. 需要一个联机帮助, 它可以从 75.11 上下载, 我得到了它:  
ircii-2.8help.tar.gz  
 
然后,  
$ cd /usr/people/sh/lib/irc  
$ gzip -d ircii-2.8help.tar.gz  
$ tar xvf ircii-2.8help.tar  
我得到了一个新的目录 help, 下面存放了这个客户程序所需要的帮助信息.  
 
2. 需要一个资源文件, 我在 script 目录下发现了一个 ircrc, 我把它  
拷贝到我的根目录 /usr/people/sh:  
$ cp /usr/people/sh/lib/irc/script/ircrc ~/.ircrc  
******** 现在我可以用了! ********  
$ /usr/people/sh/bin/irc sh 202.38.64.3  
 
这样每次敲太繁, 可以把 /usr/people/sh/bin 加到启动时的配置文件里去, 这里不赘  
述. 命令行里的第二项是聊天时的代号, 最后一项是 IRC 服务器的 IP.  
**** 注意 ****  
 
这个缺省的 .ircrc 不是很好, 它还没有设置完整. 下文, 我将给出我的 .ircrc  
例子.  
 
**** 感受 ****  
IRC 别的好处我且不谈, 只说一句:  
当我在 PBBS 里苦苦地等待着那缓慢的,间歇的输出的时候, 我欣喜地发现在IRC里,  
这种停顿 *似乎* 并不存在. :)  
欢迎大家使用 IRC 来聊天!  
--  
※ 来源: 中国科大BBS站 [bbs.ustc.edu.cn]  
 
 
-- 
台湾 BBS Linux 精华 (97.11.版) 
SMTH-Linux/Unix/XWindow 版在线 Mirror ! (还要哪些版 ? :-) 
Web Linux 专栏: http://tarn.Cathay.ml.org/linuxboard 
SSH for Windows (4ever), Cathay DNS 名字服务, Archie, ... 
在: http/ftp://tarn.Cathay.ml.org       /me 的签名档收不下了...自个儿去看吧 
 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: linux.ustc.edu.cn]  

BBS水木清华站∶精华区