1 .\" You may copy, distribute and modify under the terms of the LDP General
2 .\" Public License as specified in the LICENSE file that comes with the
3 .\" gnumaniak distribution
5 .\" The author kindly requests that no comments regarding the "better"
6 .\" suitability or up-to-date notices of any info documentation alternative
7 .\" is added without contacting him first.
9 .\" (C) 1999-2002 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
12 .\" man pages are NOT obsolete!
13 .\" <ragnar@ragnar-hojland.com>
15 .\" Japanese Version Copyright (c) 2000-2003 Yuichi SATO
16 .\" all rights reserved.
17 .\" Translated Mon Jun 5 02:20:58 JST 2000
18 .\" by Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
19 .\" Updated & Modified Sat Mar 1 23:41:22 JST 2003
20 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
23 .\"WORD: compiler コンパイラー
25 .\"WORD: executable 実行ファイル
27 .\"WORD: dlopen ダイナミックロード
28 .\"WORD: dlopening support ダイナミックロード機能
30 .\"WORD: library ライブラリ
33 .\"WORD: partial linking 部分リンク
35 .TH LIBTOOL 301 "June 2002" "libtool 1.4.2"
37 .\"O \fBlibtool\fR \- compile, build, install and uninstall libraries
39 \fBlibtool\fR \- ライブラリのコンパイル・ビルド・
50 .RB [ \-\-mode=\fIMODE ]
55 .\"O Link Mode: [\fB\-l\fINAME\fR] [\fB\-o \fI OUTPUT\-FILE\fR] [\fB\-L\fILIBDIR\fR]
56 リンクモード: [\fB\-l\fINAME\fR] [\fB\-o \fI OUTPUT\-FILE\fR] [\fB\-L\fILIBDIR\fR]
59 .RB [ \-avoid\-version ]
60 .RB [ "\-dlopen \fIFILE" ]
61 .RB [ "\-dlpreopen \fIFILE" ]
62 .RB [ \-export\-dynamic ]
63 .RB [ "\-\-export\-symbols \fIFILE" ]
64 .RB [ "\-\-export\-symbols \fIREGEX" ]
66 .RB [ \-no\-undefined ]
67 .RB [ "\-release \fIRELEASE" ]
68 .RB [ "\-rpath \fILIBDIR" ]
70 .RB [ "\-version\-info \fICURRENT\fR[\fB:\fIREVISION\fR[\fB:\fIAGE" ]]
72 .\"O Execute Mode: [\fB\-dlopen \fIFILE\fR]
73 実行モード: [\fB\-dlopen \fIFILE\fR]
75 .BR libtool " [" \-\-features "] [" \-\-help "] [" \-\-version ]
79 .\"O simplifies the complexity of compiling, linking, installing and unistalling
80 .\"O both static and shared libraries so that the complete functionality of
81 .\"O different platforms is available via a generic interface but nasty quirks
82 .\"O are hidden from the programmer.
85 コンパイル・リンク・インストール・アンインストールの複雑さを簡略化する。
86 異なるプラットフォームそれぞれで、完全な機能を
87 統一的なインターフェースを介して使用することができ、
88 プラットフォーム固有の厄介な癖はプログラマーから隠蔽される。
91 .\"O can operate in six modes: compile, execute, link, finish, install, uninstall.
93 はコンパイル・実行・リンク・フィニッシュ・インストール・アンインストール
97 .\"O For \fBcompile\fR mode, \fIMODE\-ARGS\fR is a compiler command to be used in
98 .\"O creating a standard object file. These arguments should begin with
99 .\"O the name of the C compiler, and contain the \fB\-c\fR compiler flag so that
100 .\"O only an object file is created.
101 \fBコンパイル\fRモードの場合、\fIMODE\-ARGS\fR は
102 標準的なオブジェクトファイルを作成するために使われる
104 これらの引き数は C コンパイラの名前で始まり、
106 \fB\-c\fR コンパイラフラグを含んでいなければならない。
108 .\"O \fBlibtool\fR determines the name of the output file by removing the
109 .\"O directory component from the source file name, then substituting the C
110 .\"O source code suffix `.c' with the library object suffix, `.lo'.
111 \fBlibtool\fR は出力ファイルの名前を決定するとき、
112 ソースファイル名からディレクトリ構成要素を取り除き、
113 それから C 言語のソースコードの拡張子 `.c' をライブラリオブジェクトの
114 拡張子 `.lo' に置き換えるという方法を用いる。
116 .\"O If shared libraries are being built, any necessary PIC generation
117 .\"O flags are substituted into the compilation command. The \fB\-static\fR
118 .\"O option will cause \fBlibtool\fR to generate `.o' files even if it was
119 .\"O configured with \fB\-\-disable\-static\fR
120 共有ライブラリがビルドされる場合、必要な PIC 作成フラグすべてが
122 \fB\-static\fR オプションを指定すると、たとえ \fB\-\-disable\-static\fR が
123 設定されていたとしても、\fBlibtool\fR は `.o' ファイルを作成する。
125 .\"O The \fB\-o\fR option is emulated on platforms that don't support it directly
126 .\"O (by locking and moving the object files generated by the compiler) so you
127 .\"O can use the usual syntax:
128 \fB\-o\fR オプションが直接サポートされていないプラットフォーム上では
129 (コンパイラによって作成されたオブジェクトファイルのロックと移動により)
131 したがって、以下のような通常の構文を使うことができる。
135 lightside:% libtool cc -c foo/x.c -o foo/x.lo
139 .\"O If the platform doesn't support \fB\-c\fR and \fB\-o\fR then it is
140 .\"O impossible to build `foo/x.lo' without overwriting an old `foo/x.o', and
141 .\"O that in this case you must make sure `foo/x.o' is (re)built after `foo/x.lo'
142 プラットフォームが \fB\-c\fR と \fB\-o\fR オプションをサポートしていない場合、
143 古い `foo/x.o' を上書きせずに `foo/x.lo' をビルドすることはできない。
144 この場合、`foo/x.o' が `foo/x.lo' の後に (再) ビルドされることを
149 .\"O \fBlink\fR mode links together object files (including library objects)
150 .\"O to form another library or to create an executable program.
151 \fBリンク\fRモードはライブラリや実行可能プログラムを作成するために、
152 オブジェクトファイル (ライブラリオブジェクトも含む) をリンクする。
154 .\"O \fIMODE\-ARGS\fR consist of a command using the C compiler to create an
155 .\"O output file \fIOUTPUT\-FILE\fR (with the \fB\-o\fR flag) from several object
156 .\"O files. The type of file depends on the extension of \fIOUTPUT\-FILE\fR:
157 \fIMODE\-ARGS\fR は、C コンパイラがオブジェクトファイルから
158 (\fB\-o\fR フラグにより) 出力ファイル \fIOUTPUT\-FILE\fR を作成する
160 以下のように、ファイルの形式は \fIOUTPUT\-FILE\fR の拡張子に依存する。
163 .\"O A libtool library is created, which must be built only from library objects
164 .\"O (`.lo' files). The \fB\-rpath\fR option is required. In the current
165 .\"O implementation, libtool libraries may not depend on other uninstalled
166 .\"O libtool libraries.
168 このライブラリはライブラリオブジェクト (`.lo' ファイル)
170 \fB\-rpath\fR オプションが必要である。
171 現在の実装では、libtool ライブラリはアンインストールされた他の
172 libtool ライブラリに依存できない。
175 .\"O A standard library is created using \fBar\fR(1) and possibly \fBranlib\fR(1).
176 \fBar\fR(1) と (あるいは) \fBranlib\fR(1) を使って
180 .\"O A reloadable object file is created from the input files (generally using
181 .\"O `ld \-r'). This method is often called ``partial linking''.
182 (一般には `ld \-r' を使うことで) 入力ファイルから
183 再ロード可能なオブジェクトファイルが作成される。
184 この手法は ``部分リンク'' と呼ばれることが多い。
187 .\"O An executable program is created.
189 .\"O .SS Execute Mode
191 .\"O For \fBexecute\fR mode, the library path environment variable is
192 .\"O automatically set (and modified according \fB\-dlopen\fR), then a program
194 \fB実行\fRモードでは、ライブラリパスの環境変数が自動的にセットされ
195 (そして \fB\-dlopen\fR によって修正されて)、プログラムが実行される。
197 .\"O The first of the \fIMODE-ARGS\fR is treated as a program name, with the
198 .\"O rest as arguments to that program.
199 一番目の \fIMODE-ARGS\fR はプログラム名として扱われ、
202 .\"O If any of the arguments are libtool executable wrappers, then they are
203 .\"O translated into the name of their corresponding uninstalled binary, and
204 .\"O any of their required library directories are added to the library path.
205 引数の中のどれかが libtool 実行ファイルのラッパーであった場合、
206 その引数はそれぞれ対応するアンインストール済みバイナリの名前に変換される。
207 このとき、必要とされるライブラリディレクトリがライブラリパスに加えられる。
208 .\"O .SS Install Mode
210 .\"O In \fBinstall\fR mode, libtool interprets \fIMODE\-ARGS\fR as an installation
211 .\"O command beginning with \fBcp\fR(1), or a BSD-compatible \fBinstall\fR(1)
213 \fBインストール\fRモードでは、\fIMODE\-ARGS\fR を
214 \fBcp\fR(1) もしくは BSD-互換の \fBinstall\fR(1) から始まる
217 .\"O The rest of the \fBMODE\-ARGS\fR are interpreted as arguments to that
219 残りの \fBMODE\-ARGS\fR は、インストールコマンドの
222 .\"O The command is run, and any necessary unprivileged post-installation
223 .\"O commands are also completed.
225 インストール後の処理に必要な非特権コマンドもすべて完了する。
228 .\"O \fBfinish\fR mode helps system administrators install libtool libraries
229 .\"O so that they can be located and linked into user programs.
230 \fBフィニッシュ\fRモードは、システム管理者の libtool ライブラリ
231 インストール作業を補助し、 libtool ライブラリの探索およびユーザー
234 .\"O Each \fIMODE\-ARG\fR is interpreted as the name of a library directory.
235 .\"O Running this command may require superuser privileges, so the
236 .\"O \fB\-\-dry\-run\fR option may be useful.
237 \fIMODE\-ARG\fR はライブラリディレクトリ名として解釈される。
238 このコマンドを実行するのにはスーパーユーザー特権が必要なため、
239 \fB\-\-dry\-run\fR オプションを使うと便利だろう。
240 .\"O .SS Uninstall Mode
242 .\"O This mode deletes installed libraries (and other files).
243 このモードではインストールされたライブラリ (もしくはファイル) を削除する。
245 .\"O The first \fIMODE\-ARG\fR is the name of the program to use to delete files
246 .\"O (typically `/bin/rm').
247 一番目の \fIMODE\-ARG\fR はファイルを削除するためのプログラム名
248 (一般には `/bin/rm') である。
250 .\"O The remaining \fIMODE\-ARGS\fR are either flags for the deletion program
251 .\"O (beginning with a `\-'), or the names of files to delete.
252 残りの \fIMODE\-ARGS\fR は削除プログラムの (`\-' で始まる) フラグもしくは、
256 .\"O .SS Global Options
260 .\"O Display libtool's configuration variables and exit.
261 libtool の設定変数を表示して終了する。
264 .\"O Enables shell script trace mode, writing to standard output.
265 シェルスクリプトのトレースモードを有効にして、標準出力に書き出す。
268 .\"O Don't create, modify, or delete any files, just show what commands
269 .\"O would be executed by \fBlibtool\fR.
270 ファイルの作成・修正・削除を行わず、\fBlibtool\fR によってどのような
274 .\"O Displays basic features regarding libtool and whether static and shared
275 .\"O library support is enabled.
277 .\"O sato: この後にも features オプションの説明があったりする...
279 libtool の基本的な特徴を表示する。
280 また静的ライブラリと共有ライブラリが有効になっているかを表示する。
283 .\"O Same as \fB\-\-mode=finish\fR.
284 \fB\-\-mode=finish\fR と同じ。
287 .\"O Use \fIMODE\fR as the operation mode. By default, the
288 .\"O operation mode is inferred from the contents of \fIMODE\-ARGS\fR.
289 .\"O If \fIMODE\fR is specified, it must be one of the following:
290 \fIMODE\fR をオペレーションモードとする。
291 デフォルトでは、オペレーションモードは \fIMODE\-ARGS\fR の内容から推論される。
292 \fIMODE\fR を指定する場合、次のうちの一つでなければならない。
296 .\"O Compile a source file into a libtool object.
297 ソースファイルを libtool オブジェクトにコンパイルする。
300 .\"O Automatically set the library path so that another program
301 .\"O can use uninstalled libtool-generated programs or libraries.
302 他のプログラムがアンインストールされたプログラムやライブラリ
303 (libtool により作成されたもの) を使うことができるように、
307 .\"O Complete the installation of libtool libraries on the system.
308 システムへの libtool ライブラリのインストールを完了する。
311 .\"O Install libraries or executables.
312 ライブラリや実行ファイルをインストールする。
315 .\"O Create a library or an executable.
319 .\"O Delete installed libraries or executables.
324 .\"O Display libtool configuration information and exit. This provides
325 .\"O a way for packages to determine whether shared or static libraries will be
327 libtool の設定情報を表示して終了する。
328 このオプションを使うと、パッケージは共有ライブラリと静的ライブラリの
332 .\"O Print a usage message on standard output and exit successfully. If
333 .\"O \fB\-\-mode=\fIMODE\fR is specified, help on selected mode is printed.
334 使用法のメッセージを標準出力に表示して、正常終了する。
335 \fB\-\-mode=\fIMODE\fR が指定されている場合は、
336 指定されたモードについてのヘルプが表示される。
339 .\"O Print version information on standard output then exit successfully.
340 バージョン情報を標準出力に表示して、正常終了する。
341 .\"O .SS Link Mode Options
345 .\"O \fIOUTPUT\-FILE\fR requires the installed library \fBlib\fINAME\fR. This
346 .\"O option is required even when \fIOUTPUT\-FILE\fR is not an executable.
347 \fIOUTPUT\-FILE\fR はインストール済みの
348 ライブラリ \fBlib\fINAME\fR を必要とする。
349 このオプションは \fIOUTPUT\-FILE\fR が実行ファイルでなくても必要とされる。
351 .B \-o \fIOUTPUT\-FILE
352 .\"O Create \fIOUTPUT\-FILE\fR from the specified objects and libraries.
353 指定したオブジェクトとライブラリから \fIOUTPUT\-FILE\fR を作成する。
356 .\"O Search \fILIBDIR\fR for required libraries that have already been installed.
357 必要なインストール済みライブラリを \fILIBDIR\fR から検索する。
360 .\"O If \fIOUTPUT\-FILE\fR is an executable, add \fILIBDIR\fR to its run-time
361 .\"O path. If \fIOUTPUT-FILE\fR is a library, add `-RLIBDIR' to its
362 .\"O \fBDEPENDENCY_LIBS\fR so that, whenever the library is linked into an
363 .\"O executable, \fILIBDIR\fR will be added to its run-time path.
364 \fIOUTPUT\-FILE\fR が実行ファイルの場合は \fILIBDIR\fR を実行時パスに加える。
365 \fIOUTPUT\-FILE\fR がライブラリの場合は
366 `-RLIBDIR' を \fBDEPENDENCY_LIBS\fR に加える。
367 これは、そのライブラリが実行ファイルにリンクされるときに必ず
368 \fILIBDIR\fR を実行ファイルの実行時パスに加えるためである。
371 .\"O If \fIOUTPUT\-FILE\fR is a program, then do not link it against any
372 .\"O shared libraries at all. If \fIOUTPUT-FILE\fR is a library, then only
373 .\"O create a static library.
374 \fIOUTPUT\-FILE\fR がプログラムの場合は、
375 そのプログラムをどの共有ライブラリともリンクさせない。
376 \fIOUTPUT\-FILE\fR がライブラリの場合は静的ライブラリを作成するのみである。
379 .\"O Tries to avoid using any kind of versioning (no version info is stored and
380 .\"O no symbolic links are created). This option has no effect on platforms which
381 .\"O require versioning.
383 (バージョン情報は組み込まれず、シンボリックリンクも作られない)。
384 このオプションはバージョニングを必要とするプラットホーム上では働かない。
387 .\"O Same as \fB\-dlpreopen \fIFILE\fR, if native dlopening is not
388 .\"O supported on the host platform or if the executable is linked using
389 .\"O \fB\-static\fR or \fB\-all\-static\fR. Otherwise, no effect.
391 ダイナミックロードがサポートされていない場合や、
392 実行ファイルが \fB\-static\fR や \fB\-all\-static\fR を
393 使ってリンクされる場合は、\fB\-dlpreopen \fIFILE\fR と同じ。
396 .\"O If \fIFILE\fR is `self', then libtool will make sure that the executable can
397 .\"O \fBdlopen\fR(3) itself by using \fB\-export\-dynamic\fR or \fB\-dlpreopen\fR.
398 \fIFILE\fR が `実行ファイル自身' であった場合、
399 libtool は実行ファイルが \fB\-export\-dynamic\fR や
400 \fB\-dlpreopen\fR を使って自らを \fBdlopen\fR(3) できるかを確かめる。
402 .B \-dlpreopen \fIFILE
403 .\"O Link \fIFILE\fR into the output program, and add its symbols to
404 .\"O \fBLT_PRELOADED_SYMBOLS\fR.
405 \fIFILE\fR を出力プログラムにリンクし、そのシンボルを
406 \fBLT_PRELOADED_SYMBOLS\fR に加える。
408 .\"O If \fIFILE\fR is `self', then the symbols of the output program itself will
409 .\"O be added to \fBLT_PRELOADED_SYMBOLS\fR.
410 \fIFILE\fR が `出力プログラム自身' であった場合、
411 出力プログラム自身のシンボルが \fBLT_PRELOADED_SYMBOLS\fR に加えられる。
414 .\"O Allow symbols from \fIOUTPUT\-FILE\fR to be resolved with \fBdlsym\fR(3).
415 \fIOUTPUT\-FILE\fR のシンボルを \fBdlsym\fR(3) を使って解決できるようにする。
417 .B \-export\-symbols \fIFILE
418 .\"O On platforms which support it, the linker will only export symbols listed in
419 .\"O \fIFILE\fR. The name of \fIFILE\fR must end in `.sym' and contain on symbol
420 .\"O per line. By default all symbols are exported.
421 これをサポートしているプラットホーム上では、
422 リンカは \fIFILE\fR にリストされているシンボルのみをエクスポートする。
423 \fIFILE\fR の名前は `.sym' で終っていなければならず、
424 1 行に 1 つのシンボルを含んでいなければならない。
425 デフォルトではすべてのシンボルがエクスポートされる。
427 .B \-export\-symbols\-regex \fIREGEX
428 .\"O As \fB\-export\-symbols\fR, except that only symbols that match the
429 .\"O \fIREGEX\fR \fBregex\fR(7) are exported.
430 \fIREGEX\fR \fBregex\fR(7) にマッチするシンボルのみがエクスポートされる以外は
431 \fB\-export\-symbols\fR と同じ。
434 .\"O Creates a library that can be dlopened. Module names don't need to be
435 .\"O prefixed with `lib', however in order to prevent name clashes `libname' and
436 .\"O `name' must not be used at the same time in your package.
437 ダイナミックロードできるライブラリを作成する。
438 モジュール名は `lib' で始まる必要はないが、
439 名前の衝突を避けるため `libname' と `name' はパッケージの中で
443 .\"O Declare that \fIOUTPUT\-FILE\fR does not depend on any other libraries.
444 .\"O Some platforms cannot create shared libraries that depend on other
446 \fIOUTPUT\-FILE\fR が他のライブラリに依存していないことを宣言する。
447 他のライブラリに依存する共有ライブラリを作れないプラットホームもある。
449 .B \-release \fIRELEASE
450 .\"O Specify that the library was generated by release \fIRELEASE\fR of your
451 .\"O package, so that users can easily tell which versions are newer
452 .\"O than others. Be warned that no two releases of your package will
453 .\"O be binary compatible if you use this flag. If you want binary
454 .\"O compatibility, use the \fB\-version\-info\fR flag.
455 ライブラリがパッケージのリリース \fIRELEASE\fR で作られたことを指定する。
456 これによって、ユーザーはどのバージョンが他のものより新しいかを
458 このフラグを使うと、パッケージの各リリースのいかなるペアの間にも
460 バイナリ互換にしたい場合は、\fB\-version\-info\fR フラグを使うこと。
463 .\"O If \fIOUTPUT\-FILE\fR is a library, it will eventually be installed in
465 \fIOUTPUT\-FILE\fR がライブラリの場合、
466 最終的に \fILIBDIR\fR にインストールされる。
469 .\"O If \fIOUTPUT\-FILE\fR is a program, then do not link it against any
470 .\"O uninstalled shared libtool libraries. If \fIOUTPUT\-FILE\fR is a
471 .\"O library, then only create a static library.
472 \fIOUTPUT\-FILE\fR がプログラムの場合、
473 アンインストールされた共有 libtool ライブラリはリンクしない。
474 \fIOUTPUT\-FILE\fR がライブラリの場合、
477 .B \-version\-info \fICURRENT\fR[\fB:\fIREVISION\fR[\fB:\fIAGE\fR]]
478 .\"O If \fIOUTPUT\-FILE\fR is a libtool library, use interface version
479 .\"O information \fICURRENT\fR, \fIREVISION\fR, and \fIAGE\fR to build it
480 .\"O Do \fBnot\fR use this flag to specify package release information, rather
481 .\"O see the \fR\-release\fB flag.
482 \fIOUTPUT\-FILE\fR が libtool ライブラリであるとき、
483 ライブラリをビルドするためにインターフェースバージョン情報
484 \fICURRENT\fR, \fIREVISION\fR, \fIAGE\fR を使う。
485 パッケージのリリース情報を指定するために、
486 このオプションを使っては\fBいけない\fR。
487 むしろ \fB\-release\fR フラグを参照すべきである。
488 .\"O .SS Execute Mode Options
492 .\"O Add the directory containing \fIFILE\fR to the library path.
493 \fIFILE\fR を含んでいるディレクトリをライブラリパスに加える。
497 .\"O has it's own versioning system for shared libraries. If you want to use this
498 .\"O system, you must use the \fB\-version\-info\fR option. This option accepts
499 .\"O an argument of the form \fICURRENT\fR[\fB:\fIREVISION\fR[\fB:\fIAGE\fR]]
501 は共有ライブラリ用に独自のバージョニングシステムを持っている。
502 このシステムを使いたい場合は、\fB\-version\-info\fR オプションを
505 \fICURRENT\fR[\fB:\fIREVISION\fR[\fB:\fIAGE\fR]]
509 .\"O Interface version, understanding interface as anything visible to the
510 .\"O "outside" world: variables, function prototypes, output format, etc.
511 インターフェースのバージョン。インターフェースとは
513 変数・関数プロトタイプ・出力形式などである。
516 .\"O Implementation version, relative to \fICURRENT\fR version.
517 \fICURRENT\fR からの相対値で与える実装のバージョン。
520 .\"O The difference between the newest and oldest interfaces that this
521 .\"O library implements. In other words, the library implements all the
522 .\"O interface numbers in the range from `\fICURRENT \- \fIAGE\fR' to
523 .\"O \fICURRENT\fR, and any executable can use the library if it has been linked
524 .\"O against a library in this range.
525 このライブラリが実装している最新のインターフェースと
527 言い替えると、このライブラリは `\fICURRENT \- \fIAGE\fR' から
528 \fICURRENT\fR までの範囲のすべてのインターフェース番号を実装していて、
529 このバージョンの範囲にあるライブラリに対して過去にリンクされた
530 すべての実行ファイルは、このライブラリを使うことができる、
533 .\"O If either \fIREVISION\fR or \fIAGE\fR are omitted, they default to 0. Also
534 .\"O note that \fIAGE\fR must be less than or equal to the \fICURRENT\fR
535 .\"O interface number. If two libraries have identical \fICURRENT\fR and \fIAGE\fR
536 .\"O numbers, then the dynamic linker chooses the library with the greater
538 \fIREVISION\fR と \fIAGE\fR が省略された場合のデフォルトは 0 である。
539 \fIAGE\fR は \fICURRENT\fR インターフェース番号より小さいか
540 等しくなければならないことにも注意すること。
541 2 つのライブラリが同一の \fICURRENT\fR 番号と \fIAGE\fR 番号であるとき、
542 ダイナミックリンカは大きい \fIREVISION\fR 番号のライブラリを選択する。
544 .\"O Some versioning guidelines:
547 .\"O \fB\(bu\ 1.\fR Start with version information of `0:0:0' for each libtool
549 \fB\(bu\ 1.\fR それぞれの libtool ライブラリについて
550 `0:0:0' というバージョン情報から始めなさい。
552 .\"O \fB\(bu\ 2.\fR Update the version information only immediately before a public
553 .\"O release of your software. More frequent updates are unnecessary,
554 .\"O and only guarantee that the current interface number gets larger
556 \fB\(bu\ 2. \fR バージョン情報を更新するのは
557 ソフトウェアの公開リリースの直前だけにしなさい。
558 頻繁な更新は不必要であり、現在のインターフェース番号が大きくなるのを
561 .\"O \fB\(bu\ 3.\fR If the library source code has changed at all since
562 .\"O the last update, then increment \fIREVISION\fR (\fIC\fB:\fIR\fB:\fIA\fR
563 .\"O becomes \fIC\fB:\fIR+1\fB:A\fR).
564 \fB\(bu\ 3.\fR 前回の更新からライブラリのソースコードが
565 すっかり変更されたなら、\fIREVISION\fR を増加させなさい
566 (\fIC\fB:\fIR\fB:\fIA\fR が \fIC\fB:\fIR+1\fB:\fIA\fR になる)。
568 .\"O \fB\(bu\ 4.\fR If any interfaces have been added, removed, or changed since the
569 .\"O last update, increment \fICURRENT\fR, and set \fIREVISION\fR to 0.
570 \fB\(bu\ 4.\fR 前回の更新からインターフェースが
571 追加・削除・変更されたなら、\fICURRENT\fR を増加させ、\fIREVISION\fR を
574 .\"O \fB\(bu\ 5.\fR If any interfaces have been added since the last public release,
575 .\"O then increment \fIAGE\fR.
576 \fB\(bu\ 5.\fR 前回の公開リリースからインターフェースが
577 追加されたなら、\fIAGE\fR を増加させなさい。
579 .\"O \fB\(bu\ 6.\fR If any interfaces have been removed since the last
580 .\"O public release, then set \fIAGE\fR to 0.
581 \fB\(bu\ 6.\fR 前回の公開リリースからインターフェースが
582 削除されたなら、\fIAGE\fR を 0 にしなさい。
584 .\"O If you want to encode the package version in the library name, or use
585 .\"O another versioning system without conflicting with \fBlibtool\fR's
586 .\"O versioning, use \fB\-release\fR. `libbfd.so.2.7.0.2' for example, comes with
587 .\"O binutils\-2.7.0.2 and clearly conflicts with \fBlibtool\fR's versioning. We
588 .\"O can use `\-release 2.7.0' and end up with `libbfd\-2.7.0.so.0.0.0' which is ok.
589 パッケージバージョンをライブラリ名にエンコードしたい場合や、
590 \fBlibtool\fR のバージョニングと衝突せずに
591 他のバージョニングシステムを使いたい場合は、\fB\-release\fR を使うこと。
592 たとえば binutils\-2.7.0.2 に付属する `libbfd.so.2.7.0.2' は
593 \fBlibtool\fR のバージョニングと明らかに衝突する。
594 `\-release 2.7.0' を使えば `libbfd\-2.7.0.so.0.0.0' で終ることができる。
596 .\"O Note that libraries with different \fICURRENT\fR version, and libraries with
597 .\"O different \fB\-release\fR, will be binary incompatible.
598 異なる \fICURRENT\fR バージョンのライブラリや
599 異なる \fB\-release\fR のライブラリはバイナリ非互換であろう。
600 .\"O .SH INTERFACE DESIGN
602 .\"O Writing a good library interface takes practice and thorough understanding
603 .\"O of the problem that the library is intended to solve. If you design a good
604 .\"O interface, it won't have to change often, you won't have to keep updating
605 .\"O documentation, and clients won't have to keep relearning how to use the
607 良いライブラリインターフェースを書くには、
608 練習とライブラリが解決しようとしている問題に対する徹底的な理解が必要である。
610 頻繁に変更する必要はなく、ドキュメントを更新し続ける必要もなく、
611 クライアントがライブラリの使い方を再び勉強し続ける必要もないだろう。
613 .\"O Some design guidelines:
616 .\"O \fB\(bu\fR Plan ahead
618 .\"O Try to make every interface minimal, so that you won't need to delete entry
619 .\"O points very often.
620 \fB\(bu\fR 前もって計画を立てる
622 エントリーポイントを頻繁に削除する必要がないように、
623 それぞれのインターフェースを最小にするようにしなさい。
625 .\"O \fB\(bu\fR Avoid interface changes
627 .\"O If you must redesign an interface, try to leave compatibility functions
628 .\"O behind so that clients don't need to rewrite their existing code.
629 \fB\(bu\fR インターフェースの変更を避ける
631 もしインターフェースを再設計する必要があるならば、
632 クライアントが既に存在するコードを書き直す必要がないように、
633 互換性のある関数も残しておくようにしなさい。
635 .\"O \fB\(bu\fR Use opaque data types
637 .\"O The fewer data type definitions a client has access to, the
638 .\"O better. If possible, design your functions to accept a generic
639 .\"O pointer (which you can cast to an internal data type), and provide
640 .\"O access functions rather than allowing the client to directly
641 .\"O manipulate the data. That way, you have the freedom to change the
642 .\"O data structures without changing the interface.
643 \fB\(bu\fR 見えないデータタイプを使う
645 クライアントがアクセスする必要のあるデータタイプの定義は少ない程良い。
647 (内部データタイプにキャストすることが可能) を
649 クライアントに直接データを操作させるよりは、
651 このようするとインターフェースを変更することなく
654 .\"O \fB\(bu\fR Use header files
656 .\"O If you write each of your library's global functions and variables in
657 .\"O header files, and include them in your library source files, then the
658 .\"O compiler will let you know if you make any interface changes by
660 \fB\(bu\fR ヘッダファイルを使う
662 それぞれのライブラリについて大域関数・大域変数をヘッダファイルに書いて
663 ライブラリのソースファイルにインクルードしておけば、
664 気づかずにインターフェースの変更をしてしまっても
667 .\"O \fB\(bu\fR Use \fBstatic\fRs (or equivalent) whenever possible
669 .\"O The fewer global functions your library has, the more flexibility
670 .\"O you will have in changing them. \fBstatic\fR functions and variables may
671 .\"O change as often as you like, since clients cannot access them and therefore
672 .\"O they aren't considered interface changes.
673 \fB\(bu\fR 可能なときはいつでも\fB静的\fR (もしくは等価なもの) を使う
675 ライブラリに大域関数が少ないほど、ライブラリは柔軟に変更できる。
676 \fB静的な\fR関数・変数は、クライアントがアクセスできないから
677 インターフェースの変更とはならないので、好きなだけ変更することができる。
678 .\"O .SH WRITING AUTOMAKE RULES
680 .\"O \fBlibtool\fR library support is implemented under the \fBLTLIBRARIES\fR
682 \fBlibtool\fR ライブラリのサポートは、
683 \fBLTLIBRARIES\fR プライマリのもとに実装されている。
685 .\"O To link a program against a \fBlibtool\fR library, just use the
686 .\"O \fIprogram\fB_LDADD\fR variable to specify the library name. You may use
687 .\"O \fIprogram\fB_LDFLAGS\fR to pass any options to libtool, such as
689 プログラムを \fBlibtool\fR ライブラリにリンクするためには、
690 ライブラリ名を指定する \fIprogram\fB_LDADD\fR 変数を使うこと。
691 libtool に \fB\-static\fR といったオプションを渡すためには
692 \fIprogram\fB_LDFLAGS\fR を使うと良い。
694 .\"O To build a \fBlibtool\fR library, use \fIlib\fB_LTLIBRARIES\fR to specify the
695 .\"O library name and \fB, and, for example, \fIlib\fB_LDFLAGS\fR to pass the
696 .\"O \fB\-version\-info\fR option to \fBlibtool\fR. You will find an example in
697 .\"O the next section.
698 \fBlibtool\fR ライブラリをビルドするには、
699 ライブラリ名を指定する \fIlib\fB_LTLIBRARIES\fR を使うこと。
700 \fBそして、たとえば、\fR\fBlibtool\fR に \fB\-version\-info\fR オプションを
701 渡すには \fIlib\fB_LDFLAGS\fR を使うこと。
704 .\"O You will also have to include some basic files in your package, or use
705 .\"O \fBlibtoolize\fR to do the work for you. Do not include the \fBlibtool\fR
706 .\"O script directly.
707 作業をするためには、パッケージにいくつかの基本的なファイルを入れたり、
708 \fBlibtoolize\fR を使う必要があるだろう。
709 \fBlibtool\fR スクリプトを直接インクルードしてはならない。
712 .\"O Attempt to guess a canonical system name.
716 .\"O Canonical system name validation subroutine script.
717 標準システム名を確認するサブルーチンスクリプト。
720 .\"O Generate a libtool script for a given system.
721 指示されたシステムについて libtool スクリプトを作成する。
724 .\"O A generic script implementing basic libtool functionality.
725 基本的な libtool の機能を実装した一般的なスクリプト。
726 .\"O .SH DLOPENING MODULES
728 .\"O To use \fBlibtool\fR's dlopening support, you must use the macro
729 .\"O \fBAC_LIBTOOL_DLOPEN\fR in your \fBconfigure.in\fR, before
730 .\"O \fBAM_PROG_LIBTOOL\fR. Otherwise \fBlibtool\fR will assume there's no
731 .\"O dlopening mechanism available on the platform and will simulate it.
732 .\"O In order to use this simulation feature you must declare the objects you
733 .\"O want to dlopen by using the \fB\-dlopen\fR and \fB\-dlreopen\fR flags when
734 .\"O linking your executable. \fBlibtool\fR will link the object files and create
735 .\"O data structures holding the executable's symbol table:
736 \fBlibtool\fR のダイナミックロード機能を使うためには、
737 \fBconfigure.in\fR のなかで \fBAM_PROG_LIBTOOL\fR より前に
738 マクロ \fBAC_LIBTOOL_DLOPEN\fR を使わなければならない。
739 さもなければ、\fBlibtool\fR はそのプラットホームには
740 ダイナミックロードのメカニズムがないと仮定して、
744 \fB\-dlopen\fR と \fB\-dlreopen\fR フラグを使い、
745 ダイナミックロードするオブジェクトを宣言しなければならない。
746 \fBlibtool\fR はオブジェクトファイルをリンクし、
747 以下のような実行ファイルのシンボルテーブルを保持した
752 struct lt_dlsymlist { const char *NAME; lt_ptr_t ADDRESS; }
756 .\"O \fINAME\fR holds an asciiz string with the symbol name, such as "fprintf".
757 .\"O \fIADDRESS\fR is a generic pointer to the appropriate object, such as
759 \fINAME\fR には、"fprintf" のような、シンボル名のアスキー文字列が保持される。
760 \fIADDRESS\fR は、&fprintf のような、
761 適切なオブジェクトへのジェネリックポインタである。
765 const lt_dlsymlist * lt_preloaded_symbols;
769 .\"O This array represents all the preloaded symbols linked into the executable.
770 .\"O For each \fB\-dlpreloaded\fR file there is an element with the \fINAME\fR of
771 .\"O the file and a \fIADDRESS\fR of `\fB0\fR', followed by all symbols exported from
772 .\"O this file. For the executable itself the special name \fB@PROGRAM@\fR is used.
773 .\"O The last element has a \fINAME\fR and \fIADDRESS\fR of `\fB0\fR'.
776 \fB\-dlpreloaded\fR されたファイルのそれぞれについて要素が存在し、
777 ファイル名 \fINAME\fR と `\fB0\fR' というアドレス \fIADDRESS\fR、
778 およびこのファイルからエクスポートされたすべてのシンボルを保持する。
779 実行ファイル自身については、特別な名前 \fB@PROGRAM@\fR が使われる。
780 最後のエレメントは \fINAME\fR と `\fB0\fR' という \fIADDRESS\fR を持つ。
782 .\"O When linking either a library that is going to be dlopened or an executable
783 .\"O that is going to dlopen a module, remember to specify the \fB\-module\fR
785 ダイナミックロードされるライブラリもしくは、
786 モジュールをダイナミックロードしようとする実行ファイルをリンクするときは、
787 \fB\-module\fR フラグを指定するのを忘れないこと。
789 .\"O If an executable needs to reference an external symbol of a library that you
790 .\"O are going to dlopen, use \fB\-export\-dynamic\fR when linking the executable.
791 ダイナミックロードしようとしているライブラリの外部シンボルを、
792 実行ファイルが参照する必要がある場合は、実行ファイルをリンクするときに
793 \fB\-export\-dynamic\fR を使用すること。
795 .\"O Due variations in library names, your program needs to determine which is
796 .\"O the correct file to dlopen. A straightforward approach is to examine the
797 .\"O `\fB.la\fR' files, looking for the \fBdlname='\fIDLNAME\fB'\fR line, where
798 .\"O \fBDLNAME\fR is either empty if the library can't be dlopened, or holds the
799 .\"O dlname of the library.
801 プログラムはどれがダイナミックロードするための
802 正しいファイルであるのかを決定する必要がある。
803 直接的な方法は `\fB.la\fR' ファイルを調べて、
804 \fBdlname='\fIDLNAME\fB'\fR という行を探すことである。
805 この行はライブラリをダイナミックロードできない場合は空で、
806 そうでない場合はライブラリの名前が入っている。
810 .\"O We are about to create a library called `libbaz' from the source files
811 .\"O `foo.c', `bar.c', and then link `a.c' with `libbaz' to create an executable
813 ソースファイル `foo.c', `bar.c' から `libbaz' とよばれるライブラリを作成し、
814 次に `a' という名前の実行ファイルを作成するために `a.c' を `libbaz' と
816 .\"O .SS Creating The Library
818 .\"O \fB\(bu\fR Compile mode: since Linux supports shared libraries, \fBlibtool\fR
819 .\"O will generate two object files: one for the static library (`foo.lo') and
820 .\"O one for the shared library (`foo.o'). The \fB\-c\fR option is mandatory,
821 .\"O since we don't want the compiler to do the linking on its own.
822 \fB\(bu\fR コンパイルモード:Linux は共有ライブラリをサポートしているので、
823 \fBlibtool\fR は 2 つのオブジェクトファイル、
824 一つは静的ライブラリ (`foo.lo')、
825 もう一つは共有ライブラリ (`foo.o') を作成する。
826 ソースファイル自身へのリンクをコンパイラにやらせたくないので、
827 \fB\-c\fR オプションは必須である。
831 lightside:~% libtool cc \-c foo.c
832 cc \-c \-fPIC \-DPIC foo.c -o .libs/foo.lo
833 cc \-c foo.c >/dev/null 2>&1
834 lightside:~% libtool cc -c bar.c
835 cc \-c \-fPIC \-DPIC bar.c -o .libs/bar.lo
836 cc \-c bar.c >/dev/null 2>&1
840 .\"O \fB\(bu\fR Link mode, build only a static library: We specify the `.o'
841 .\"O object files generated previously. The \fB\-o\fR option is mandatory.
842 \fB\(bu\fR リンクモード、静的ライブラリのみをビルドする:
843 以前に作成された `.o' というオブジェクトファイルを指定している。
844 \fB\-o\fR オプションは必須である。
848 lightside:~% libtool cc -o libbaz.a foo.o bar.o
849 ar cru libbaz.a foo.o bar.o
854 .\"O \fB\(bu\fR Link mode, build static and shared libraries: We specify the
855 .\"O `.lo' object files. Mandatory options are \fB\-o\fR like before, and
856 .\"O \fB\-rpath\fR to indicate which will be the installation directory for our
857 .\"O library. The library will be created in the `.libs' directory.
858 \fB\(bu\fR リンクモード、静的ライブラリと共有ライブラリをビルドする:
859 `.lo' というオブジェクトファイルを指定する。
860 必須オプションは、前と同じ \fB\-o\fR と
861 ライブラリのインストールされるディレクトリを指示する \fB\-rpath\fR である。
862 ライブラリは `.libs' ディレクトリに作成される。
866 lightside:~% libtool cc \-o libbaz.la foo.lo bar.lo \e
867 \-rpath /usr/local/lib
868 cc \-shared \-Wl,\-soname \-Wl,libbaz.so.0 \e
869 \-o .libs/libbaz.so.0.0.0 foo.lo bar.lo
870 (cd .libs && ln \-s libbaz.so.0.0.0 libbaz.so.0)
871 (cd .libs && ln \-s libbaz.so.0.0.0 libbaz.so)
872 ar cru .libs/libbaz.a foo.o bar.o
873 ranlib .libs/libbaz.a
875 (cd .libs && ln \-s ../libbaz.la libbaz.la)
879 .\"O \fB\(bu\fR Install mode: This will run the necessary commands to install the
880 .\"O library in the specified path (in our case, `/usr/local/lib'). It will
881 .\"O install the shared (`.so') and static (`.a') libraries, as well as the
882 .\"O libtool file (`.la'), for unistallation and informational purposes.
883 \fB\(bu\fR インストールモード:ライブラリを指定したパス
884 (この場合は `/usr/local/lib') にインストールするために
886 このモードでは共有ライブラリ (`.so') と静的ライブラリ (`.a') を
887 インストールするとともに、アンインストールと情報提供の目的で
888 libtool ファイル (`.la') がインストールされる。
890 .\"O Since this is often done as a privileged user, it's useful to specify the
891 .\"O \fB\-n\fR or \fB\-\-dry\-run\fR option to check the results.
892 このモードはふつう特権ユーザーとして実行されるので、
893 \fB\-n\fR または \fB\-\-dry\-run\fR オプションを
898 lightside:/tmp% libtool \-n install libbaz.la /usr/local/lib
899 install .libs/libbaz.so.0.0.0 /usr/local/lib/libbaz.so.0.0.0
900 (cd /usr/local/lib && ln \-s libbaz.so.0.0.0 libbaz.so.0)
901 (cd /usr/local/lib && ln \-s libbaz.so.0.0.0 libbaz.so)
902 install libbaz.la /usr/local/lib/libbaz.la
903 install .libs/libbaz.a /usr/local/lib/libbaz.a
904 ranlib /usr/local/lib/libbaz.a
905 chmod 644 /usr/local/lib/libbaz.a
909 .\"O .SS Creating the Executable
911 .\"O First we compile `a.c'
920 .\"O If the library has already been installed you can proceed as usual
921 ライブラリが既にインストールされている場合には、
926 cc a.c \-lbaz \-L/usr/local/lib
930 .\"O If the library hasn't been installed yet, \fBlibtool\fR must be used to
931 .\"O do the linking, debugging and installation of the executable (this last thing,
932 .\"O once the library has been installed). Note that the real executable will be
933 .\"O in `.libs' until it is installed, and the the executable on the work
934 .\"O directory is merely a wrapper.
935 ライブラリがまだインストールされていない場合は、
936 実行ファイルのリンク・デバッグ・インストールに
937 \fBlibtool\fR を使用しなければならない
938 (一度ライブラリがインストールされるまで、これはつづく)。
939 実際の実行ファイルはインストールされるまで `.libs' 内にあり、
940 作業ディレクトリにある実行ファイルは単なるラッパーであることに注意すること。
942 .\"O In order to avoid ambiguities, never use \fB\-l\fR or \fB\-L\fR to link
943 .\"O against an uninstalled shared library. Just specify the path to the `.la'
944 .\"O file. Installed libraries aren't a problem, as we see below (`\-lm').
946 \fB\-l\fR と \fB\-L\fR を使ってアンインストールされた
948 `.la' ファイルへのパスだけを指定すること。
949 以下の (`\-lm') でわかるように、インストール済みのライブラリは問題ではない。
953 lightside:~% libtool cc a.o libbaz.la \-o a -lm
954 cc a.o \-Wl,\-\-rpath \-Wl,/usr/local/lib \e
955 .libs/libbaz.so \-o .libs/a -lm
956 lightside:~% libtool gdb a
957 .\"O [snipped hairy debugging session]
959 lightside:~% libtool install \-c a /usr/local/bin/a
960 install \-c .libs/a /usr/local/bin/a
964 .\"O .SS Creating Makefile.am
966 .\"O \fB\(bu\fR\ First create a brief \fBconfigure.in\fR, remembering to add the
967 .\"O macros for \fBautomake\fR and \fBlibtool\fR.
968 \fB\(bu\fR\ 最初に簡単な \fBconfigure.in\fR を作成し、
969 \fBautomake\fR と \fBlibtool\fR のためのマクロを忘れずに追加する。
973 AC_DEFUN(AM_INIT_AUTOMAKE)
975 AM_INIT_AUTOMAKE(a, 1.0)
982 .\"O \fB\(bu\fR\ Then the corresponding \fBMakefile.am\fR
983 \fB\(bu\fR\ 対応する \fBMakefile.am\fR
987 .\"O # Build the library
989 lib_LTLIBRARIES=libbaz.la
990 libbaz_la_SOURCES = foo.c bar.c
991 libbaz_la_LDFLAGS = -version-info 0:0:0
993 bin_PROGRAMS = a a.debug
995 .\"O # Build a from a.c and libbaz.la
996 # a.c と libbaz.la から a をビルド
1000 .\"O # Create a static debugging version
1002 a_debug_SOURCES = a.c
1003 a_debug_LDADD = libbaz.la
1004 a_debug_LDFLAGS = \-static
1008 .\"O \fB\(bu\fR\ And finally give it a try
1009 \fB\(bu\fR\ そして最後に実行する
1013 lightside:~% aclocal; libtoolize; automake \-\-add\-missing; autoconf
1014 lightside:~% ./configure; make
1020 \fBlibtoolize\fR(1), \fBlibltdl\fR(3)
1023 .\"O Report bugs to <bug-libtool@gnu.org>.
1025 .\"O Man page by Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
1026 プログラムのバグについては <bug-libtool@gnu.org> へ報告してください。
1028 この man ページは Ragnar Hojland Espinosa
1029 <ragnar@ragnar-hojland.com> が作成しました。