轻重缓急

成功来源于有效的自我管理。
随笔 - 14, 文章 - 3, 评论 - 3, 引用 - 0
数据加载中……

How to use ar comman under AIX system

The ar command maintains the indexed libraries used by the linkage editor.
ar 命令可用于维护 indexed libraries, indexed libraries通常被链接器使用, 用于和其它object文件进行链接.
The ar command combines one or more named files into a single archive file written in ar archive format.
ar命令组合一个或者多个命名的文件到单个归档文件

 In an ar command, you can specify any number of optional flags from the set cClosTv.
ar命令可以指定参数集cClosTv中的0或多个.
You must specify one flag from the set of flags dhmopqrstwx.
ar命令必须指定参数集dhmopqrstwx中的1或多个.

If you select the -m or -r flag, you may also specify a positioning flag (-a, -b, or -i);
如果你指定了-m or -r, 你也许需要指定(-a, -b, or -i)

for the -a, -b, or -i flags, you must also specify the name of a file within ArchiveFile (PositionName), immediately following the flag list and separated from it by a blank.

如果指定了 -a -b -i,你一定要指定一个在归档文件中的命名文件(即已经归档的object文件名)
并且用空格分隔归档文件名和命名文件名.

//第一类
-m 移到一个已经归档的object文件到某个位置.默认为移动到最后.你可以使用 -a -b -i 指定位置.
-a  移到一个已经归档的object文件到指定object文件之后
-b  移到一个已经归档的object文件到指定object文件之后
-i  移到一个已经归档的object文件到指定object文件之后,和-b相同.

//第二类
-d 删除一个已经归档的object文件
-r  替换一个已经归档的object文件.
    如果不存在就加入, 你可以通过abi指定位置, 可以默认加到最后.
-q    把一个object文件加到归档文件最后,如果你加入两次,归档文件中就会存在两次,它不会替换旧的.

//第三类
-c 压制信息输出
-v 把库的详细内容输出到标准输出.


/*以下两个不长用*/
-C Prevents extracted files from replacing like-named files in the file system.
-T本用于把长文件名截断, 但已经无用.

//第四类
-l  把此命令的临时文件放到指定位置.
-x 拷贝命名文件夹到当前目录, 如果不指定, 它会拷贝所有文件到当前目录.
-z 在ar命令工作期间,使用临时拷贝,而不是源库, 当ar命令结束时,使用临时拷贝替换源库.

//第五类
-p
-h 更新时间
-t 把库的内容写到标准输出.
-w 显示符号表, 每个符号都显示所属文件名

//第六类
-s 强制重新生成符号表.不论当前的ar命令是否改变了归档文件.
-u 只拷贝最近更新的文件.

-X mode
   指定ar 命令应当检查的object 文件的类型,
   32
   64
   32_64
   默认为32, 你也可能通过学习OBJECT_MODE环境变量来指定.


Usage: {}必选一个   []可选.

        ar [-X{32|64|32_64|d64|any}] [-clsvCT] [-g|o] {-h|p|t|x}
                [--] Archive [File ...]
        ar [-X{32|64|32_64|d64|any}] [-clsvCT] [-g|o] {-m|r[u]}
                [{-a|b|i} {PositionName}] [--] Archive File ...
        ar [-X{32|64|32_64|d64|any}] [-clsvCT] [-g|o] {-d|q}
                [--] Archive File ...
        ar [-X{32|64|32_64|d64|any}] [-clvCT] {-g|o|s|w} [--] Archive



ar -X64 -t libifms.a
显示库的内容.like ls

ar -X64 -vt libifms.a
显示库的详细内容like ls-l

ar -X64 -w libifms.a string.o
显示符号表.


   
   




 

posted on 2008-02-19 12:25 随遇而安 阅读(1158) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理