+Tue Apr 1 10:01:20 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * libtool.scm: Initial Guile implementation of libtool.
+
+ * ltmain.sh.in: An unexpected inconsistency in my whole approach
+ to shared libraries has proven that libtool needs to be completely
+ rewritten if I'm going to give full shared library support for
+ platforms that don't use the GNU C library version 2 (which to my
+ knowledge currently only works on GNU Hurd and Linux/GNU systems).
+ Porting the GNU C library should not be difficult, though.
+
+ Platforms that don't have the dlopen(3) family of functions will
+ need to install GNU DLD version 4 in order to build any kind of
+ libraries at all. Unfortunately, DLD 4 won't be released for a
+ while, because I maintain it, and I'm too busy working on libtool.
+
+ I'll keep the old ltconfig/ltmain.sh implementation around for as
+ long as I can, and continue applying bug fixes, so that I'll have
+ a reasonable starting point for this new libtool implementation.
+
+ It looks like this implementation will be even more complex than
+ the original (pre-0.7) libtool. Initial estimates show that it
+ may be up to 3 times slower, and 5 times larger than libtool-0.9.
+ I'll probably have to rewrite it in Guile to get reasonable
+ performance, which will severely limit its portability for a
+ while.
+
+ That will also introduce a bootstrapping issue, since the next
+ release of Guile will use libtool to build shared libraries. So,
+ if users want to have shared Guile libraries, they will have to
+ configure Guile with `--disable-shared', compile it, install it,
+ then reconfigure Guile with `--enable-shared' and repeat.
+
+ I was hoping to get libtool 1.0 out the door by early April, but
+ now it looks like it will take at least another year before it'll
+ be usable by the public at large. April fools.
+
+ * ltconfig.in (verify_host): Remove redundant `Transform *-*-linux*
+ to *-*-linux-gnu*'. From Bruno Haible.
+
Mon Mar 31 16:15:03 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+ * Makefile.am: Use the new AUTOMAKE and ACLOCAL variables.
+
* ltmain.sh.in (link): Only fail if a convenience library doesn't
exist, and the user specified -whole-archive.
+ Fix shell quoting that was breaking @OUTPUT@ substitution.
Fri Mar 28 19:09:08 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
libtool: ltconfig
@echo 'WARNING: Warnings from ltconfig can be ignored. :-)'
- CC="${CC}" \
- CFLAGS="${CFLAGS}" \
- CPPFLAGS="${CPPFLAGS}" \
- LD="${LD}" \
- RANLIB="${RANLIB}" \
+ CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \
+ LD="${LD}" RANLIB="${RANLIB}" \
$(srcdir)/ltconfig --srcdir=$(srcdir) $(pkgdatadir)/ltmain.sh
# These depend on config.status for version numbers.
-chmod 755 $(distdir)/demo
here=`pwd`; distdir=`cd $(distdir) && pwd` \
&& cd $(srcdir)/demo \
- && automake --include-deps --build-dir=$$here/demo --srcdir-name=$(srcdir)/demo --output-dir=$$distdir/demo
+ && $(AUTOMAKE) --include-deps --build-dir=$$here/demo --srcdir-name=$(srcdir)/demo --output-dir=$$distdir/demo
@for file in $(demo_distfiles); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
# Rules for rebuilding some of the demo source files.
$(srcdir)/demo/Makefile.in: demo/Makefile.am demo/configure.in demo/aclocal.m4
- cd $(srcdir)/demo && automake
+ cd $(srcdir)/demo && $(AUTOMAKE)
$(srcdir)/demo/configure: demo/configure.in demo/aclocal.m4
- cd $(srcdir)/demo && autoconf
+ cd $(srcdir)/demo && $(AUTOMAKE)
$(srcdir)/demo/aclocal.m4: demo/configure.in demo/acinclude.m4
- cd $(srcdir)/demo && aclocal
+ cd $(srcdir)/demo && $(ACLOCAL)
$(srcdir)/demo/acinclude.m4:
rm -f $(srcdir)/demo/acinclude.m4
NEWS - list of user-visible changes between releases of GNU libtool.
+New in 0.9c:
+* Bug fixes.
+* New Autoconf macros, AM_REPLACE_FUNCS, AM_FUNC_ALLOCA, AM_FUNC_MEMCMP,
+ AM_STRUCT_ST_BLOCKS that set and substitute LTLIBOBJS and LTALLOCA.
+* Automake support for Libtool now uses the LTLIBRARIES primary. See
+ the Automake documentation for more information.
+* Support *-*-linux-gnu* as an alias for *-*-linux*.
+\f
New in 0.9:
* Bug fixes.
* The libtool demo now uses the libm cos(3) function, to demonstrate
hppa1.1-hp-hpux9.05 gcc 0.7a fail
hppa1.1-hp-hpux9.05 cc 0.7a fail
hppa1.1-hp-hpux10.10 cc 0.7a fail
+i386-unknown-linux gcc 0.7c ok
+i386-unknown-netbsd1.2 gcc 0.7c ok
mips-sgi-irix5.3 gcc 0.7a fail
mips-sgi-irix5.3 cc 0.7a fail
mips-sgi-irix6.2 cc -32 0.7a fail
mips-sgi-irix6.2 cc -n32 0.7a fail
-rs6000-ibm-aix3.2.5 gcc* 0.7a gcc bug, fail demo-unst
-rs6000-ibm-aix3.2.5 xlc 0.7a fail demo-unst
-rs6000-ibm-aix4.1.4.0 gcc 0.7a fail demo-inst
-rs6000-ibm-aix4.1.4.0 xlc 0.7a fail demo-inst
+rs6000-ibm-aix3.2.5 gcc 0.7c ok*
+rs6000-ibm-aix3.2.5 xlc 0.7c ok
+rs6000-ibm-aix4.1.4.0 gcc 0.7c ok**
+rs6000-ibm-aix4.1.4.0 xlc 0.7c ok**
sparc-sun-sunos4.1.3_U1 gcc 0.7a ok
sparc-sun-sunos4.1.3_U1 cc 0.7a ok
sparc-sun-solaris2.4 gcc 0.7a ok
sparc-sun-solaris2.4 cc 0.7a ok
+sparc-sun-solaris2.5.1 gcc 0.7c ok
----------------------------------------------------------------------
-* GCC version 2.6.1.
+* GCC 2.6.1 prints warnings about multiple symbol definitions.
+
+** Autoconf 2.12 uses /usr/bin/installbsd, which is buggy, so that
+ demo-inst fails.
See the file README-automake for details on Automake support for libtool.
-See the file PLATFORMS for a list of platforms that libtool shared
-library support was tested on. This information is also in
-(libtool)Tested Platforms.
+See the info node (libtool)Tested Platforms. (or the file doc/platforms.texi)
+for a list of platforms that libtool shared library support was tested on.
If you have any suggestions or bug reports, or you wish to port libtool
to a new platform, please send electronic mail to Gord Matzigkeit
Automake.
In the meantime, just ignore these references, or use Gord's
-modified version of automake-1.1g that supports all the features
+modified version of automake-1.1i that supports all the features
described in the libtool manual:
-<URL:http://www.enci.ucalgary.ca/~gord/src/automake-1.1g-libtool.tar.gz>
+<URL:http://www.enci.ucalgary.ca/~gord/src/automake-1.1j.tar.gz>
Once Automake 1.2 is released, you should get it from your closest GNU
mirror.
-** If you get automake-1.1k, you'll need to apply the following patch
+Thanks,
+
+--Gord
+
+** If you have automake-1.1k, you'll need to apply the following patch
before installing it:
diff -u automake-1.1k/automake.in.orig automake-1.1k/automake.in
Charles S. Kerr <cskerr@delenn.jccbi.gov>
Joel Cannon <cannon@alpha.centenary.edu>
Karl Berry <kb@cs.umb.edu>
+Mark Kettenis <kettenis@phys.uva.nl>
Mimi Burbank <mimi@scri.fsu.edu>
Oliver Guntermann <og@informatik.uni-hannover.de>
Thomas Esser <te@informatik.uni-hannover.de>
-* Implement new idea for Automake support: LTLIBRARIES.
+* Need to change `-rpath FOO -rpath BAR' to `-rpath FOO:BAR' with at
+least OSF/1 ld.
For 1.1:
+* Complete the -export-dynamic flag, and the new dlname mode.
+
+* Complete convenience libraries made of libtool objects. Document
+-whole-archive and -no-whole-archive. We also need a way to use these
+convenience libraries just to resolve symbols, rather than the
+(simplistic) whole-archive and no-whole-archive.
+
* Write libtool not to be dependent on the compiler used to configure
it.
* Implement full multi-language support. There are beginnings of this
in the manual (Other Languages).
-* Consider allowing the creation of convenience libraries made of
-libtool objects. From David Mosberger-Tang. Think about how this
-would be done with Automake.
-
Sometime in the future (maybe):
* Implement `-static' linking against installed libraries, even when
+dnl Process this file with autoconf to create configure.
AC_INIT(ltmain.sh.in)
-AM_INIT_AUTOMAKE(libtool, 0.9c)
+AM_INIT_AUTOMAKE(libtool,0.9d)
pkgdatadir='${datadir}/libtool'
AC_SUBST(pkgdatadir)
aclocaldir='${datadir}/aclocal'
AC_SUBST(aclocaldir)
+dnl Use the specified CC, RANLIB, and LD while running ltconfig.
+AC_PROG_CC
+AC_PROG_RANLIB
+LD="${LD-ld}"
+AC_SUBST(LD)
+
AC_OUTPUT([Makefile doc/Makefile tests/Makefile])
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
CLEANFILES = $(hardcode_tests)
# Build a libtool library, libhello.la for installation in libdir.
-lib_PROGRAMS = libhello.la
+lib_LTLIBRARIES = libhello.la
libhello_la_SOURCES = hello.c foo.c
-libhello_la_LDFLAGS = -version-info 3:12:1 -rpath $(libdir)
+libhello_la_LDFLAGS = -version-info 3:12:1
include_HEADERS = foo.h
AM_INIT_AUTOMAKE(hell,1.0)
AC_PROG_CC
-AM_C_PROTOTYPES
AM_PROG_LIBTOOL
dnl Output the makefile
/* Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu> */
#include "foo.h"
+#include <stdio.h>
+#include <math.h>
int
foo ()
{
+ printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
return FOO_RET;
}
/* Only include this header file once. */
#ifndef _FOO_H_
-#define _FOO_H_
+#define _FOO_H_ 1
/* __BEGIN_DECLS should be used at the beginning of your C declarations,
- so that C++ compilers don't mangle their names. */
-#ifndef __BEGIN_DECLS
-# ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# else
-# define __BEGIN_DECLS
-# endif
-#endif
-#ifndef __END_DECLS
-# ifdef __cplusplus
-# define __END_DECLS };
-# else
-# define __END_DECLS
-# endif
+ so that C++ compilers don't mangle their names. __END_DECLS is used
+ at the end of C declarations. */
+#undef __BEGIN_DECLS
+#undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */
#endif
/* __P is a macro used to wrap function prototypes, so that compilers that
don't understand ANSI C prototypes still work, and ANSI C compilers can
issue warnings about type mismatches. */
-#ifndef __P
-# if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
-# define __P(protos) protos
-# else
-# define __P(protos) ()
-# endif
+#undef __P
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
+# define __P(protos) protos
+#else
+# define __P(protos) ()
#endif
/* Silly constants that the functions return. */
#define HELLO_RET 0xe110
#define FOO_RET 0xf00
-/* Function declarations. Note the wonderful use of the macros we defined
- above (__BEGIN_DECLS, __END_DECLS, and __P). */
+/* Function declarations. Note the wonderful use of the above macros. */
__BEGIN_DECLS
int foo __P((void));
int hello __P((void));
#include <stdio.h>
int
-hello ()
+hello (void)
{
printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
return HELLO_RET;
#include <stdio.h>
int
-main (int argc, char **argv)
+main (argc, argv)
+ int argc;
+ char **argv;
{
printf ("Welcome to GNU Hell!\n");
## Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>
AUTOMAKE_OPTIONS = gnits
info_TEXINFOS = libtool.texi
-
-libtool.info: ../PLATFORMS
+libtool_TEXINFOS = platforms.texi
@settitle libtool
@setchapternewpage off
@c %**end of header
-@syncodeindex vr cp
-@synindex pg cp
@include version.texi
@set BUGADDR Gord Matzigkeit <gord@@gnu.ai.mit.edu>
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Libtool: (libtool). Generic shared library support script.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
+@dircategory GNU programming tools
+@direntry
+* Libtool: (libtool). Generic shared library support script.
+@end direntry
+
+@dircategory Individual utilities
+@direntry
+* libtoolize: (libtool)Invoking libtoolize. Adding libtool support.
+@end direntry
@ifinfo
-This file documents the Libtool library support script.
+This file documents GNU libtool @value{VERSION}
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
@titlepage
@title GNU Libtool
@subtitle For version @value{VERSION}, @value{UPDATED}
-@c copyright page
+@author Gordon Matzigkeit
+
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1996, 1997 Free Software Foundation, Inc.
@sp 2
-This is the second edition of the GNU Libtool documentation,@*
+This is the first edition of the GNU Libtool documentation,@*
and is consistent with GNU Libtool @value{VERSION}.@*
@sp 2
Published by the Free Software Foundation @*
approved by the Free Software Foundation.
@end titlepage
+@c Put everything in one index (arbitrarily chosen to be the concept index).
+@syncodeindex vr cp
+@synindex pg cp
+
@ifinfo
@node Top, Introduction, (dir), (dir)
@comment node-name, next, previous, up
* Versioning:: Using library interface versions.
* Library Tips:: Tips for library interface design.
* Other Languages:: Using libtool without a C compiler.
-* Maintaining:: Information used by the libtool maintainer.
* Troubleshooting:: When libtool doesn't work as advertised.
+* Maintaining:: Information used by the libtool maintainer.
* Index:: Index of concepts, variables, and programs.
+@detailmenu
--- The Detailed Node Listing ---
Introduction
* C++ Libraries:: Using libtool with C++.
+Troubleshooting
+
+* Libtool Test Suite:: Libtool's self-tests.
+* Reporting Bugs:: How to report problems with libtool.
+
+The Libtool Test Suite
+
+* Test Descriptions:: The contents of the test suite.
+* When Tests Fail:: What to do when a test fails.
+
Maintainance Notes for Libtool
* New Ports:: How to port libtool to new systems.
* Reloadable Objects:: Binding object files together.
* Archivers:: Programs that create static archives.
* Strip:: Removing unnecessary linkage information.
-
-Troubleshooting
-
-* Libtool Test Suite:: Libtool's self-tests.
-* Reporting Bugs:: How to report problems with libtool.
-
-The Libtool Test Suite
-
-* Test Descriptions:: The contents of the test suite.
-* When Tests Fail:: What to do when a test fails.
+@end detailmenu
@end menu
@end ifinfo
-@node Introduction, Libtool Paradigm, Top, Top
-@comment node-name, next, previous, up
+@node Introduction
@chapter Introduction
In the past, if a source code package developer wanted to take advantage
* Postmortem:: Learning from past difficulties.
@end menu
-@node Motivation, Issues, Introduction, Introduction
-@comment node-name, next, previous, up
+@node Motivation
@section Motivation for Writing Libtool
@cindex Motivation for writing libtool
Portability to other (non-GNU) architectures and tools is desirable.
@end enumerate
-@node Issues, Other Implementations, Motivation, Introduction
-@comment node-name, next, previous, up
+@node Issues
@section Implementation Issues
@cindex Tricky design issues
required.
@end enumerate
-@node Other Implementations, Postmortem, Issues, Introduction
-@comment node-name, next, previous, up
+@node Other Implementations
@section Other Implementations
I have investigated several different implementations of building shared
of shared library systems that libtool requires. So, other packages
have been more or less abandoned as influences.
-@node Postmortem, , Other Implementations, Introduction
-@comment node-name, next, previous, up
+@node Postmortem
@section A Postmortem Analysis of Other Implementations
@cindex Other implementations, flaws in
that the lessons I've learned in writing it will be taken up and
implemented by designers of library systems.
-@node Libtool Paradigm, Using Libtool, Introduction, Top
-@comment node-name, next, previous, up
+@node Libtool Paradigm
@chapter The Libtool Paradigm
At first, libtool was designed to support an arbitrary number of library
is a new way of thinking, so it may take a little time to absorb, but
when you understand it the world gets simpler.
-@node Using Libtool, Invoking libtool, Libtool Paradigm, Top
-@comment node-name, next, previous, up
+@node Using Libtool
@chapter Using Libtool
@cindex Examples of using libtool
library, @file{libhello}, out of the files @file{foo.c} and
@file{hello.c}.
+Note that the @file{foo.c} source file uses the cos(3) math library
+function, which is usually found in the standalone math library, and not
+the C library. So, whenever we link an executable or a library against
+@file{foo.o} or @file{foo.lo}, we need to add @kbd{-lm} to the end of
+the link line.
+
+The same rule applies whenever you use functions that don't appear in
+the standard C library@dots{} you need to add the appropriate
+@kbd{-l@var{name}} flag to the end of the link line when you link
+against those objects.
+
After we have built that library, we want to create a program by linking
@file{main.o} against @file{libhello}.
* Static Libraries:: When shared libraries are not wanted.
@end menu
-@node Creating Object Files, Linking Libraries, Using Libtool, Using Libtool
-@comment node-name, next, previous, up
+@node Creating Object Files
@section Creating Object Files
@cindex Compiling object files
burger$
@end example
-@node Linking Libraries, Linking Executables, Creating Object Files, Using Libtool
-@comment node-name, next, previous, up
+@node Linking Libraries
@section Linking Libraries
@pindex ar
for static libraries, but on shared library systems, it is of great
importance.
-So, let's try again, this time with the library object files:
+So, let's try again, this time with the library object
+files:@footnote{Remember that we need to add @kbd{-lm} to the link
+command line because @file{foo.c} uses the cos(3) math library
+function. @xref{Using Libtool}.}
@example
-a23$ @kbd{libtool gcc -g -O -o libhello.la foo.lo hello.lo}
+a23$ @kbd{libtool gcc -g -O -o libhello.la foo.lo hello.lo -lm}
libtool: you must specify an installation directory with `-rpath'
a23$
@end example
@example
a23$ @kbd{libtool gcc -g -O -o libhello.la foo.lo hello.lo \
- -rpath /usr/local/lib}
+ -rpath /usr/local/lib -lm}
mkdir .libs
ar cru .libs/libhello.a foo.o hello.o
ranlib .libs/libhello.a
@example
burger$ @kbd{libtool gcc -g -O -o libhello.la foo.lo hello.lo \
- -rpath /usr/local/lib}
+ -rpath /usr/local/lib -lm}
mkdir .libs
-rm -f .libs/libhello.*
-ld -Bshareable -o .libs/libhello.so.0.0 foo.lo hello.lo
+ld -Bshareable -o .libs/libhello.so.0.0 foo.lo hello.lo -lm
ar cru .libs/libhello.a foo.o hello.o
ranlib .libs/libhello.a
creating libhello.la
clean up the build directory, and to help ensure that other programs
fail horribly if you accidentally forget to use libtool when you should.
-@node Linking Executables, Installing Libraries, Linking Libraries, Using Libtool
-@comment node-name, next, previous, up
+@node Linking Executables
@section Linking Executables
@cindex Linking against installed libraries
Here's the old way of linking against an uninstalled library:
@example
-burger$ @kbd{gcc -g -O -o hell.old main.o libhello.a}
+burger$ @kbd{gcc -g -O -o hell.old main.o libhello.a -lm}
burger$
@end example
any ambiguity when linking against uninstalled shared libraries.}:
@example
-a23$ @kbd{libtool gcc -g -O -o hell main.o libhello.la}
-gcc -g -O -o hell main.o ./.libs/libhello.a
+a23$ @kbd{libtool gcc -g -O -o hell main.o libhello.la -lm}
+gcc -g -O -o hell main.o ./.libs/libhello.a -lm
a23$
@end example
On `burger' the situation is different:
@example
-burger$ @kbd{libtool gcc -g -O -o hell main.o libhello.la}
-gcc -g -O -o .libs/hell main.o -L./.libs -R/usr/local/lib -lhello
+burger$ @kbd{libtool gcc -g -O -o hell main.o libhello.la -lm}
+gcc -g -O -o .libs/hell main.o -L./.libs -R/usr/local/lib -lhello -lm
creating hell
burger$
@end example
kilobytes. So, having a shared @file{libhello} won't be an advantage
until we link it against at least a few more programs.
-@node Installing Libraries, Installing Executables, Linking Executables, Using Libtool
-@comment node-name, next, previous, up
+@node Installing Libraries
@section Installing Libraries
@pindex strip
installed libraries. You may also install any executables that depend
on libraries you created.
-@node Installing Executables, Static Libraries, Installing Libraries, Using Libtool
-@comment node-name, next, previous, up
+@node Installing Executables
@section Installing Executables
If you used libtool to link any executables against uninstalled libtool
burger#
@end example
-@node Static Libraries, , Installing Executables, Using Libtool
-@comment node-name, next, previous, up
+@node Static Libraries
@section Linking Static Libraries
@cindex Static linking
`.a' suffix (instead of `.la'):
@example
-burger$ @kbd{libtool gcc -o libhello.a main.o foo.lo hello.lo}
+burger$ @kbd{libtool gcc -o libhello.a main.o foo.lo hello.lo -lm}
rm -f libhello.a
ar cru libhello.a main.o foo.o hello.o
ranlib libhello.a
creating a standalone binary. Use libtool to do the linking and add the
@samp{-static} flag.
-@node Invoking libtool, Integrating Libtool, Using Libtool, Top
-@comment node-name, next, previous, up
+@node Invoking libtool
@chapter Invoking @file{libtool}
@c FIXME this is where I got sick of writing index entries
* Uninstall Mode:: Removing executables and libraries.
@end menu
-@node Compile Mode, Link Mode, Invoking libtool, Invoking libtool
-@comment node-name, next, previous, up
+@node Compile Mode
@section Compile Mode
For @samp{compile} mode, @var{mode-args} is a compiler command to be
If shared libraries are being built, any necessary PIC generation flags
are substituted into the compilation command.
-@node Link Mode, Install Mode, Compile Mode, Invoking libtool
-@comment node-name, next, previous, up
+@node Link Mode
@section Link Mode
@samp{link} mode links together object files (including library
@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 an
+executable.
@item -o @var{output-file}
Create @var{output-file} from the specified objects and libraries.
Otherwise, an executable program is created.
-@node Install Mode, Finish Mode, Link Mode, Invoking libtool
-@comment node-name, next, previous, up
+@node Install Mode
@section Install Mode
In @samp{install} mode, libtool interprets @var{mode-args} as an
The command is run, and any necessary unprivileged post-installation
commands are also completed.
-@node Finish Mode, Uninstall Mode, Install Mode, Invoking libtool
-@comment node-name, next, previous, up
+@node Finish Mode
@section Finish Mode
@samp{finish} mode helps system administrators install libtool
Running this command may require superuser privileges, so the
@samp{--dry-run} option may be useful.
-@node Uninstall Mode, , Finish Mode, Invoking libtool
-@comment node-name, next, previous, up
+@node Uninstall Mode
@section Uninstall Mode
This mode deletes installed libraries (and other files).
The remaning @var{mode-args} are either flags for the deletion program
(beginning with a `-'), or the names of files to delete.
-@node Integrating Libtool, Versioning, Invoking libtool, Top
-@comment node-name, next, previous, up
+@node Integrating Libtool
@chapter Integrating Libtool with Your Own Packages
This chapter describes how to integrate libtool with your packages so
* Distributing:: What files to distribute with your package.
@end menu
-@node Makefile Rules, Using Automake, Integrating Libtool, Integrating Libtool
-@comment node-name, next, previous, up
+@node Makefile Rules
@section Writing Makefile Rules for Libtool
Libtool is fully integrated with Automake (@pxref{Top, , The Automake
was generated automatically from the @file{Makefile.am} by Automake).
@end enumerate
-@node Using Automake, Configuring, Makefile Rules, Integrating Libtool
-@comment node-name, next, previous, up
+@node Using Automake
@section Using Automake with Libtool
Libtool library support fits conveniently into Automake's understanding
libhello_la_LDFLAGS = -version-info 3:12:1 -rpath $(libdir)
@end example
-@node Configuring, Distributing, Using Automake, Integrating Libtool
-@comment node-name, next, previous, up
+@node Configuring
@section Configuring Libtool
Libtool requires intimate knowledge of your compiler suite and operating
* AM_PROG_LIBTOOL:: Configuring @file{libtool} in @file{configure.in}.
@end menu
-@node Invoking ltconfig, ltconfig Example, Configuring, Configuring
-@comment node-name, next, previous, up
+@node Invoking ltconfig
@subsection Invoking @file{ltconfig}
@file{ltconfig} runs a series of configuration tests, then creates a
Program to use rather than checking for @file{ranlib}.
@end table
-@node ltconfig Example, AM_PROG_LIBTOOL, Invoking ltconfig, Configuring
-@comment node-name, next, previous, up
+@node ltconfig Example
@subsection Using @file{ltconfig}
Here is a simple example of using @file{ltconfig} to configure libtool
burger$
@end example
-@node AM_PROG_LIBTOOL, , ltconfig Example, Configuring
-@comment node-name, next, previous, up
+@node AM_PROG_LIBTOOL
@subsection The @code{AM_PROG_LIBTOOL} macro
If you are using GNU Autoconf (or Automake), you should add a call to
users should set it to the relative path to the top of your build
directory (@file{../..}, for example).}
-@node Distributing, , Configuring, Integrating Libtool
-@comment node-name, next, previous, up
+@node Distributing
@section Including Libtool with Your Package
In order to use libtool, you need to include the following files with
* Invoking libtoolize:: @file{libtoolize} command line options.
@end menu
-@node Invoking libtoolize, , Distributing, Distributing
-@comment node-name, next, previous, up
+@node Invoking libtoolize
@subsection Invoking @file{libtoolize}
The @file{libtoolize} program provides a standard way to add libtool
@file{libtoolize} displays hints for adding libtool support to your
package, as well.
-@node Versioning, Library Tips, Integrating Libtool, Top
-@comment node-name, next, previous, up
+@node Versioning
@chapter Library Interface Versions
The most difficult issue introduced by shared libraries is that of
* Updating Version Info:: Changing version information before releases.
@end menu
-@node Interfaces, Libtool Versioning, Versioning, Versioning
-@comment node-name, next, previous, up
+@node Interfaces
@section What Are Library Interfaces?
Interfaces for libraries may be any of the following (and more):
Note that static functions do not count as interfaces, because they are
not directly available to the user of the library.
-@node Libtool Versioning, Updating Version Info, Interfaces, Versioning
-@comment node-name, next, previous, up
+@node Libtool Versioning
@section Libtool's Versioning System
Libtool has its own formal versioning system. It is not as flexible as
then the dynamic linker chooses the library with the greater
@var{revision} number.
-@node Updating Version Info, , Libtool Versioning, Versioning
-@comment node-name, next, previous, up
+@node Updating Version Info
@section Updating the Library Version Information
If you want to use libtool's versioning system, then you must specify
to the release of the package that you are making. This is an abuse
that only fosters misunderstanding of the purpose of library versions.
-@node Library Tips, Other Languages, Versioning, Top
-@comment node-name, next, previous, up
+@node Library Tips
@chapter Tips for Interface Design
Writing a good library interface takes a lot of practice and thorough
* C Header Files:: How to write portable include files.
@end menu
-@node C Header Files, , Library Tips, Library Tips
-@comment node-name, next, previous, up
+@node C Header Files
@section Writing C Header Files
Writing portable C header files can be difficult, since they may be read
The @code{long double} type is not supported by many compilers.
@end itemize
-@node Other Languages, Maintaining, Library Tips, Top
-@comment node-name, next, previous, up
+@node Other Languages
@chapter Using Libtool with Other Languages
Libtool was first implemented in order to add support for writing shared
* C++ Libraries:: Using libtool with C++.
@end menu
-@node C++ Libraries, , Other Languages, Other Languages
-@comment node-name, next, previous, up
+@node C++ Libraries
@section Writing Libraries for C++
Creating libraries of C++ code is a fairly straightforward process, and
There are ways of working around this problem, but they are beyond the
scope of this manual.
-@node Troubleshooting, Index, Maintaining, Top
-@comment node-name, next, previous, up
+@node Troubleshooting
@chapter Troubleshooting
Libtool is under constant development, changing to keep up-to-date with
* Reporting Bugs:: How to report problems with libtool.
@end menu
-@node Libtool Test Suite, Reporting Bugs, Troubleshooting, Troubleshooting
-@comment node-name, next, previous, up
+@node Libtool Test Suite
@section The Libtool Test Suite
Libtool comes with its own set of programs that test its capabilities,
* When Tests Fail:: What to do when a test fails.
@end menu
-@node Test Descriptions, When Tests Fail, Libtool Test Suite, Libtool Test Suite
-@comment node-name, next, previous, up
+@node Test Descriptions
@subsection Description of Test Suite
Here is a list of the current programs in the test suite, and what they
done in a portable way by using @code{test -f}.
@end table
-@node When Tests Fail, , Test Descriptions, Libtool Test Suite
-@comment node-name, next, previous, up
+@node When Tests Fail
@subsection When Tests Fail
Each of the above tests are designed to produce no output when they are
For example, @kbd{env VERBOSE=yes make check} runs all the tests, and
has each of them display debugging information.
-@node Reporting Bugs, , Libtool Test Suite, Troubleshooting
-@comment node-name, next, previous, up
+@node Reporting Bugs
@section Reporting Bugs
If you think you have discovered a bug in libtool, you should think
you think the behaviour is a bug. Be sure to include the word
``libtool'' in the subject line.
-@node Maintaining, Troubleshooting, Other Languages, Top
-@comment node-name, next, previous, up
+@node Maintaining
@chapter Maintainance Notes for Libtool
This chapter contains information that the libtool maintainer finds
* libtool Script Contents:: Configuration information that libtool uses.
@end menu
-@node New Ports, Tested Platforms, Maintaining, Maintaining
-@comment node-name, next, previous, up
+@node New Ports
@section Porting libtool to New Systems
To port libtool to a new system, you'll generally need the following
shared libraries.
@end table
-@node Tested Platforms, Platform Quirks, New Ports, Maintaining
-@comment node-name, next, previous, up
+@node Tested Platforms
@section Tested Platforms
-This table (the @file{PLATFORMS} file in the libtool distribution)
-describes when libtool was last known to be tested on platforms where it
-claims to support shared libraries:
+This table describes when libtool was last known to be tested on
+platforms where it claims to support shared libraries:
@example
-@include ../PLATFORMS
+@include platforms.texi
@end example
Libtool versions ending in a single letter (such as @samp{0.7a})
designate beta releases. So, @samp{0.7a} comes after public release
@samp{0.7}, but before @samp{0.8}.
-@node Platform Quirks, libtool Script Contents, Tested Platforms, Maintaining
-@comment node-name, next, previous, up
+@node Platform Quirks
@section Platform Quirks
This section is dedicated to the sanity of the libtool maintainer. It
* Strip:: Removing unnecessary linkage information.
@end menu
-@node Compilers, Reloadable Objects, Platform Quirks, Platform Quirks
-@comment node-name, next, previous, up
+@node Compilers
@subsection Compilers
The only compiler characteristics that affect libtool are the flags
Use @samp{-PIC} to generate PIC.
@end table
-@node Reloadable Objects, Archivers, Compilers, Platform Quirks
-@comment node-name, next, previous, up
+@node Reloadable Objects
@subsection Reloadable Objects
On all known systems, a reloadable object can be created by running
reloadable object may be treated as exactly equivalent to other
objects.
-@node Archivers, Strip, Reloadable Objects, Platform Quirks
-@comment node-name, next, previous, up
+@node Archivers
@subsection Archivers
On all known systems, building a static library can be accomplished by
must be used to ``bless'' the created library before linking against it,
with the @kbd{ranlib lib@var{name}.a} command.
-@node Strip, , Archivers, Platform Quirks
-@comment node-name, next, previous, up
+@node Strip
@subsection The @file{strip} Program
Stripping a library is essentially the same problem as stripping an
to strip libraries.
@end table
-@node libtool Script Contents, , Platform Quirks, Maintaining
-@comment node-name, next, previous, up
+@node libtool Script Contents
@section @file{libtool} Script Contents
The @file{libtool} script is generated by @file{ltconfig}
commands return a nonzero exit status, libtool generally exits with an
error message.
-@node Index, , Troubleshooting, Top
-@comment node-name, next, previous, up
+@node Index
@unnumbered Index
@printindex cp
--------------------------------------------------------
alpha-dec-osf3.2 cc 0.8 ok
alpha-dec-osf3.2 gcc 0.8 ok
-hppa1.1-hp-hpux9.05 cc 0.8 ok*
-hppa1.1-hp-hpux9.05 gcc 0.8 ok*
+alpha-dec-osf4.0 cc 0.9 ok
+alpha-dec-osf4.0 gcc 0.9 ok
+hppa1.1-hp-hpux9.05 cc 0.8 ok
+hppa1.1-hp-hpux9.05 gcc 0.8 ok
hppa1.1-hp-hpux10.10 cc 0.8 ok
i386-unknown-freebsd2.1.5 gcc 0.5 ok
i386-unknown-gnu0.0 gcc 0.5 ok
-i386-unknown-linux2.0.16 gcc 0.9 ok
-i386-unknown-netbsd1.2 gcc 0.9 ok
+i386-unknown-netbsd1.2 gcc 0.9a ok
+i586-unknown-linux1.3.20 gcc 0.9 ok
+i586-unknown-linux2.0.16 gcc 0.9a ok
mips-sgi-irix5.3 cc 0.8 ok
mips-sgi-irix5.3 gcc 0.8 ok
-mips-sgi-irix6.2 cc -32 0.8 ok
-mips-sgi-irix6.2 cc -n32 0.8 fail
-rs6000-ibm-aix3.2.5 xlc 0.8 ok
-rs6000-ibm-aix3.2.5 gcc 0.8 ok
+mips-sgi-irix6.2 cc -32 0.9 ok
+mips-sgi-irix6.2 cc -n32 0.9 ok
+powerpc-ibm-aix4.1.4.0 xlc 0.9a ok
+powerpc-ibm-aix4.1.4.0 gcc 0.9a ok
+rs6000-ibm-aix3.2.5 xlc 0.9 fail
+rs6000-ibm-aix3.2.5 gcc 0.9 fail
rs6000-ibm-aix4.1.4.0 xlc 0.9 ok
-rs6000-ibm-aix4.1.4.0 gcc 0.7c ok
-sparc-sun-linux2.1.14 gcc 0.7c ok
-sparc-sun-sunos4.1.3_U1 cc 0.7a ok
-sparc-sun-sunos4.1.3_U1 gcc 0.7a ok
-sparc-sun-solaris2.4 cc 0.7a ok
-sparc-sun-solaris2.4 gcc 0.7a ok
-sparc-sun-solaris2.5.1 gcc 0.9 ok
+rs6000-ibm-aix4.1.4.0 gcc 0.9 fail
+sparc-sun-linux2.1.23 gcc 0.9 ok
+sparc-sun-sunos4.1.3_U1 cc 0.9 ok
+sparc-sun-sunos4.1.3_U1 gcc 0.9 ok
+sparc-sun-solaris2.4 cc 0.9 ok
+sparc-sun-solaris2.4 gcc 0.9 ok
+sparc-sun-solaris2.5 cc 0.9 ok
+sparc-sun-solaris2.5 gcc 0.9a ok
--------------------------------------------------------
-
-* `sh internal 2K buffer overflow', under investigation. In the
-meantime, set the CONFIG_SHELL environment variable to /usr/bin/ksh.
+## libtool.m4 - Configure libtool for the target system.
+## Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
-## Configure libtool for the target system.
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
##
-# serial 1 AM_PROG_LIBTOOL
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 2 AM_PROG_LIBTOOL
AC_DEFUN(AM_PROG_LIBTOOL,
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+case "$host" in
+*-*-sco3.2v5*) CFLAGS="$CFLAGS -belf" ;;
+esac
+
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \
$ac_aux_dir/ltconfig $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
#! /bin/sh
# libtoolize - Prepare a package to use libtool.
# @configure_input@
-# Copyright (C) 1996 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
verify_host=yes
with_gcc=no
+old_AR="$AR"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
old_CPPFLAGS="$CPPFLAGS"
old_LD="$LD"
old_RANLIB="$RANLIB"
+test -z "$AR" && AR=ar
+
# Parse the command line options.
args=
prev=
host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
# Determine commands to create old-style static archives.
-old_archive_cmds='ar cru $oldlib$oldobjs'
+old_archive_cmds='$AR cru $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
# If RANLIB is not set, then run the test.
echo $ac_n "checking if $linker supports shared libraries... $ac_c" 1>&6
archive_cmds=
+export_dynamic_flag=
hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
if test "$ld_shlibs" = yes; then
archive_cmds='$cc -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath $wl$libdir'
+ export_dynamic_flag='${wl}-export-dynamic'
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case "$host" in
*-*-aix3*)
- archive_cmds='/usr/ucb/nm$libobjs | egrep \" D \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;ar cru $lib $objdir/$soname'
+ archive_cmds='/usr/ucb/nm$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
;;
*-*-aix4*)
- archive_cmds='/bin/nm -B$libobjs | egrep \" D \" | sed \"s/^.* //\" > $lib.exp;$cc -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;ar cru $lib $objdir/$soname'
+ archive_cmds='/bin/nm -B$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$cc -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;$AR cru $lib $objdir/$soname'
hardcode_minus_L=yes
;;
*-*-osf3* | *-*-osf4*)
archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
;;
*-*-sco3.2v5*)
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-gnu*)
- version_type=sunos
- library_names_spec='$libname.so.$versuffix'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
+# *-*-gnu* needs to come after *-*-linux-gnu*.
*-*-hpux9* | *-*-hpux10*)
# Give a soname corresponding to the major version so that dld.sl refuses to
shlibpath_var=LD_LIBRARY_PATH
;;
+*-*-gnu*)
+ version_type=sunos
+ library_names_spec='$libname.so.$versuffix'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
*-*-netbsd*)
version_type=sunos
library_names_spec='$libname.so.$versuffix'
host_alias="$host_alias"
host="$host"
+# The archiver.
+AR='$AR'
+
# The linker used to build libraries.
LD='$LD'
# Compiler flag to prevent dynamic linking.
link_static_flag='$link_static_flag'
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag='$export_dynamic_flag'
+
# Pattern to match compiler flags for creating libNAME_p libraries:
profile_flag_pattern='$profile_flag_pattern'
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec='$hardcode_libdir_flag_spec'
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator='$hardcode_libdir_separator'
+
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct=$hardcode_direct
*rm)
mode=uninstall
;;
+ *.la)
+ mode=dlname
+ ;;
*)
# Just use the default operation mode.
if test "$mode" = NONE; then
if test -n "$nonopt"; then
- echo "$progname: warning: cannot infer operation mode from \`$nonopt $@'" 1>&2
+ echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
else
- echo "$progname: warning: cannot infer operation mode from no MODE-ARGS" 1>&2
+ echo "$progname: warning: cannot infer operation mode without MODE-ARGS" 1>&2
fi
fi
;;
case "$mode" in
# libtool compile mode
compile)
+ progname="$progname: compile"
# Get the compilation command and the source file.
base_compile="$nonopt"
lastarg=
# libtool link mode
link)
+ progname="$progname: link"
# Go through the arguments, transforming them on the way.
cc="$nonopt"
args="$cc"
compile_shlibpath=
finalize_shlibpath=
deplibs=
+ export_dynamic=no
+ hardcode_libdirs=
install_libdir=
libobjs=
link_against_libtool_libs=
prevarg=
temp_rpath=
vinfo=
-
-
-# FIXME Maybe set the library names to libNAME_p.a if we are doing profiling.
-# if echo " $@ " | egrep "[ ]$profile_flag_pattern[ ]" > /dev/null 2>&1; then
-# suffix=p
-# else
-# suffix=
-# fi
+ whole_archive=no
# We need to know -static, to get the right output filenames.
case " $@ " in
if test -n "$prev"; then
case "$prev" in
output)
- if test "$build_libtool_libs" = yes; then
- compile_command="$compile_command $objdir/$arg"
- finalize_command="$finalize_command $objdir/$arg"T
- else
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
args="$args $arg"
;;
esac
prevarg="$arg"
case "$arg" in
+ -export-dynamic)
+ export_dynamic=yes
+ compile_command="$compile_command $export_dynamic_flag"
+ finalize_command="$finalize_command $export_dynamic_flag"
+ continue
+ ;;
+
-L*)
dir=`echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
case "$dir" in
-l*) deplibs="$deplibs $arg" ;;
+ -no-whole-archive) whole_archive=no ;;
+
-o) prev=output ;;
-rpath)
continue
;;
+ -whole-archive) whole_archive=yes ;;
+
-*) cc="$cc $arg" ;; # Some other compiler flag.
- *.o | *.a)
+ *.o)
# A standard object.
objs="$objs $arg"
;;
+ *.a)
+ # Find the relevant object directory and library name.
+ file=`echo "$arg" | sed 's%^.*/%%'`
+ dir=`echo "$arg" | sed 's%/[^/]*$%/%'`
+ test "$dir" = "$arg" && dir=
+
+ # If -whole-archive was specified, we need to link all the members.
+ if test "$whole_archive" = yes; then
+ if test -f $arg; then :
+ else
+ echo "$progname: \`$arg' does not exist" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Get the names of the members of the archive.
+ members=`$AR t $arg 2>/dev/null`
+ for m in $members; do
+ case "$m" in
+ *.lo) libobjs="$libobjs $dir$m" ;;
+ *.o)
+ if test "$build_libtool_libs" = yes; then
+ objs="$objs $dir$m"
+ else
+ libobjs="$libobjs $dir$m"
+ fi
+ ;;
+ esac
+ done
+ elif test -f "$dir$objdir/$file"; then
+ # .libs/libfoo.a exists, so this is an archive of libobjects.
+ libobjs="$libobjs $arg"
+ else
+ # Standard archive.
+ objs="$objs $arg"
+ fi
+ ;;
+
*.lo)
# A library object.
libobjs="$libobjs $arg"
fi
if test -n "$hardcode_libdir_flag_spec"; then
- hardcode_libdir_flag=`eval echo \"$hardcode_libdir_flag_spec\"`
- compile_command="$compile_command $hardcode_libdir_flag"
- finalize_command="$finalize_command $hardcode_libdir_flag"
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ # Put the magic libdir with the hardcode flag.
+ hardcode_libdirs="$libdir"
+ libdir="@HARDCODE_LIBDIRS@"
+ else
+ # Just accumulate the libdirs.
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ libdir=
+ fi
+ fi
+
+ if test -n "$libdir"; then
+ hardcode_libdir_flag=`eval echo \"$hardcode_libdir_flag_spec\"`
+ compile_command="$compile_command $hardcode_libdir_flag"
+ finalize_command="$finalize_command $hardcode_libdir_flag"
+ fi
fi
case "$hardcode_action" in
fi
else
# Transform directly to old archives if we don't build new libraries.
- compile_command="$compile_command $dir/$old_library"
- finalize_command="$finalize_command $dir/$old_library"
+ test -z "$old_library" || linklib="$old_library"
+ compile_command="$compile_command $dir/$linklib"
+ finalize_command="$finalize_command $dir/$linklib"
fi
continue
;;
exit 1
fi
+ # Substitute the hardcoded libdirs into the compile commands.
+ if test "$hardcode_libdir_colon_separated" = yes; 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"`
+ fi
+
oldlib=
oldobjs=
case "$output" in
*.a)
# Old archive.
+ libname=`echo "$output" | sed 's/\.a$//'`
build_old_libs=yes
if test -n "$install_libdir"; then
*.la)
libname=`echo "$output" | sed 's/\.la$//'`
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+ current=0
+ revision=0
+ age=0
+
if test -n "$objs"; then
- echo "$progname: cannot build libtool library \`$output' from non-libtool objects"
+ echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
exit 1
fi
# How the heck are we supposed to write a wrapper for a shared library?
if test -n "$link_against_libtool_libs"; then
- echo "$progname: libtool libraries may not depend on uninstalled libraries" 1>&2
+ echo "$progname: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
exit 1
fi
exit 1
fi
- current=0
- revision=0
- age=0
-
# Parse the version information argument.
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
set dummy $vinfo
$show "$ln_s $realname $link"
$run $ln_s $realname $link || exit $?
done
+
+ # If -export-dynamic was specified, set the dlname.
+ if test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
fi
;;
# Delete the old objects.
$run $rm $obj $libobj
- # Create the old-style object.
- reload_objs="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/ $//g'`
+ # Create the old-style object (skipping any convenience libraries).
+ # FIXME: skipping them is simplistic. We should determine which members
+ # are actually needed to resolve symbols.
+ reload_objs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`
output="$obj"
cmds=`eval echo \"$reload_cmds\"`
compile_command=`echo "$compile_command " | sed 's/\.lo /.o /g; s/ $//'`
fi
- # Create the binary in the object directory, then wrap it.
- if test -d $objdir; then :
- else
- $show "$mkdir $objdir"
- $run $mkdir $objdir || exit $?
- 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"`
+
# We have no uninstalled library dependencies, so finalize right now.
$show "$compile_command"
$run $compile_command
exit $status
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`
+
+ # Create the binary in the object directory, then wrap it.
+ if test -d $objdir; then :
+ else
+ $show "$mkdir $objdir"
+ $run $mkdir $objdir || exit $?
+ fi
+
if test -n "$shlibpath_var"; then
# We should set the shlibpath_var
rpath=
# See if we need to build an old-fashioned archive.
if test "$build_old_libs" = "yes"; then
- # Transform .lo files to .o
- oldobjs="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/ $//g'`
- case "$output" in
- *.la)
- # Now set the variables for building old libraries.
- oldlib="$objdir/$libname.a"
- ;;
- *)
- oldlib="$output"
+ # Now set the variables for building old libraries.
+ oldlib="$objdir/$libname.a"
+
+ # Transform .lo files to .o (skipping convenience libraries).
+ # FIXME: skipping them is simplistic. We should determine which members
+ # are actually needed to resolve symbols.
+ oldobjs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`
+
+ if test -d "$objdir"; then
$show "$rm $oldlib"
$run $rm $oldlib
- ;;
- esac
+ else
+ $show "$mkdir $objdir"
+ $run $mkdir $objdir
+ fi
# Do each command in the archive commands.
cmds=`eval echo \"$old_archive_cmds\"`
eval "$run $cmd" || exit $?
done
IFS="$save_ifs"
+
+ case "$output" in
+ *.a)
+ # Just move into place if there were any non-libtool objects.
+ if test -n "$objs"; then
+ $show "$mv $oldlib $output"
+ $run $mv $oldlib $output
+
+ elif test -z "$pic_flag" || test "$build_libtool_libs" != yes; then
+ # Just symlink if libtool objects are the same.
+ $show "$rm $output"
+ $run $rm $output
+ $show "$ln_s $oldlib $output"
+ $run $ln_s $oldlib $output
+
+ else
+ # Create an archive of libtool objects.
+ oldlib="$output"
+ oldobjs="$libobjs"
+
+ # Do each command in the archive commands.
+ cmds=`eval echo \"$old_archive_cmds\"`
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ eval "$run $cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ ;;
+ esac
fi
# Now create the libtool archive.
# The name of the static archive.
old_library='$old_library'
+# The name that we can dlopen(3).
+dlname='$dlname'
+
# Version information for $libname.
current=$current
age=$age
# libtool install mode
install)
+ progname="$progname: install"
# The first argument is the name of the installation program.
install_prog="$nonopt"
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$realname $destdir/$realname"
eval "$run $install_prog $dir/$realname $destdir/$realname" || exit $?
+ test "X$dlname" = "X$realname" && dlname=
# Support stripping libraries.
if test -n "$stripme"; then
# ... and create new ones.
for linkname
do
+ test "X$dlname" = "X$linkname" && dlname=
$show "$ln_s $realname $destdir/$linkname"
$run $ln_s $realname $destdir/$linkname
done
fi
+ if test -n "$dlname"; then
+ # Install the dynamically-loadable library.
+ $show "$install_prog $dir/$dlname $destdir/$dlname"
+ eval "$run $install_prog $dir/$dlname $destdir/$dlname" || exit $?
+ fi
+
# Do each command in the postinstall commands.
lib="$destdir/$realname"
cmds=`eval echo \"$postinstall_cmds\"`
esac
done
-# FIXME Install any profiled libraries, too.
-# newfiles=
-# for file in $staticlibs; do
-# newfiles="$newfiles $file"
-# pfile=`echo "$file" | sed 's/\.a$/_p.a/'`
-# test -f "$pfile" && newfiles="$newfiles $pfile"
-# done
-# staticlibs="$newfiles"
-
for file in $staticlibs; do
name=`echo "$file" | sed 's%^.*/%%'`
exit 0
;;
+ # libtool dlname mode
+ dlname)
+ progname="$progname: dlname"
+ ltlibs="$nonopt"
+ for lib
+ do
+ ltlibs="$ltlibs $lib"
+ done
+
+ # Now check to make sure each one is a valid libtool library.
+ status=0
+ for lib in $ltlibs; do
+ dlname=
+ libdir=
+
+ # Check to see that this really is a libtool archive.
+ if egrep "^# Generated by $PROGRAM" $arg >/dev/null 2>&1; then :
+ else
+ echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
+ status=1
+ continue
+ fi
+
+ # If there is no directory component, then add one.
+ case "$arg" in
+ */*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$libdir"; then
+ echo "$progname: \`$arg' contains no -rpath information" 1>&2
+ status=1
+ elif test -n "$dlname"; then
+ echo "$libdir/$dlname"
+ else
+ echo "$progname: \`$arg' was not linked with \`-export-dynamic'" 1>&2
+ status=1
+ fi
+ done
+ exit $status
+ ;;
+
# libtool finish mode
finish)
+ progname="$progname: finish"
libdirs="$nonopt"
if test -n "$finish_cmds" && test -n "$libdirs"; then
# libtool uninstall mode
uninstall)
+ progname="$progname: uninstall"
rm="$nonopt"
files=
test "$dir" = "$file" && dir=.
name=`echo "$file" | sed -e 's%^.*/%%'`
+ rmfiles="$file"
+
case "$name" in
*.la)
# Possibly a libtool archive, so verify it.
# Delete the libtool libraries and symlinks.
for n in $library_names; do
- $show "$rm $dir/$n"
- $run $rm $dir/$n
+ rmfiles="$rmfiles $dir/$n"
+ test "X$n" = "X$dlname" && dlname=
done
+ test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
+ test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
- # Delete the old-fashioned archive.
- if test -n "$old_library"; then
- $show "$rm $dir/$old_library"
- $run $rm $dir/$old_library
- fi
+ # FIXME: should reinstall the best remaining shared library.
fi
;;
esac
- $show "$rm $file"
- $run $rm $file
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
done
exit 0
;;
MODE must be one of the following:
compile compile a source file into a libtool object
+ dlname print filenames to use to \`dlopen' libtool libraries
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
EOF
;;
+dlname)
+ cat <<EOF
+Usage: $progname [OPTION]... --mode=dlname LTLIBRARY [LTLIBRARY]...
+
+Print filenames to use to \`dlopen' libtool libraries.
+
+Each LTLIBRARY is the name of a dynamically loadable libtool library (one that
+was linked using the \`-export-dynamic' option).
+
+The names to use are printed to standard output, one per line.
+EOF
+ ;;
+
finish)
cat <<EOF
Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
The following components of LINK-COMMAND are treated specially:
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -static do not do any dynamic linking or shared library creation
+ -export-dynamic allow the output file to be loaded with dlopen(3)
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -no-whole-archive turn off \`-whole-archive'
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -static do not do any dynamic linking or shared library creation
-version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
+ specify library version info [each variable defaults to 0]
+ -whole-archive use all members from subsequent \`.a' files
All other options (arguments beginning with \`-') are ignored.
library objects (\`.lo' files) may be specified, and \`-rpath' is required.
If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
-and \`ranlib'.
+and \`ranlib'. If only libtool objects are specified, then the output file
+may be used in the creation of other libtool archives.
If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
created, otherwise an executable program is created.
+Mon Feb 3 15:17:18 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * Makefile.am (TESTS): Do the full make sequence with
+ --disable-shared, then without.
+
+ * demo-sttc.test: Configure the demo directory with
+ --disable-shared.
+
+Wed Jan 29 14:02:03 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * hardcode.test: Rewrite to use fgrep on output from ``strings
+ -a'' if using fgrep directly on the binary files fails. From Mark
+ Kettenis.
+
+Tue Jan 28 14:00:23 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * hardcode.test: Make sure that ../demo/libhello.la really is a
+ shared library before running hardcoding tests.
+
Sat Jan 18 10:33:21 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
* demo-conf.test: Use the CONFIG_SHELL environment variable when
AUTOMAKE_OPTIONS = gnits
-TESTS = demo-conf.test demo-make.test demo-exec.test demo-inst.test \
- demo-unst.test hardcode.test link.test link-2.test suffix.test \
- test-e.test
+makesequence = demo-make.test demo-exec.test \
+ demo-inst.test demo-unst.test hardcode.test
+TESTS = demo-conf.test $(makesequence) \
+ link.test link-2.test suffix.test test-e.test
EXTRA_DIST = defs tlibtool $(TESTS)
*) srcdir=`cd $srcdir && pwd` ;;
esac
+# tlibtool needs to know what srcdir is.
+export srcdir
+libtool="$srcdir/tlibtool"
+
prefix="./=inst"
-if test -d $prefix; then
- rm -rf $prefix
-fi
if test "$need_prefix" = yes; then
# An absolute path to a test installation directory.
- mkdir $prefix
+ test -d $prefix || mkdir $prefix
prefix=`cd $prefix && pwd`
else
+ test -d $prefix && rm -rf $prefix
prefix=NONE
fi
# Possibly clean up the distribution.
if test -f config.cache; then
- echo "= Running make distclean in ../demo"
- make distclean || rm -f config.cache
+ echo "= Running $make distclean in ../demo"
+ $make distclean || rm -f config.cache
fi
# Configure the demonstration.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
- srcdir=.
+ srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+ test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Change to our build directory.
cd ../demo || exit 1
-echo "= Running make install in ../demo"
-make install || exit 1
+echo "= Running $make install in ../demo"
+$make install || exit 1
echo "= Executing installed programs"
if $prefix/bin/hell.static | grep 'GNU Hell'; then :
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
- srcdir=.
+ srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+ test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Test script header.
need_prefix=yes
if test -z "$srcdir"; then
- srcdir=.
+ srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+ test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
make uninstall || exit 1
# See that there were no files leftover in $prefix.
-leftovers=`find $prefix ! -type d -print`
+# Ignore dotfiles, so that .nfsXXX files don't screw up the test.
+leftovers=`find $prefix ! -type d -print | egrep -v '^\.'`
if test -n "$leftovers"; then
echo "= Leftover after make uninstall:"
ls -l $leftovers
echo "= Running make in ../demo"
make || exit 1
-echo "= Running make check in ../demo"
-make check || exit 1
+# Try running the program.
+echo "= Executing uninstalled programs"
+if ./hell.static | grep 'GNU Hell'; then :
+else
+ echo "$0: cannot execute ./hell.static" 1>&2
+ exit 1
+fi
+
+if ./hell | grep 'GNU Hell'; then :
+else
+ echo "$0: cannot execute ./hell" 1>&2
+ exit 1
+fi
echo "= Running make install in ../demo"
make install || exit 1
-# FIXME - only fail with installcheck if we are superuser.
-echo "= Running make installcheck in ../demo"
-make installcheck || exit 1
+echo "= Executing installed programs"
+if $prefix/bin/hell.static | grep 'GNU Hell'; then :
+else
+ echo "$0: cannot execute $prefix/bin/hell.static" 1>&2
+ exit 1
+fi
+
+if $prefix/bin/hell | grep 'GNU Hell'; then :
+else
+ echo "$0: warning: cannot execute $prefix/bin/hell" 1>&2
+fi
echo "= Running make uninstall in ../demo"
make uninstall || exit 1
-# Clean up the distribution.
-make distclean
+# See that there were no files leftover in $prefix.
+leftovers=`find $prefix ! -type d -print`
+if test -n "$leftovers"; then
+ echo "= Leftover after make uninstall:"
+ ls -l $leftovers
+ exit 1
+fi
# Delete the directory tree we created.
rm -rf $prefix
+
+# Clean up the distribution.
+make distclean
+
exit 0
# Change to our build directory.
cd ../demo || exit 1
+# Check to make sure we have a dynamic library.
+library_names=NONE
+eval `egrep -e '^library_names=' ./libhello.la 2>/dev/null`
+
+if test "$library_names" = NONE; then
+ echo "library_names not set in ../demo/libhello.la" 1>&2
+ exit 1
+elif test -z "$library_names"; then
+ echo "= Exiting: ../demo/libhello.la is not a shared library"
+ exit 0
+fi
+
echo "= Running $make hardcode in ../demo"
$make hardcode || exit 1
hc-libpath) expected="$hardcode_shlibpath_var" ;;
hc-minusL) expected="$hardcode_minus_L" ;;
*)
- echo "unknown file \`$file'" 1>&2
continue
;;
esac
+ # Discover whether the .libs directory really was hardcoded.
+ hardcoded=no
if fgrep '.libs' $file > /dev/null; then
+ hardcoded=yes
+ elif strings -a $file 2>/dev/null | fgrep '.libs' > /dev/null; then
+ # At least AIX fgrep doesn't work for binary files, so we need strings.
+ hardcoded=yes
+ elif egrep 'unsupported' $file > /dev/null; then
+ hardcoded=unsupported
+ fi
+
+ # Check the result.
+ case "$hardcoded" in
+ yes)
if test $expected = yes; then
echo ".libs was hardcoded in \`$file', as libtool expected"
else
echo ".libs was hardcoded in \`$file', which fooled libtool" 1>&2
status=1
fi
- elif egrep 'unsupported' $file > /dev/null; then
- if test $expected = unsupported; then
- echo "\`$file' was not linked properly, as libtool expected"
- else
- echo "\`$file' was not linked properly, which fooled libtool" 1>&2
- status=1
- fi
- else
+ ;;
+
+ no)
if test $expected = no; then
echo ".libs was not hardcoded in \`$file', as libtool expected"
else
echo ".libs was not hardcoded in \`$file', which fooled libtool" 1>&2
status=1
fi
- fi
+ ;;
+
+ unsupported)
+ if test $expected = unsupported; then
+ echo "\`$file' was not linked properly, as libtool expected"
+ else
+ echo "\`$file' was not linked properly, which fooled libtool" 1>&2
+ status=1
+ fi
+ ;;
+ esac
done
exit $status
#! /bin/sh
-# link.test - check that .lo files and .l_o files aren't made into programs.
+# link.test - check that .lo files aren't made into programs.
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
- srcdir=.
+ srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+ test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1
# Try a sample link command.
-linkresult=`$libtool -n --mode=link gcc -o something foo.o hello.l_o hell.lo`
+linkresult=`$libtool -n --mode=link gcc -o something foo.o hell.lo`
test $? = 0 || exit 1
echo "$0: .lo files should not be linked into programs"
exit 1
;;
-
-*".l_o "*)
- echo "$0: .l_o files should not be linked into programs"
- exit 1
- ;;
esac
exit 0
# Test script header.
need_prefix=no
if test -z "$srcdir"; then
- srcdir=.
+ srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+ test "$srcdir" = "$0" && srcdir=.
test "${VERBOSE+set}" != "set" && VERBOSE=yes
fi
. $srcdir/defs || exit 1