This is libtool.info, produced by makeinfo version 3.12k from libtool.texi. INFO-DIR-SECTION GNU programming tools START-INFO-DIR-ENTRY * Libtool: (libtool). Generic shared library support script. END-INFO-DIR-ENTRY INFO-DIR-SECTION Individual utilities START-INFO-DIR-ENTRY * libtoolize: (libtool)Invoking libtoolize. Adding libtool support. END-INFO-DIR-ENTRY This file documents GNU Libtool 1.3.4 Copyright (C) 1996-1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.  File: libtool.info, Node: libtool script contents, Next: Cheap tricks, Prev: Platform quirks, Up: Maintaining `libtool' script contents ========================= The `libtool' script is generated by `ltconfig' (*note Configuring::). From libtool version 0.7 to 1.0, this script simply set shell variables, then sourced the libtool backend, `ltmain.sh'. `ltconfig' from libtool version 1.1 and later inlines the contents of `ltmain.sh' into the generated `libtool', which improves performance on many systems. The convention used for naming variables which hold shell commands for delayed evaluation, is to use the suffix `_cmd' where a single line of valid shell script is needed, and the suffix `_cmds' where multiple lines of shell script *may* be delayed for later evaluation. By convention, `_cmds' variables delimit the evaluation units with the `~' character where necessary. Here is a listing of each of the configuration variables, and how they are used within `ltmain.sh': - Variable: AR The name of the system library archiver. - Variable: CC The name of the C compiler used to configure libtool. - Variable: LD The name of the linker that libtool should use internally for reloadable linking and possibly shared libraries. - Variable: LTCONFIG_VERSION This is set to the version number of the `ltconfig' script, to prevent mismatches between the configuration information in `libtool', and how that information is used in `ltmain.sh'. - Variable: NM The name of a BSD-compatible `nm' program, which produces listings of global symbols in one the following formats: ADDRESS C GLOBAL-VARIABLE-NAME ADDRESS D GLOBAL-VARIABLE-NAME ADDRESS T GLOBAL-FUNCTION-NAME - Variable: RANLIB Set to the name of the ranlib program, if any. - Variable: allow_undefined_flag The flag that is used by `archive_cmds' in order to declare that there will be unresolved symbols in the resulting shared library. Empty, if no such flag is required. Set to `unsupported' if there is no way to generate a shared library with references to symbols that aren't defined in that library. - Variable: always_export_symbols Whether libtool should automatically generate a list of exported symbols using EXPORT_SYMBOLS_CMDS before linking an archive. Set to `yes' or `no'. Default is `no'. - Variable: archive_cmds - Variable: archive_expsym_cmds - Variable: old_archive_cmds Commands used to create shared libraries, shared libraries with `-export-symbols' and static libraries, respectively. - Variable: old_archive_from_new_cmds If the shared library depends on a static library, `old_archive_from_new_cmds' contains the commands used to create that static library. If this variable is not empty, `old_archive_cmds' is not used. - Variable: build_libtool_libs Whether libtool should build shared libraries on this system. Set to `yes' or `no'. - Variable: build_old_libs Whether libtool should build static libraries on this system. Set to `yes' or `no'. - Variable: compiler_c_o Whether the compiler supports the `-c' and `-o' options simultaneously. Set to `yes' or `no'. - Variable: compiler_o_lo Whether the compiler supports compiling directly to a ".lo" file, i.e whether object files do not have to have the suffix ".o". Set to `yes' or `no'. - Variable: dlopen Whether `dlopen' is supported on the platform. Set to `yes' or `no'. - Variable: dlopen_self Whether it is possible to `dlopen' the executable itself. Set to `yes' or `no'. - Variable: dlopen_self_static Whether it is possible to `dlopen' the executable itself, when it is linked statically (`-all-static'). Set to `yes' or `no'. - Variable: echo An `echo' program which does not interpret backslashes as an escape character. - Variable: exclude_expsyms List of symbols that should not be listed in the preloaded symbols. - Variable: export_dynamic_flag_spec Compiler link flag that allows a dlopened shared library to reference symbols that are defined in the program. - Variable: export_symbols_cmds Commands to extract exported symbols from LIBOBJS to the file EXPORT_SYMBOLS. - Variable: fast_install Determines whether libtool will privilege the installer or the developer. The assumption is that installers will seldom run programs in the build tree, and the developer will seldom install. This is only meaningful on platforms in which SHLIBPATH_OVERRIDES_RUNPATH is not `yes', so FAST_INSTALL will be set to `needless' in this case. If FAST_INSTALL set to `yes', libtool will create programs that search for installed libraries, and, if a program is run in the build tree, a new copy will be linked on-demand to use the yet-to-be-installed libraries. If set to `no', libtool will create programs that use the yet-to-be-installed libraries, and will link a new copy of the program at install time. The default value is `yes' or `needless', depending on platform and configuration flags, and it can be turned from `yes' to `no' with the configure flag `--disable-fast-install'. - Variable: finish_cmds Commands to tell the dynamic linker how to find shared libraries in a specific directory. - Variable: finish_eval Same as FINISH_CMDS, except the commands are not displayed. - Variable: fix_srcfile_path Expression to fix the shell variable $srcfile for the compiler. - Variable: global_symbol_pipe A pipeline that takes the output of NM, and produces a listing of raw symbols followed by their C names. For example: $ eval "$NM progname | $global_symbol_pipe" D SYMBOL1 C-SYMBOL1 T SYMBOL2 C-SYMBOL2 C SYMBOL3 C-SYMBOL3 ... $ The first column contains the symbol type (used to tell data from code on some platforms), but its meaning is system dependent. - Variable: global_symbol_to_cdecl A pipeline that translates the output of GLOBAL_SYMBOL_PIPE into proper C declarations. On platforms whose linkers differentiate code from data, such as HP/UX, data symbols will be declared as such, and code symbols will be declared as functions. On platforms that don't care, everything is assumed to be data. - Variable: hardcode_action Either `immediate' or `relink', depending on whether shared library paths can be hardcoded into executables before they are installed, or if they need to be relinked. - Variable: hardcode_direct Set to `yes' or `no', depending on whether the linker hardcodes directories if a library is directly specified on the command line (such as `DIR/libNAME.a') when HARDCODE_LIBDIR_FLAG_SPEC is specified. - Variable: hardcode_libdir_flag_spec Flag to hardcode a LIBDIR variable into a binary, so that the dynamic linker searches LIBDIR for shared libraries at runtime. If it is empty, libtool will try to use some other hardcoding mechanism. - Variable: hardcode_libdir_separator If the compiler only accepts a single HARDCODE_LIBDIR_FLAG, then this variable contains the string that should separate multiple arguments to that flag. - Variable: hardcode_minus_L Set to `yes' or `no', depending on whether the linker hardcodes directories specified by `-L' flags into the resulting executable when HARDCODE_LIBDIR_FLAG_SPEC is specified. - Variable: hardcode_shlibpath_var Set to `yes' or `no', depending on whether the linker hardcodes directories by writing the contents of `$shlibpath_var' into the resulting executable when HARDCODE_LIBDIR_FLAG_SPEC is specified. Set to `unsupported' if directories specified by `$shlibpath_var' are searched at run time, but not at link time. - Variable: host - Variable: host_alias For information purposes, set to the specified and canonical names of the system that libtool was configured for. - Variable: include_expsyms List of symbols that must always be exported when using EXPORT_SYMBOLS. - Variable: libext The standard old archive suffix (normally "a"). - Variable: libname_spec The format of a library name prefix. On all Unix systems, static libraries are called `libNAME.a', but on some systems (such as OS/2 or MS-DOS), the library is just called `NAME.a'. - Variable: library_names_spec A list of shared library names. The first is the name of the file, the rest are symbolic links to the file. The name in the list is the file name that the linker finds when given `-lNAME'. - Variable: link_static_flag Linker flag (passed through the C compiler) used to prevent dynamic linking. - Variable: need_lib_prefix Whether libtool should automatically prefix module names with 'lib'. Set to `yes' or `no'. By default, it is `unknown', which means the same as `yes', but documents that we are not really sure about it. `yes' means that it is possible both to `dlopen' and to link against a library without 'lib' prefix, i.e. it requires HARDCODE_DIRECT to be `yes'. - Variable: need_version Whether versioning is required for libraries, i.e. whether the dynamic linker requires a version suffix for all libraries. Set to `yes' or `no'. By default, it is `unknown', which means the same as `yes', but documents that we are not really sure about it. - Variable: need_locks Whether files must be locked to prevent conflicts when compiling simultaneously. Set to `yes' or `no'. - Variable: no_builtin_flag Compiler flag to disable builtin functions that conflict with declaring external global symbols as `char'. - Variable: no_undefined_flag The flag that is used by `archive_cmds' in order to declare that there will be no unresolved symbols in the resulting shared library. Empty, if no such flag is required. - Variable: objdir The name of the directory that contains temporary libtool files. - Variable: objext The standard object file suffix (normally "o"). - Variable: pic_flag Any additional compiler flags for building library object files. - Variable: postinstall_cmds - Variable: old_postinstall_cmds Commands run after installing a shared or static library, respectively. - Variable: postuninstall_cmds - Variable: old_postuninstall_cmds Commands run after uninstalling a shared or static library, respectively. - Variable: reload_cmds - Variable: reload_flag Commands to create a reloadable object. - Variable: runpath_var The environment variable that tells the linker which directories to hardcode in the resulting executable. - Variable: shlibpath_overrides_runpath Indicates whether it is possible to override the hard-coded library search path of a program with an environment variable. If this is set to no, libtool may have to create two copies of a program in the build tree, one to be installed and one to be run in the build tree only. When each of these copies is created depends on the value of `fast_install'. The default value is `unknown', which is equivalent to `no'. - Variable: shlibpath_var The environment variable that tells the dynamic linker where to find shared libraries. - Variable: soname_spec The name coded into shared libraries, if different from the real name of the file. - Variable: sys_lib_dlsearch_path_spec Expression to get the run-time system library search path. Directories that appear in this list are never hard-coded into executables. - Variable: sys_lib_search_path_spec Expression to get the compile-time system library search path. This variable is used by libtool when it has to test whether a certain library is shared or static. The directories listed in SHLIBPATH_VAR are automatically appended to this list, every time libtool runs (i.e., not at configuration time), because some linkers use this variable to extend the library search path. Linker switches such as `-L' also augment the search path. - Variable: thread_safe_flag_spec Linker flag (passed through the C compiler) used to generate thread-safe libraries. - Variable: version_type The library version numbering type. One of `libtool', `linux', `osf', `sunos', or `none'. - Variable: whole_archive_flag_spec Compiler flag to generate shared objects from convenience archives. - Variable: wl The C compiler flag that allows libtool to pass a flag directly to the linker. Used as: `${wl}SOME-FLAG'. Variables ending in `_cmds' or `_eval' contain a semicolon-separated list of commands that are `eval'ed one after another. If any of the commands return a nonzero exit status, libtool generally exits with an error message. Variables ending in `_spec' are `eval'ed before being used by libtool.  File: libtool.info, Node: Cheap tricks, Prev: libtool script contents, Up: Maintaining Cheap tricks ============ Here are a few tricks that you can use in order to make maintainership easier: * When people report bugs, ask them to use the `--config', `--debug', or `--features' flags, if you think they will help you. These flags are there to help you get information directly, rather than having to trust second-hand observation. * Rather than reconfiguring libtool every time I make a change to `ltconfig.in' or `ltmain.in', I keep a permanent `libtool' script in my PATH, which sources `ltmain.in' directly. The following steps describe how to create such a script, where `/home/src/libtool' is the directory containing the libtool source tree, `/home/src/libtool/libtool' is a libtool script that has been configured for your platform, and `~/bin' is a directory in your PATH: trick$ cd ~/bin trick$ sed '/^# ltmain\.sh/q' /home/src/libtool/libtool > libtool trick$ cat >> libtool LTCONFIG_VERSION="@VERSION@" . /home/src/libtool/ltmain.in ^D trick$ chmod +x libtool trick$ libtool --version ltmain.sh (GNU @PACKAGE@) @VERSION@ trick$ The output of the final `libtool --version' command shows that the `ltmain.in' script is being used directly. Now, modify `~/bin/libtool' or `/home/src/libtool/ltmain.in' directly in order to test new changes without having to rerun `ltconfig'.  File: libtool.info, Node: Index, Prev: Maintaining, Up: Top Index ***** * Menu: * .la files: Linking libraries. * .libs subdirectory: Linking libraries. * .lo files: Creating object files. * AC_CONFIG_AUX_DIR: Invoking libtoolize. * AC_DISABLE_FAST_INSTALL: AM_PROG_LIBTOOL. * AC_DISABLE_SHARED: AM_PROG_LIBTOOL. * AC_DISABLE_STATIC: AM_PROG_LIBTOOL. * AC_FUNC_ALLOCA: Autoconf .o macros. * AC_LIBTOOL_DLOPEN: AM_PROG_LIBTOOL. * AC_LIBTOOL_WIN32_DLL: AM_PROG_LIBTOOL. * AC_REPLACE_FUNCS: Autoconf .o macros. * aclocal: AM_PROG_LIBTOOL. * allow_undefined_flag: libtool script contents. * always_export_symbols: libtool script contents. * AM_DISABLE_SHARED: AM_PROG_LIBTOOL. * AM_DISABLE_STATIC: AM_PROG_LIBTOOL. * AM_PROG_LIBTOOL: AM_PROG_LIBTOOL. * application-level dynamic linking <1>: Using libltdl. * application-level dynamic linking: Dlopened modules. * AR: libtool script contents. * ar: Linking libraries. * archive_cmds: libtool script contents. * archive_expsym_cmds: libtool script contents. * AS: Invoking ltconfig. * assign.test: Test descriptions. * avoiding shared libraries: Static-only libraries. * bug reports: Reporting bugs. * buggy system linkers: Linking executables. * bugs, subtle ones caused by buggy linkers: Linking executables. * build-relink.test: Test descriptions. * build_libtool_libs: libtool script contents. * build_old_libs: libtool script contents. * C header files, portable: C header files. * C++, pitfalls: C++ libraries. * C++, using: Other languages. * C, not using: Other languages. * CC <1>: libtool script contents. * CC: Invoking ltconfig. * cdemo-conf.test: Test descriptions. * cdemo-exec.test: Test descriptions. * cdemo-make.test: Test descriptions. * cdemo-shared.test: Test descriptions. * cdemo-static.test: Test descriptions. * CFLAGS: Invoking ltconfig. * command options, libtool: Invoking libtool. * command options, libtoolize: Invoking libtoolize. * command options, ltconfig: Invoking ltconfig. * compile mode: Compile mode. * compiler_c_o: libtool script contents. * compiler_o_lo: libtool script contents. * compiling object files: Creating object files. * complexity of library systems: Postmortem. * config.guess: Distributing. * config.sub: Distributing. * configuring libtool: Configuring. * convenience libraries: Static libraries. * CPPFLAGS: Invoking ltconfig. * debugging libraries: Static-only libraries. * definition of libraries: Libtool paradigm. * demo-conf.test: Test descriptions. * demo-exec.test: Test descriptions. * demo-inst.test: Test descriptions. * demo-make.test: Test descriptions. * demo-nofast.test: Test descriptions. * demo-shared.test: Test descriptions. * demo-static.test: Test descriptions. * demo-unst.test: Test descriptions. * dependencies between libraries: Inter-library dependencies. * dependency versioning: Versioning. * deplibs.test: Test descriptions. * deplibs_check_method: Porting inter-library dependencies. * design issues: Issues. * design of library interfaces: Library tips. * design philosophy: Motivation. * developing libraries: Static-only libraries. * dlclose <1>: Using libltdl. * dlclose: Dlopened modules. * dlerror: Using libltdl. * DLLTOOL: Invoking ltconfig. * dlopen <1>: libtool script contents. * dlopen <2>: Using libltdl. * dlopen: Dlopened modules. * dlopen_self: libtool script contents. * dlopen_self_static: libtool script contents. * dlopening modules <1>: Using libltdl. * dlopening modules: Dlopened modules. * dlopening, pitfalls: Dlopen issues. * dlsym <1>: Using libltdl. * dlsym: Dlopened modules. * double-compilation, avoiding: Static-only libraries. * dryrun.test: Test descriptions. * dynamic dependencies: Versioning. * dynamic linking, applications <1>: Using libltdl. * dynamic linking, applications: Dlopened modules. * dynamic modules, names: Finding the dlname. * echo: libtool script contents. * eliding shared libraries: Static-only libraries. * examples of using libtool: Using libtool. * exclude_expsyms: libtool script contents. * execute mode: Execute mode. * export_dynamic_flag_spec: libtool script contents. * export_symbols_cmds: libtool script contents. * failed tests: When tests fail. * fast_install: libtool script contents. * file_magic: Porting inter-library dependencies. * file_magic_cmd: Porting inter-library dependencies. * file_magic_test_file: Porting inter-library dependencies. * finish mode: Finish mode. * finish_cmds: libtool script contents. * finish_eval: libtool script contents. * fix_srcfile_path: libtool script contents. * formal versioning: Libtool versioning. * global functions: Library tips. * global_symbol_pipe: libtool script contents. * global_symbol_to_cdecl: libtool script contents. * hardcode.test: Test descriptions. * hardcode_action: libtool script contents. * hardcode_direct: libtool script contents. * hardcode_libdir_flag_spec: libtool script contents. * hardcode_libdir_separator: libtool script contents. * hardcode_minus_L: libtool script contents. * hardcode_shlibpath_var: libtool script contents. * header files: Library tips. * host: libtool script contents. * host_alias: libtool script contents. * implementation of libtool: libtool script contents. * include files, portable: C header files. * include_expsyms: libtool script contents. * install: Installing libraries. * install mode: Install mode. * installation, finishing: Installing libraries. * inter-library dependencies: Inter-library dependencies. * inter-library dependency: Porting inter-library dependencies. * languages, non-C: Other languages. * LD <1>: libtool script contents. * LD: Invoking ltconfig. * LDFLAGS: Invoking ltconfig. * libext: libtool script contents. * libltdl: Using libltdl. * libname_spec: libtool script contents. * libraries, definition of: Libtool paradigm. * libraries, finishing installation: Installing libraries. * libraries, stripping: Installing libraries. * library interfaces: Interfaces. * library interfaces, design: Library tips. * library object file: Creating object files. * library_names_spec: libtool script contents. * LIBS: Invoking ltconfig. * libtool: Invoking libtool. * libtool command options: Invoking libtool. * libtool examples: Using libtool. * libtool implementation: libtool script contents. * libtool libraries: Linking libraries. * libtool library versions: Libtool versioning. * libtool specifications: Motivation. * libtoolize: Invoking libtoolize. * libtoolize command options: Invoking libtoolize. * link mode: Link mode. * link-2.test: Test descriptions. * link.test: Test descriptions. * link_static_flag: libtool script contents. * linking against installed libraries: Linking executables. * linking against uninstalled libraries: Linking executables. * linking with installed libtool libraries: Linking executables. * linking, partial: Link mode. * LN_S: Invoking ltconfig. * lt_dladdsearchdir: Libltdl interface. * lt_dlclose: Libltdl interface. * lt_dlerror: Libltdl interface. * lt_dlexit: Libltdl interface. * lt_dlfree: Libltdl interface. * lt_dlgetsearchpath: Libltdl interface. * lt_dlhandle: Libltdl interface. * lt_dlinit: Libltdl interface. * lt_dlmalloc: Libltdl interface. * lt_dlopen: Libltdl interface. * lt_dlopenext: Libltdl interface. * lt_dlpreload: Libltdl interface. * lt_dlpreload_default: Libltdl interface. * lt_dlsetsearchpath: Libltdl interface. * lt_dlsym: Libltdl interface. * lt_dlsymlist <1>: Libltdl interface. * lt_dlsymlist: Dlpreopening. * lt_preloaded_symbols: Dlpreopening. * lt_ptr_t: Libltdl interface. * LTALLOCA: Autoconf .o macros. * ltconfig: Invoking ltconfig. * ltconfig command options: Invoking ltconfig. * LTCONFIG_VERSION: libtool script contents. * LTDL_SET_PRELOADED_SYMBOLS: Libltdl interface. * LTLIBOBJS: Autoconf .o macros. * LTLIBRARIES: Using Automake. * ltmain.sh: Distributing. * Makefile: Makefile rules. * Makefile.am: Makefile rules. * Makefile.in: Makefile rules. * mdemo-conf.test: Test descriptions. * mdemo-exec.test: Test descriptions. * mdemo-inst.test: Test descriptions. * mdemo-make.test: Test descriptions. * mdemo-shared.test: Test descriptions. * mdemo-static.test: Test descriptions. * mdemo-unst.test: Test descriptions. * mode, compile: Compile mode. * mode, execute: Execute mode. * mode, finish: Finish mode. * mode, install: Install mode. * mode, link: Link mode. * mode, uninstall: Uninstall mode. * modules, dynamic <1>: Using libltdl. * modules, dynamic: Dlopened modules. * motivation for writing libtool: Motivation. * names of dynamic modules: Finding the dlname. * need_lib_prefix: libtool script contents. * need_locks: libtool script contents. * need_version: libtool script contents. * NM <1>: libtool script contents. * NM: Invoking ltconfig. * no_builtin_flag: libtool script contents. * no_undefined_flag: libtool script contents. * noinst-link.test: Test descriptions. * nomode.test: Test descriptions. * none: Porting inter-library dependencies. * objdir: libtool script contents. * OBJDUMP: Invoking ltconfig. * object files, compiling: Creating object files. * object files, library: Creating object files. * objext: libtool script contents. * old_archive_cmds: libtool script contents. * old_archive_from_new_cmds: libtool script contents. * old_postinstall_cmds: libtool script contents. * old_postuninstall_cmds: libtool script contents. * opaque data types: Library tips. * options, libtool command: Invoking libtool. * options, libtoolize command: Invoking libtoolize. * options, ltconfig command: Invoking ltconfig. * other implementations, flaws in: Postmortem. * partial linking: Link mode. * pass_all: Porting inter-library dependencies. * PIC (position-independent code): Creating object files. * pic_flag: libtool script contents. * pitfalls using C++: C++ libraries. * pitfalls with dlopen: Dlopen issues. * portable C headers: C header files. * position-independent code: Creating object files. * postinstall_cmds: libtool script contents. * postinstallation: Installing libraries. * postuninstall_cmds: libtool script contents. * problem reports: Reporting bugs. * problems, blaming somebody else for: Troubleshooting. * problems, solving: Troubleshooting. * program wrapper scripts: Linking executables. * quote.test: Test descriptions. * RANLIB <1>: libtool script contents. * RANLIB: Invoking ltconfig. * ranlib: Linking libraries. * reload_cmds: libtool script contents. * reload_flag: libtool script contents. * renaming interface functions: Library tips. * reporting bugs: Reporting bugs. * reusability of library systems: Postmortem. * runpath_var: libtool script contents. * saving time: Static-only libraries. * security problems with buggy linkers: Linking executables. * sh.test: Test descriptions. * shared libraries, not using: Static-only libraries. * shared library versions: Versioning. * shl_load <1>: Using libltdl. * shl_load: Dlopened modules. * shlibpath_overrides_runpath: libtool script contents. * shlibpath_var: libtool script contents. * solving problems: Troubleshooting. * soname_spec: libtool script contents. * specifications for libtool: Motivation. * standalone binaries: Static libraries. * static linking: Static libraries. * strip: Installing libraries. * stripping libraries: Installing libraries. * su: Installing libraries. * suffix.test: Test descriptions. * sys_lib_dlsearch_path_spec: libtool script contents. * sys_lib_search_path_spec: libtool script contents. * test suite: Libtool test suite. * test_compile: Porting inter-library dependencies. * tests, failed: When tests fail. * thread_safe_flag_spec: libtool script contents. * time, saving: Static-only libraries. * tricky design issues: Issues. * trouble with C++: C++ libraries. * trouble with dlopen: Dlopen issues. * troubleshooting: Troubleshooting. * undefined symbols, allowing: Link mode. * uninstall mode: Uninstall mode. * unknown: Porting inter-library dependencies. * unresolved symbols, allowing: Link mode. * using shared libraries, not: Static-only libraries. * version_type: libtool script contents. * versioning, formal: Libtool versioning. * whole_archive_flag_spec: libtool script contents. * wl: libtool script contents. * wrapper scripts for programs: Linking executables.