合并静态库,请不要再用ar x了,坑啊
来源:互联网 发布:python中关键字参数 编辑:程序博客网 时间:2024/05/16 05:31
The other two are at least available when using GNU ar. You can use an MRI script (named for example libaz.mri), such as:
create libaz.aaddlib libabc.aaddlib libxyz.asaveend
and then execute ar as:
ar -M <libaz.mri=================================================================================================================================
Previous: ar cmdline,Up: ar
1.2 Controlling ar with a Script
ar -M [ <script ]If you use the single command-line option `-M' with ar, youcan control its operation with a rudimentary command language. Thisform of ar operates interactively if standard input is comingdirectly from a terminal. During interactive use, ar prompts forinput (the prompt is `AR >'), and continues executing even aftererrors. If you redirect standard input to a script file, no prompts areissued, and ar abandons execution (with a nonzero exit code)on any error.
The ar command language is not designed to be equivalentto the command-line options; in fact, it provides somewhat less controlover archives. The only purpose of the command language is to ease thetransition to gnu ar for developers who already have scriptswritten for the MRI “librarian” program.
The syntax for the ar command language is straightforward:
- commands are recognized in upper or lower case; for example,
LIST
is the same aslist
. In the following descriptions, commands areshown in upper case for clarity. - a single command may appear on each line; it is the first word on theline.
- empty lines are allowed, and have no effect.
- comments are allowed; text after either of the characters `*'or `;' is ignored.
- Whenever you use a list of names as part of the argument to an arcommand, you can separate the individual names with either commas orblanks. Commas are shown in the explanations below, for clarity.
- `+' is used as a line continuation character; if `+' appearsat the end of a line, the text on the following line is considered partof the current command.
Here are the commands you can use in ar scripts, or when usingar interactively. Three of them have special significance:
OPEN
or CREATE
specify a current archive, which isa temporary file required for most of the other commands.
SAVE
commits the changes so far specified by the script. Priorto SAVE
, commands affect only the temporary copy of the currentarchive.
ADDLIB
archiveADDLIB
archive(
module,
module, ...
module)
- Add all the contents of archive (or, if specified, each namedmodule from archive) to the current archive.
Requires prior use of
OPEN
orCREATE
. ADDMOD
member,
member, ...
member- Add each named member as a module in the current archive.
Requires prior use of
OPEN
orCREATE
. CLEAR
- Discard the contents of the current archive, canceling the effect ofany operations since the last
SAVE
. May be executed (with noeffect) even if no current archive is specified. CREATE
archive- Creates an archive, and makes it the current archive (required for manyother commands). The new archive is created with a temporary name; itis not actually saved as archive until you use
SAVE
. You can overwrite existing archives; similarly, the contents of anyexisting file named archive will not be destroyed untilSAVE
. DELETE
module,
module, ...
module- Delete each listed module from the current archive; equivalent to`ar -d archive module ... module'.
Requires prior use of
OPEN
orCREATE
. DIRECTORY
archive(
module, ...
module)
DIRECTORY
archive(
module, ...
module)
outputfile- List each named module present in archive. The separatecommand
VERBOSE
specifies the form of the output: when verboseoutput is off, output is like that of `ar -t archivemodule...'. When verbose output is on, the listing is like`ar -tv archive module...'.Output normally goes to the standard output stream; however, if youspecify outputfile as a final argument, ar directs theoutput to that file.
END
- Exit from ar, with a
0
exit code to indicate successfulcompletion. This command does not save the output file; if you havechanged the current archive since the lastSAVE
command, thosechanges are lost. EXTRACT
module,
module, ...
module- Extract each named module from the current archive, writing theminto the current directory as separate files. Equivalent to `ar -xarchive module...'.
Requires prior use of
OPEN
orCREATE
. LIST
- Display full contents of the current archive, in “verbose” styleregardless of the state of
VERBOSE
. The effect is like `artv archive'. (This single command is a gnu arenhancement, rather than present for MRI compatibility.)Requires prior use of
OPEN
orCREATE
. OPEN
archive- Opens an existing archive for use as the current archive (required formany other commands). Any changes as the result of subsequent commandswill not actually affect archive until you next use
SAVE
. REPLACE
module,
module, ...
module- In the current archive, replace each existing module (named inthe
REPLACE
arguments) from files in the current working directory. To execute this command without errors, both the file, and the module inthe current archive, must exist.Requires prior use of
OPEN
orCREATE
. VERBOSE
- Toggle an internal flag governing the output from
DIRECTORY
. When the flag is on,DIRECTORY
output matches output from`ar -tv '.... SAVE
- Commit your changes to the current archive, and actually save it as afile with the name specified in the last
CREATE
orOPEN
command.Requires prior use of
OPEN
orCREATE
.
- 合并静态库,请不要再用ar x了,坑啊
- 请不要再用MongoDB了
- 请不要再用老土的销售对白了
- 请不要再用老土的销售话术了!
- 【String实现】面试官,请不要再用Java面试题考Android开发者了!
- Java 8:不要再用循环了
- Java 8:不要再用循环了
- Java 8:不要再用循环了
- Java 8:不要再用循环了
- Java 8:不要再用循环了
- Java 8:不要再用循环了
- 大家不要再用流量软件了,害人呀!
- PHP防SQL注入不要再用addslashes和mysql_real_escape_string了
- java 判断类型instanceof,不要再用try catch了
- java8入门(三) --流,不要再用for循环了
- Java 8:新特性不要再用循环了
- 【翻译】Unity开发者们,不要再用GameObject.Find方法了!
- anaconda镜像不要再用清华的了!
- 第15周项目1-验证算法(1)
- ROS实践(6)-自建示例
- 终于开始了!
- 动态规划-股票买卖总结
- python数据分析 -- numpy库初识
- 合并静态库,请不要再用ar x了,坑啊
- mtk 修改 1-开机部分
- 搜索专题(DFS)HDU 1072-Nightmare
- RxAndroid的使用
- oracle学习之:查看用户的信息(状态、默认表空间等)
- 桌面ie图标无法删除怎么办
- VC界面美化
- 洛谷 P1724 东风谷早苗
- 使用 PropertyAttribute和PropertyDrawer