+Fri Feb 6 00:20:41 1998 Gordon Matzigkeit <gord@profitpress.com>
+
+ * ltconfig.in, ltmain.in (Xsed): `arg=-n; echo "$arg" | sed ...'
+ gives problems, because the `-n' is interpreted as an option to
+ echo(1). So, use `echo "X$arg" | sed -e 's/^X//' ...' everywhere,
+ via the $Xsed convenience variable. Suggested by H.J. Lu.
+
+Mon Feb 2 12:24:22 1998 Gordon Matzigkeit <gord@profitpress.com>
+
+ * ltconfig.in: Turn off IRIX shared library support until 32-bit
+ and 64-bit ABI differences can be resolved.
+
+Wed Jan 28 14:33:04 1998 Gordon Matzigkeit <gord@profitpress.com>
+
+ * libtool.m4 (LD): Reverse yesterday's change because `-old_ld'
+ isn't accepted by GCC.
+
+Tue Jan 27 09:59:19 1998 Gordon Matzigkeit <gord@profitpress.com>
+
+ * ltconfig.in (soname_spec): Add in user-specified release numbers
+ for every host system that supports an soname that differs from
+ the linkname.
+
+ * libtool.m4 (LD): Add `-old_ld' to the list of flags that need to
+ be passed through on SGI. Reported by Chris Lee.
+
+ * ltmain.in (release): Prepend a hyphen to the release number, and
+ fix a typo because `-version-info' takes only 3 args. From
+ H.J. Lu.
+
+Sun Jan 25 12:44:50 1998 Gordon Matzigkeit <gord@profitpress.com>
+
+ * ltconfig.in (library_names_spec): On Linux, use the
+ user-specified release.
+
+ * ltmain.in (link): Allow the user to specify a release number for
+ the library using the `-release' flag. Suggested by H.J. Lu and
+ Ian Lance Taylor.
+
Mon Jan 19 10:03:03 1998 Gordon Matzigkeit <gord@profitpress.com>
* ltconfig.in (old_postuninstall_cmds): Reorder so that chmod
NEWS - list of user-visible changes between releases of GNU Libtool
New:
+* Bug fixes.
* Inter-library dependencies are automatically handled when linking
against a `.la' file. This, along with `-no-undefined', should
prevent many accidental libtool misuses.
+* New `-release' flag to encode release numbers into libtool
+ libraries. This breaks binary compatibility, but is useful for
+ libraries whose interfaces change very frequently. See
+ (libtool)Versioning.
New in 1.0h - 1997-12-01, Gordon Matzigkeit:
* A fix for an insidious bug in the quoting code, which broke
AIX 4.x (*-*-aix4*)
Digital/UNIX 3.x, 4.x, a.k.a. OSF/1 (*-*-osf3*, *-*-osf4*)
FreeBSD 2.x, 3.x (*-*-freebsd2*, *-*-freebsd3*)
- HP-UX 9.x, 10.x (*-*-hpux9*, *-*-hpux10*)
+ HP-UX 9.x, 10.x (*-*-hpux9*, *-*-hpux10*) [see note]
IRIX 5.x, 6.x (*-*-irix5*, *-*-irix6*)
Linux ELF (*-*-linux*, except aout, coff, and oldld)
NetBSD 1.x (*-*-netbsd*)
UTS 4.x (*-*-uts4*)
All ELF targets that use both the GNU C compiler (gcc) and GNU ld
+NOTE: The vendor-distributed HP-UX sed(1) programs are horribly broken,
+and cannot handle libtool's requirements, so users may report unusual
+problems. There is no workaround except to install a working sed
+(such as GNU sed) on these systems.
+
See the file NEWS for a description of recent changes to libtool.
See the file INSTALL for instructions on how to build and install
Bruno Haible <haible@ilog.fr>
Carl D. Roth <roth@cse.ucsc.edu>
Charles S. Kerr <cskerr@delenn.jccbi.gov>
+H.J. Lu <hjl@lucon.org>
+Ian Lance Taylor <ian@cygnus.com>
Joel Cannon <cannon@alpha.centenary.edu>
Joel N. Weber II <devnull@gnu.ai.mit.edu>
Karl Berry <kb@cs.umb.edu>
really should make our shared library support just depend on the
compiler type.
-* Explain why we have the `-lm' in:
-libhello_la_LDFLAGS = -version-info 3:12:1 -lm
-
-* Explain why we don't allow `-o SOMEFILE' with compile mode.
-
* Alexandre Oliva suggests that we hardcode paths into libraries, as
well as binaries: `... -Wl,-soname -Wl,/tmp/libtest.so.0 ...'.
-* Primoz Peterlin <peterlin@biofiz.mf.uni-lj.si> \e-A\ ei\ fcrit:
-
-> A very first impression after compiling the new recode on HP-UX 9.05
-> (with gcc and various other gnuities). I encountered the following
-> problem [...]
-> ../libtool: /./ltmain.sh: not found
-
-This is a bug in HP-UX sed. The correct solution is to obtain a sed
-update from your HP-UX vendor, or to install GNU sed. The sed
-distributed with HP-UX is so horribly broken that it is impossible to
-change libtool so that it works by using it.
-
-* From Kenneth Albanowski:
-
-At the very least, this message should be tailored for the OS and
-libraries -- if Linux's ld requires explicit -rpath arguments (instead of
-treating all -L paths as -rpaths) then this message should mention it, as
-well as the full options. Something like this would seem ideal:
-
- Libraries have been installed to /usr/lib, /usr/local/lib, /foo/bar
- and /foo/baz. To link against libraries in /foo/bar and /foo/baz, users
- may have to:
- - Use the -L/foo/bar and -L/foo/baz linker flags, and
- - Add /foo/bar:/foo/baz to their LD_LIBRARY_PATH environment
- variable during execution, or
- - Add /foo/bar:/foo/baz to their LD_RUN_PATH environment
- variable during linking, or
- - Use the -rpath /foo/bar and -rpath /foo/baz linker flags, or
- - Have the system administrator add /foo/bar and /foo/bz to
- /etc/ld.so.conf
- [See the ld.so(8) manual page and any operating system documentation
- about shared libraries for more information.]
-
-* Franc,ois Pinard about debugging:
-
-``Another thing I'm curious to experiment is how will `gdb' perform
-with shared libraries. There are a few notes in the manual about
-generating a "more easy to debug" version of the program. I tried the
-recipe, but it broke somewhere in Automake generated dependency code,
-so I got to remove it for now. However, the manual does not explain
-what the debugging difficulty is, and so, I wonder what problems I
-will meet.''
-
-* Document the change from `-allow-undefined' to `-no-undefined'.
-
-* Document what to tell users about adding their libraries to their
-`ldconfig' directories at bootup. Libtool doesn't do this
-automatically, because it can't.
-
-* Some packages, such as GIMP, choose to put a note about
-`--disable-shared' in their README:
-
-----------------------------------------------------------------------
-The GIMP uses GNU libtool in order to build shared libraries on a
-variety of systems. While this is very nice for making usable
-binaries, it can be a pain when trying to debug a program. For that
-reason, compilation of shared libraries can be turned off by
-specifying the "--disable-shared" option to "configure".
-----------------------------------------------------------------------
-Simply invoke configure in the top-level directory. Besides the usual
-GNU configure options, there are the following SANE specific options:
-
- --disable-shared
- Don't use shared libraries. Useful for debugging or when there
- is a problem building shared libraries.
-----------------------------------------------------------------------
-
-Perhaps a similar note could be added to ABOUT-NLS.
-
-I'll add a suggestion to the libtool documentation, so that other
-maintainers add this kind of note to their package documentation. The
-biggest motivation, mentioned by Franc,ois Pinard, is to turn off
-double-compilation.
+* Implement full support for other orthogonal library types
+(libhello_g, libhello_p, 64 vs 32-bit ABI's, etc). Make these types
+configurable.
In the future:
**************
Things to think about:
**********************
-* Implement full support for other orthogonal library types
-(libhello_g, libhello_p). Make these types configurable. Some
-thinking will have to be done about the defaults, and what libhello
-(standard type) should be.
-
-Maybe we should just add an autoconf macro and get creative with
-library_transform_name, or something. These changes should be
-partially driven by the needs of packaging tools, such as RPM and
-dpkg.
-
* Talk with RMS about his so-called `automatic package generation
tool.' This is probably what Thomas has been murmuring about for the
Hurd. We'll need to integrate package-supplied programs such as
* 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.
Configuring libtool
* Interfaces:: What are library interfaces?
* Libtool versioning:: Libtool's versioning system.
* Updating version info:: Changing version information before releases.
+* Release numbers:: Breaking binary compatibility for aesthetics.
Tips for interface design
Using libtool with other languages
-* C++ libraries:: Building libraries for C++.
+* C++ libraries::
Troubleshooting
Platform quirks
+* References:: Finding more information.
* Compilers:: Creating object files from source files.
* Reloadable objects:: Binding object files together.
* Archivers:: Programs that create static archives.
If shared libraries are being built, any necessary PIC generation flags
are substituted into the compilation command.
+Note that the @samp{-o} option is not supported for compile mode,
+because it cannot be implemented properly for all platforms. It is far
+easier just to change your Makefiles to create all the output files in
+the current working directory.
+
@node Link mode
@section Link mode
@cindex Link mode
@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 your
+package, so that users can easily tell which versions are newer than
+others. Be warned that no two releases of your package will be binary
+compatible if you use this flag. If you want binary compatibility, use
+the @samp{-version-info} flag (@pxref{Versioning}).
+
@item -rpath @var{libdir}
If @var{output-file} is a library, it will eventually be installed in
@var{libdir}.
library, then only create a static library.
@item -version-info @var{current}[:@var{revision}[:@var{age}]]
-If @var{output-file} is a libtool library, use library version
-information @var{current}, @var{revision}, and @var{age} to build it.
-If not specified, each of these variables defaults to 0
-(@pxref{Versioning}).
+If @var{output-file} is a libtool library, use interface version
+information @var{current}, @var{revision}, and @var{age} to build it
+(@pxref{Versioning}). Do @strong{not} use this flag to specify package
+release information, rather see the @samp{-release} flag.
@end table
If the @var{output-file} ends in @samp{.la}, then a libtool library is
* 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
@defmac AM_PROG_LIBTOOL
Add support for the @samp{--enable-shared} and @samp{--disable-shared}
@code{configure} flags. Invoke @code{ltconfig} with the correct
-arguments to configure the package.@footnote{@code{AM_PROG_LIBTOOL}
-requires that you define the @file{Makefile} variable @code{top_builddir} in
-your @file{Makefile.in}. Automake does this automatically, but Autoconf
-users should set it to the relative path to the top of your build
-directory (@file{../..}, for example).}
+arguments to configure the package (@pxref{Invoking
+ltconfig}).@footnote{@code{AM_PROG_LIBTOOL} requires that you define the
+@file{Makefile} variable @code{top_builddir} in your @file{Makefile.in}.
+Automake does this automatically, but Autoconf users should set it to
+the relative path to the top of your build directory (@file{../..}, for
+example).}
@end defmac
@pindex aclocal
AC_OUTPUT(@dots{})
@end example
+@node Static-only libraries
+@section Static-only libraries
+@cindex Debugging libraries
+@cindex Developing libraries
+@cindex Double-compilation, avoiding
+@cindex Avoiding shared libraries
+@cindex Eliding shared libraries
+@cindex Using shared libraries, not
+@cindex Shared libraries, not using
+@cindex Time, saving
+@cindex Saving time
+
+When you are developing a package, it is often worthwhile to configure
+your package with the @samp{--disable-shared} flag
+(@pxref{AM_PROG_LIBTOOL}). This prevents libtool from building shared
+libraries, which has several advantages:
+
+@itemize @bullet
+@item
+compilation is twice as fast, which can speed up your development cycle
+
+@item
+debugging is easier because you don't need to deal with any complexities
+added by shared libraries
+
+@item
+you can see how libtool behaves on static-only platforms
+@end itemize
+
+You may want to put a small note in your package @file{README} to let
+other developers know that @samp{--disable-shared} can save them time.
+The following example note is taken from the GIMP@footnote{GNU Image
+Manipulation Program, for those who haven't taken the plunge. See
+@url{http://www.gimp.org/}.} distribution @file{README}:
+
+@example
+The GIMP uses GNU libtool in order to build shared libraries on a
+variety of systems. While this is very nice for making usable
+binaries, it can be a pain when trying to debug a program. For that
+reason, compilation of shared libraries can be turned off by
+specifying the "--disable-shared" option to "configure".
+@end example
+
@node Versioning
@chapter Library interface versions
@cindex Dynamic dependencies
* Interfaces:: What are library interfaces?
* Libtool versioning:: Libtool's versioning system.
* Updating version info:: Changing version information before releases.
+* Release numbers:: Breaking binary compatibility for aesthetics.
@end menu
@node Interfaces
set @var{age} to 0.
@end enumerate
-@strong{@emph{Never}} try to set library version numbers so that they
+@strong{@emph{Never}} try to set the interface numbers so that they
correspond to the release number of your package. This is an abuse that
only fosters misunderstanding of the purpose of library versions.
+Instead, use the @samp{-release} flag (@pxref{Release numbers}), but be warned
+that every release of your package will not be binary compatibility with
+any other release.
+
+@node Release numbers
+@section Managing release information
+
+Often, people want to encode the name of the package release into the
+shared library so that it is obvious to the user which package their
+programs are linked against. This convention is used especially on
+Linux:
+
+@example
+trick$ @kbd{ls /usr/lib/libbfd*}
+/usr/lib/libbfd.a /usr/lib/libbfd.so.2.7.0.2
+/usr/lib/libbfd.so
+trick$
+@end example
+
+On @samp{trick}, @file{/usr/lib/libbfd.so} is just a symbolic link to
+@file{/usr/lib/libbfd.so.2.7.0.2}, which was distributed as a part of
+@samp{binutils-2.7.0.2}.
+
+Unfortunately, this convention conflicts directly with libtool's idea of
+library interface versions, because the library interface rarely changes
+at the same time that the release number does, and the library suffix is
+never the same across all platforms.
+
+So, in order to accomodate both views, you should use the
+@samp{-release} flag in order to set any release information. For the
+@file{libbfd} example, the next release which uses libtool should be
+built with @samp{-release 2.9.0}, which will produce the following files
+on Linux:
+
+@example
+trick$ @kbd{ls /usr/lib/libbfd*}
+/usr/lib/libbfd-2.9.0.so.0 /usr/lib/libbfd.so
+/usr/lib/libbfd-2.9.0.so.0.0.0 /usr/lib/libbfd.a
+trick$
+@end example
+
+In this case, @file{/usr/lib/libbfd.so} is a symbolic link to
+@file{/usr/lib/libbfd-2.9.0.so.0.0.0}. This makes it obvious that the
+user is dealing with @samp{binutils-2.9.0}, without compromising
+libtool's idea of interface versions.
+
+Note that this option actually causes a modification of the library
+name, so do not use it if unless you want to break binary compatibility
+with any past library releases. In general, you should only use
+@samp{-release} for libraries whose interfaces change very frequently.
@node Library tips
@chapter Tips for interface design
and what special considerations you need to make if you do not use C.
@menu
-* C++ libraries:: Building libraries for C++.
+* C++ libraries::
@end menu
@node C++ libraries
improve libtool, or write your own.
@menu
+* References:: Finding more information.
* Compilers:: Creating object files from source files.
* Reloadable objects:: Binding object files together.
* Archivers:: Programs that create static archives.
* Strip:: Removing unnecessary linkage information.
@end menu
+@node References
+@subsection References
+
+The following is a list of valuable documentation references:
+
+@itemize @bullet
+@item
+SGI's IRIX Manual Pages,
+@url{http://techpubs.sgi.com/cgi-bin/infosrch.cgi?cmd=browse&db=man}.
+
+@item
+Sun's free service area
+(@url{http://www.sun.com/service/online/free.html}) and documentation
+server (@url{http://docs.sun.com/}).
+@end itemize
+
@node Compilers
@subsection Compilers
fi
fi
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but don't quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
# The name of this program.
-progname=`$echo "$0" | sed 's%^.*/%%'`
+progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
help="Try \`$progname --help' for more information."
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
-
-# Same as above, but don't quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
-
# Global variables:
can_build_shared=yes
enable_shared=yes
if test -z "$srcdir"; then
# Assume the source directory is the same one as the path to ltmain.sh.
- srcdir=`echo "$ltmain" | sed 's%/[^/]*$%%'`
+ srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
test "$srcdir" = "$ltmain" && srcdir=.
fi
export_dynamic_flag_spec='${wl}-E'
;;
- irix5* | irix6*)
- archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- ;;
+# FIXME: reimplement IRIX shared libraries.
+# irix5* | irix6*)
+# archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
+# hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+# ;;
netbsd*)
# Tested with NetBSD 1.2 ld
archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
+
+ # Solaris 2 before 2.5 hardcodes -L paths.
+ case "$host_os" in
+ solaris2.[0-4]*)
+ hardcode_minus_L=yes
+ ;;
+ esac
;;
sunos4*)
hardcode_shlibpath_var=no
;;
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib$libobjs'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=no
- hardcode_minus_L=no
- hardcode_shlibpath_var=no
- ;;
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=no
+ ;;
*)
ld_shlibs=no
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
wcout=`wc "$nlist" 2>/dev/null`
- count=`echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
+ count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
(test "$count" -ge 0) 2>/dev/null || count=-1
else
rm -f "$nlist"T
case "$host_os" in
aix3* | aix4*)
version_type=linux
- library_names_spec='$libname.so.$versuffix $libname.a'
+ library_names_spec='${libname}${release}.so.$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX has no versioning support, so we append a major version to the name.
- soname_spec='$libname.so.$major'
+ soname_spec='${libname}${release}.so.$major'
;;
amigaos*)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "$lib" | sed '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
;;
freebsd2* | freebsd3*)
dynamic_linker="$host_os dld.sl"
version_type=sunos
shlibpath_var=SHLIB_PATH
- library_names_spec='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
- soname_spec='$libname.sl.$major'
+ library_names_spec='${libname}${release}.sl.$versuffix ${libname}${release}.sl.$major $libname.sl'
+ soname_spec='${libname}${release}.sl.$major'
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
;;
irix5* | irix6*)
version_type=osf
- soname_spec='$libname.so'
- library_names_spec='$libname.so.$versuffix $libname.so'
+ soname_spec='${libname}${release}.so'
+ library_names_spec='${libname}${release}.so.$versuffix $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
# This must be Linux ELF.
linux-gnu*)
version_type=linux
- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
- soname_spec='$libname.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
osf3* | osf4*)
version_type=osf
- soname_spec='$libname.so'
- library_names_spec='$libname.so.$versuffix $libname.so'
+ soname_spec='${libname}${release}.so'
+ library_names_spec='${libname}${release}.so.$versuffix $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
sco3.2v5*)
version_type=osf
- soname_spec='$libname.so.$major'
- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
solaris2*)
version_type=linux
- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
- soname_spec='$libname.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
shlibpath_var=LD_LIBRARY_PATH
;;
uts4*)
version_type=linux
- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
- soname_spec='$libname.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
+ soname_spec='${libname}${release}.so.$major'
shlibpath_var=LD_LIBRARY_PATH
;;
old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
postinstall_cmds | postuninstall_cmds | finish_cmds)
# Double-quote double-evaled strings.
- eval "$var=\`\$echo \"\$$var\" | sed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
+ eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
;;
*)
- eval "$var=\`\$echo \"\$$var\" | sed \"\$sed_quote_subst\"\`"
+ eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
;;
esac
done
# Compiler and other test output produced by $progname, useful for
# debugging $progname, is in ./config.log if it exists.
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="sed -e s/^X//"
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
;;
*) cat <<EOF >> $ofile
# Find the path to this script.
-thisdir=\`\$echo "\$0" | sed -e 's%/[^/]*\$%%'\`
+thisdir=\`\$echo "X\$0" | \$Xsed -e 's%/[^/]*\$%%'\`
test "X\$0" = "X\$thisdir" && thisdir=.
# Execute the libtool backend.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# NLS nuisances.
shift
case "$arg" in
- -*=*) optarg=`$echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
# Backslashify any backslashes, double quotes, and dollar signs.
# These are the only characters that are still specially
# interpreted inside of double-quoted scrings.
- lastarg=`$echo "$lastarg" | sed "$sed_quote_subst"`
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly in scan
done
# Get the name of the library object.
- libobj=`$echo "$srcfile" | sed -e 's%^.*/%%'`
+ libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
# Recognize several different file suffixes.
xform='[cCFSfms]'
*.for) xform=for ;;
esac
- libobj=`$echo "$libobj" | sed -e "s/\.$xform$/.lo/"`
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
case "$libobj" in
- *.lo) obj=`$echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
*)
$echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
exit 1
objs=
prev=
prevarg=
+ release=
rpath=
perm_rpath=
temp_rpath=
;;
esac
;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
rpath)
rpath="$rpath $arg"
prev=
;;
-L*)
- dir=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
+ dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
case "$dir" in
/*)
# Add the corresponding hardcode_libdir_flag, if it is not identical.
-o) prev=output ;;
+ -release)
+ prev=release
+ continue
+ ;;
+
-rpath)
prev=rpath
continue
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- arg=`$echo "$arg" | sed "$sed_quote_subst"`
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- dlprefiles="$dlprefiles "`$echo "$arg" | sed 's/\.lo$/\.o/'`
+ dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
prev=
fi
libobjs="$libobjs $arg"
fi
# Find the relevant object directory and library name.
- name=`$echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
- dir=`$echo "$arg" | sed 's%/[^/]*$%%'`
+ name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+ dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$arg"; then
dir="$objdir"
else
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- arg=`$echo "$arg" | sed "$sed_quote_subst"`
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
- name=`$echo "$output" | sed -e 's/\.la$//' -e 's/^lib//'`
+ name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
libname=`eval \\$echo \"$libname_spec\"`
# All the library-specific variables (install_libdir is set above).
if test -n "$dlfiles$dlprefiles"; then
$echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
# Nullify the symbol file.
- compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
- finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test -z "$rpath"; then
# Create the output directory, or remove our outputs if we need to.
if test -d $objdir; then
- $show "$rm $objdir/$output $objdir/$libname.*"
- $run $rm $objdir/$output $objdir/$libname.*
+ $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
+ $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
else
$show "$mkdir $objdir"
$run $mkdir $objdir
done
# Use standard objects if they are PIC.
- test -z "$pic_flag" && libobjs=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'`
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
# Do each of the archive commands.
cmds=`eval \\$echo \"$archive_cmds\"`
if test -n "$dlfiles$dlprefiles"; then
$echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
# Nullify the symbol file.
- compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
- finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
fi
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
+ fi
+
case "$output" in
*.lo)
if test -n "$objs"; then
exit 1
fi
libobj="$output"
- obj=`$echo "$output" | sed 's/\.lo$/.o/'`
+ obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
;;
*)
libobj=
$run $rm $obj $libobj
# Create the old-style object.
- reload_objs="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+ reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
output="$obj"
cmds=`eval \\$echo \"$reload_cmds\"`
$echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
fi
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
+ fi
+
if test -n "$rpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath; do
# Substitute the hardcoded libdirs into the compile commands.
if test -n "$hardcode_libdir_separator"; then
- compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
- finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
fi
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
- compile_command=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
- finalize_command=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
+ compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
+ finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
fi
if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
if test -n "$dlsyms"; then
# Add our own program objects to the preloaded list.
- dlprefiles=`$echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
+ dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
# Discover the nlist of each of the dlfiles.
nlist="$objdir/${output}.nm"
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
wcout=`wc "$nlist" 2>/dev/null`
- count=`echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
+ count=`echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
(test "$count" -ge 0) 2>/dev/null || count=-1
else
$rm "$nlist"T
$run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
# Transform the symbol file into the correct name.
- compile_command=`$echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
- finalize_command=`$echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
elif test "$export_dynamic" != yes; then
test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
else
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
# Nullify the symbol file.
- compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
- finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
- compile_command=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
- finalize_command=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# We have no uninstalled library dependencies, so finalize right now.
$show "$compile_command"
fi
# Replace the output file specification.
- compile_command=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$objdir/$output"'%g'`
- finalize_command=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$objdir/$output"'T%g'`
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
# Create the binary in the object directory, then wrap it.
if test -d $objdir; then :
$show "creating $output"
# Quote the finalize command for shipping.
- finalize_command=`$echo "$finalize_command" | sed "$sed_quote_subst"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
# Quote $echo for shipping.
- qecho=`$echo "$echo" | sed "$sed_quote_subst"`
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
# Only actually do things if our run command is non-null.
if test -z "$run"; then
# This wrapper script should never be moved out of \``pwd`'.
# If it is, it will not operate correctly.
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
fi
# Find the directory that this script lives in.
- thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\`
+ thisdir=\`\$echo "X\$file" | \$Xsed -e 's%/[^/]*$%%'\`
test "x\$thisdir" = "x\$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld "\$file" | sed -n 's/.*-> //p'\`
while test -n "\$file"; do
- destdir=\`\$echo "\$file" | sed 's%/[^/]*\$%%'\`
+ destdir=\`\$echo "X\$file" | \$Xsed -e 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test "x\$destdir" != "x\$file"; then
esac
fi
- file=\`\$echo "\$file" | sed 's%^.*/%%'\`
+ file=\`\$echo "X\$file" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld "\$thisdir/\$file" | sed -n 's/.*-> //p'\`
done
$shlibpath_var="$temp_rpath\$$shlibpath_var"
# Some systems cannot cope with colon-terminated $shlibpath_var
- $shlibpath_var=\`\$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
+ $shlibpath_var=\`\$echo "X\$$shlibpath_var" | \$Xsed -e 's/:*\$//'\`
export $shlibpath_var
for arg
do
# Quote arguments (to preserve shell metacharacters).
- sed_quote_subst='$sed_quote_subst'
- arg=\`\$echo "\$arg" | sed "\$sed_quote_subst"\`
+ arg=\`\$echo "X\$arg" | \$Xsed -e "\$sed_quote_subst"\`
args="\$args \\"\$arg\\""
done
# See if we need to build an old-fashioned archive.
if test "$build_old_libs" = "yes"; then
# Transform .lo files to .o files.
- oldobjs="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+ oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL"; then
# Aesthetically quote it.
- arg=`$echo "$nonopt" | sed "$sed_quote_subst"`
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
- arg=`$echo "$arg" | sed "$sed_quote_subst"`
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
esac
# Aesthetically quote the argument.
- arg=`$echo "$arg" | sed "$sed_quote_subst"`
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
fi
# Strip any trailing slash from the destination.
- dest=`$echo "$dest" | sed 's%/$%%'`
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
# Check to see that the destination is a directory.
test -d "$dest" && isdir=yes
destdir="$dest"
destname=
else
- destdir=`$echo "$dest" | sed 's%/[^/]*$%%'`
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
test "X$destdir" = "X$dest" && destdir=.
- destname=`$echo "$dest" | sed 's%^.*/%%'`
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
# Not a directory, so check to see that there is only one file specified.
set dummy $files
esac
fi
- dir="`$echo "$file" | sed 's%/[^/]*$%%'`/"
+ dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
fi
# Install the pseudo-library for information purposes.
- name=`$echo "$file" | sed 's%^.*/%%'`
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
$show "$install_prog $file $destdir/$name"
$run eval "$install_prog $file $destdir/$name" || exit $?
if test -n "$destname"; then
destfile="$destdir/$destname"
else
- destfile=`$echo "$file" | sed 's%^.*/%%'`
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# Deduce the name of the destination old-style object file.
case "$destfile" in
*.lo)
- staticdest=`$echo "$destfile" | sed 's/\.lo$/\.o/'`
+ staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
;;
*.o)
staticdest="$destfile"
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
- staticobj=`$echo "$file" | sed 's/\.lo$/\.o/'`
+ staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
$show "$install_prog $staticobj $staticdest"
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
*) . ./$lib ;;
esac
fi
- libfile="$libdir/`$echo "$lib" | sed 's%^.*/%%g'`"
+ libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
if test -z "$libdir"; then
$echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
elif test -f "$libfile"; then :
fi
else
# Install the binary that we compiled earlier.
- file=`$echo "$file" | sed "s%\([^/]*\)$%$objdir/\1%"`
+ file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
done
for file in $staticlibs; do
- name=`$echo "$file" | sed 's%^.*/%%'`
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
# Set up the ranlib parameters.
oldlib="$destdir/$name"
continue
fi
- dir=`$echo "$file" | sed 's%/[^/]*$%%'`
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
if test -f "$dir/$objdir/$dlname"; then
*.lo)
# Just add the directory containing the .lo file.
- dir=`$echo "$file" | sed 's%/[^/]*$%%'`
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
;;
;;
esac
# Quote arguments (to preserve shell metacharacters).
- file=`$echo "$file" | sed "$sed_quote_subst"`
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
args="$args \"$file\""
done
fi
for file in $files; do
- dir=`$echo "$file" | sed -e 's%/[^/]*$%%'`
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
- name=`$echo "$file" | sed -e 's%^.*/%%'`
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
rmfiles="$file"
*.lo)
if test "$build_old_libs" = yes; then
- oldobj=`$echo "$name" | sed 's/\.lo$/\.o/'`
+ oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
rmfiles="$rmfiles $dir/$oldobj"
fi
$show "$rm $rmfiles"
-lNAME OUTPUT-FILE requires the installed library libNAME
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-static do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]