⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libtool.texi

📁 这是一个自动生成MAKEFILE的工具。一个很有用的库。在LINUX工程项目里是很好的帮手。希望对大家有点帮助。
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
Display basic configuration options.  This provides a way for packagesto determine whether shared or static libraries will be built.@item --finishSame as @samp{--mode=finish}.@item --helpDisplay a help message and exit.  If @samp{--mode=@var{mode}} isspecified, then detailed help for @var{mode} isdisplayed.@item --mode=@var{mode}Use @var{mode} as the operation mode.  By default, the operation mode isinferred from the @var{mode-args}.If @var{mode} is specified, it must be one of the following:@table @samp@item compileCompile a source file into a libtool object.@item executeAutomatically set the library path so that another program can useuninstalled libtool-generated programs or libraries.@item finishComplete the installation of libtool libraries on the system.@item installInstall libraries or executables.@item linkCreate a library or an executable.@item uninstallDelete installed libraries or executables.@item cleanDelete uninstalled libraries or executables.@end table@item --versionPrint libtool version information and exit.@end tableThe @var{mode-args} are a variable number of arguments, depending on theselected operation mode.  In general, each @var{mode-arg} is interpretedby programs libtool invokes, rather than libtool itself.@menu* Compile mode::                Creating library object files.* Link mode::                   Generating executables and libraries.* Execute mode::                Debugging libtool-generated programs.* Install mode::                Making libraries and executables public.* Finish mode::                 Completing a library installation.* Uninstall mode::              Removing installed executables and libraries.* Clean mode::                  Removing uninstalled executables and libraries.@end menu@node Compile mode@section Compile mode@cindex mode, compile@cindex compile modeFor @dfn{compile} mode, @var{mode-args} is a compiler command to be usedin creating a `standard' object file.  These arguments should begin withthe name of the C compiler, and contain the @samp{-c} compiler flag sothat only an object file is created.Libtool determines the name of the output file by removing the directorycomponent from the source file name, then substituting the source codesuffix (e.g. @samp{.c} for C source code) with the library object suffix,@samp{.lo}.If shared libraries are being built, any necessary PIC generation flagsare substituted into the compilation command.You can pass compiler and linker specific flags using @samp{-Wc,@var{flag}}and @samp{-Xcompiler @var{flag}} or @samp{-Wl,@var{flag}} and@samp{-Xlinker @var{flag}}, respectively.If the @samp{-static} option is given, then a @samp{.o} file is built,even if libtool was configured with @samp{--disable-static}.Note that the @samp{-o} option is now fully supported.  It is emulatedon the platforms that don't support it (by locking and moving theobjects), so it is really easy to use libtool, just with minormodifications to your Makefiles. Typing for example@examplelibtool gcc -c foo/x.c -o foo/x.lo@end examplewill do what you expect.Note, however, that, if the compiler does not support @samp{-c} and@samp{-o}, it is impossible to compile @file{foo/x.c} withoutoverwriting an existing @file{./x.o}.  Therefore, if you do have asource file @file{./x.c}, make sure you introduce dependencies in your@file{Makefile} to make sure @file{./x.o} (or @file{./x.lo}) isre-created after any sub-directory's @file{x.lo}:@examplex.o x.lo: foo/x.lo bar/x.lo@end exampleThis will also ensure that make won't try to use a temporarily corrupted@file{x.o} to create a program or library.  It may cause needlessrecompilation on platforms that support @samp{-c} and @samp{-o}together, but it's the only way to make it safe for those that don't.@node Link mode@section Link mode@cindex link mode@cindex mode, link@dfn{Link} mode links together object files (including libraryobjects) to form another library or to create an executable program.@var{mode-args} consist of a command using the C compiler to create anoutput file (with the @samp{-o} flag) from several object files.The following components of @var{mode-args} are treated specially:@table @samp@cindex undefined symbols, allowing@cindex unresolved symbols, allowing@item -all-staticIf @var{output-file} is a program, then do not link it against anyshared libraries at all.  If @var{output-file} is a library, then onlycreate a static library.@item -avoid-versionTries to avoid versioning (@pxref{Versioning}) for libraries and modules,i.e. no version information is stored and no symbolic links are created.If the platform requires versioning, this option has no effect.@item -dlopen @var{file}Same as @samp{-dlpreopen @var{file}}, if native dlopening is notsupported on the host platform (@pxref{Dlopened modules}) or ifthe program is linked with @samp{-static} or @samp{-all-static}.Otherwise, no effect.  If @var{file} is @code{self} libtool will makesure that the program can @code{dlopen} itself, either by enabling@code{-export-dynamic} or by falling back to @samp{-dlpreopen self}.@item -dlpreopen @var{file}Link @var{file} into the output program, and add its symbols to@var{lt_preloaded_symbols} (@pxref{Dlpreopening}).  If @var{file} is@code{self}, the symbols of the program itself will be added to@var{lt_preloaded_symbols}.If @var{file} is @code{force} libtool will make sure that@var{lt_preloaded_symbols} is always @emph{defined}, regardless of whetherit's empty or not.@item -export-dynamicAllow symbols from @var{output-file} to be resolved with @code{dlsym}(@pxref{Dlopened modules}).@item -export-symbols @var{symfile}Tells the linker to export only the symbols listed in @var{symfile}.The symbol file should end in @samp{.sym} and must contain the name of onesymbol per line. This option has no effect on some platforms.By default all symbols are exported.@item -export-symbols-regex @var{regex}Same as @samp{-export-symbols}, except that only symbols matchingthe regular expression @var{regex} are exported.By default all symbols are exported.@item -L@var{libdir}Search @var{libdir} for required libraries that have already beeninstalled.@item -l@var{name}@var{output-file} requires the installed library @file{lib@var{name}}.This option is required even when @var{output-file} is not anexecutable.@item -moduleCreates a library that can be dlopened (@pxref{Dlopened modules}).This option doesn't work for programs.Module names don't need to be prefixed with 'lib'.In order to prevent name clashes, however, 'libname' and 'name'must not be used at the same time in your package.@item -no-fast-installDisable fast-install mode for the executable @var{output-file}.  Usefulif the program won't be necessarily installed.@item -no-installLink an executable @var{output-file} that can't be installed andtherefore doesn't need a wrapper script.  Useful if the program is onlyused in the build tree, e.g., for testing or generating other files.@item -no-undefinedDeclare that @var{output-file} does not depend on any other libraries.Some platforms cannot create shared libraries that depend on otherlibraries (@pxref{Inter-library dependencies}).@item -o @var{output-file}Create @var{output-file} from the specified objects and libraries.@item -release @var{release}Specify that the library was generated by release @var{release} of yourpackage, so that users can easily tell which versions are newer thanothers.  Be warned that no two releases of your package will be binarycompatible if you use this flag.  If you want binary compatibility, usethe @samp{-version-info} flag instead (@pxref{Versioning}).@item -rpath @var{libdir}If @var{output-file} is a library, it will eventually be installed in@var{libdir}.  If @var{output-file} is a program, add @var{libdir} tothe run-time path of the program.@item -R @var{libdir}If @var{output-file} is a program, add @var{libdir} to its run-timepath.  If @var{output-file} is a library, add -R@var{libdir} to its@var{dependency_libs}, so that, whenever the library is linked into aprogram, @var{libdir} will be added to its run-time path.@item -staticIf @var{output-file} is a program, then do not link it against anyuninstalled shared libtool libraries.  If @var{output-file} is alibrary, then only create a static library.@item -version-info @var{current}[:@var{revision}[:@var{age}]]If @var{output-file} is a libtool library, use interface versioninformation @var{current}, @var{revision}, and @var{age} to build it(@pxref{Versioning}).  Do @strong{not} use this flag to specify packagerelease information, rather see the @samp{-release} flag.@item -Wl,@var{flag}@itemx -Xlinker @var{flag}Pass a linker specific flag directly to the linker.@end tableIf the @var{output-file} ends in @samp{.la}, then a libtool library iscreated, which must be built only from library objects (@samp{.lo} files).The @samp{-rpath} option is required.  In the current implementation,libtool libraries may not depend on other uninstalled libtool libraries(@pxref{Inter-library dependencies}).If the @var{output-file} ends in @samp{.a}, then a standard library iscreated using @code{ar} and possibly @code{ranlib}.@cindex partial linking@cindex linking, partialIf @var{output-file} ends in @samp{.o} or @samp{.lo}, then a reloadable objectfile is created from the input files (generally using @samp{ld -r}).This method is often called @dfn{partial linking}.Otherwise, an executable program is created.@node Execute mode@section Execute mode@cindex execute mode@cindex mode, executeFor @dfn{execute} mode, the library path is automatically set, then aprogram is executed.The first of the @var{mode-args} is treated as a program name, with therest as arguments to that program.The following components of @var{mode-args} are treated specially:@table @samp@item -dlopen @var{file}Add the directory containing @var{file} to the library path.@end tableThis mode sets the library path environment variable according to any@samp{-dlopen} flags.If any of the @var{args} are libtool executable wrappers, then they aretranslated into the name of their corresponding uninstalled binary, andany of their required library directories are added to the library path.@node Install mode@section Install mode@cindex install mode@cindex mode, installIn @dfn{install} mode, libtool interprets @var{mode-args} as aninstallation command beginning with @code{cp}, or a BSD-compatible@code{install} program.The rest of the @var{mode-args} are interpreted as arguments to thatcommand.The command is run, and any necessary unprivileged post-installationcommands are also completed.@node Finish mode@section Finish mode@cindex finish mode@cindex mode, finish@dfn{Finish} mode helps system administrators install libtool librariesso that they can be located and linked into user programs.Each @var{mode-arg} is interpreted as the name of a library directory.Running this command may require superuser privileges, so the@samp{--dry-run} option may be useful.@node Uninstall mode@section Uninstall mode@cindex uninstall mode@cindex mode, uninstall@dfn{Uninstall} mode deletes installed libraries, executables and objects.The first @var{mode-arg} is the name of the program to use to deletefiles (typically @file{/bin/rm}).The remaining @var{mode-args} are either flags for the deletion program(beginning with a `-'), or the names of files to delete.@node Clean mode@section Clean mode@cindex clean mode@cindex mode, clean@dfn{Clean} mode deletes uninstalled libraries, executables, objectsand libtool's temporary files associated with them.The first @var{mode-arg} is the name of the program to use to deletefiles (typically @file{/bin/rm}).The remaining @var{mode-args} are either flags for the deletion program(beginning with a `-'), or the names of files to delete.@node Integrating libtool@chapter Integrating libtool with your packageThis chapter describes how to integrate libtool with your packages sothat your users can install hassle-free shared libraries.@menu* Makefile rules::              Writing @file{Makefile} rules for libtool.* Using Automake::              Automatically supporting libtool.* Configuring::                 Configuring libtool for a host system.* Distributing::                What files to distribute with your package.* Static-only libraries::       Sometimes shared libraries are just a pain.@end menu@node Makefile rules@section Writing @file{Makefile} rules for libtool@cindex Makefile@cindex Makefile.am@cindex Makefile.inLibtool is fully integrated with Automake (@pxref{Top,, Introduction,automake, The Automake Manual}), starting with Automake version 1.2.If you want to use libtool in a regular @file{Makefile} (or@file{Makefile.in}), you are on your own.  If you're not using Automake1.2, and you don't know how to incorporate libtool into your package youneed to do one of the following:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -