From: Gordon Matzigkeit Date: Wed, 11 Jun 1997 17:13:23 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release-1-0a~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d62e8b86a22cdbd456c7b4682b9755c2962fe06e;p=thirdparty%2Flibtool.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index baee154af..10b3511ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Wed Jun 11 11:04:59 1997 Gordon Matzigkeit + + * Makefile.am (ltconfig, ltmain.sh): Only move if $(srcdir) is not + the current directory. Reported by Tom Tromey. + +Tue Jun 10 12:26:00 1997 Gordon Matzigkeit + + * Makefile.am (ltconfig, ltmain.sh): Be sure to move these files + into $(srcdir) once they are created. + + * ltmain.sh.in (link): Disable building static libraries. + People should use their favourite AR and RANLIB commands. + Disable building old-style objects if `--disable-static' is + given. Suggested by Tom Lees and Stephen Kulow. + Sun Jun 8 12:10:14 1997 Gordon Matzigkeit * ltconfig.in (host_cpu, host_vendor, host_os): Patch up diff --git a/Makefile.am b/Makefile.am index b3ee93fbd..ca2a6584a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,9 +44,11 @@ libtoolize: libtoolize.in $(top_builddir)/config.status $(srcdir)/ltconfig: ltconfig.in $(top_builddir)/config.status CONFIG_FILES=ltconfig CONFIG_HEADERS= $(top_builddir)/config.status chmod +x ltconfig + mv ltconfig $(srcdir)/ltconfig $(srcdir)/ltmain.sh: ltmain.sh.in $(top_builddir)/config.status CONFIG_FILES=ltmain.sh CONFIG_HEADERS= $(top_builddir)/config.status + mv ltmain.sh $(srcdir)/ltmain.sh # Distribute the demo subdirectory. dist-hook: $(demo_distfiles) diff --git a/NEWS b/NEWS index 93bc434f6..36662eec9 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ New in 0.9g: libraries on platforms that have shared libs. * New `-allow-undefined' link flag to build shared libs that contain references to unresolved symbols. +* Removed all support for creating static-only libraries. * Basic support for dynamically loaded modules: new `-export-dynamic' linking flag and corresponding `dlname' mode. * New `--features' flag to display configured libtool attributes. diff --git a/TODO b/TODO index cfee6c636..9ca6954f0 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,3 @@ -* For 1.0: disable building old-style objects if --disable-static is -given. Update all documentation accordingly. Suggested by Tom Lees -and Stephen Kulow. - * A better check to detect broken collect2 on AIX, once the bug is fixed in GCC. diff --git a/doc/libtool.texi b/doc/libtool.texi index e41071a5b..1e31f60d4 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -321,8 +321,8 @@ compatibility. @item The install @file{Makefile} target should warn the package installer to set -@var{LD_LIBRARY_PATH} (or equivalent) or run @code{ldconfig(8)}, if -required. +the proper environment variables (@var{LD_LIBRARY_PATH} or equivalent), +or run @code{ldconfig(8)}. @end enumerate @node Other implementations @@ -341,11 +341,11 @@ have been more or less abandoned as influences. @section A postmortem analysis of other implementations @cindex Other implementations, flaws in -@cindex Reuseability of library systems +@cindex Reusability of library systems In all fairness, each of the implementations that I examined do the job that they were intended to do, for a number of different host systems. However, none of these solutions seem to function well as a generalized, -reuseable component. +reusable component. @cindex Complexity of library systems Most were too complex for me to use (much less modify) without @@ -414,7 +414,7 @@ A NetBSD/i386 1.2 platform with shared libraries. @end table You can follow these examples on your own platform, using the -pre-configured libtool script that was installed with libtool +preconfigured libtool script that was installed with libtool (@pxref{Configuring}). Source files for the following examples are taken from the @file{demo} @@ -476,7 +476,7 @@ burger$ Shared libraries, however, may only be built from @dfn{position-independent code} (PIC). So, special flags must be passed to the compiler to tell it to generate PIC rather than the standard -position-dependant code. +position-dependent code. @cindex Library object file @cindex @samp{.lo} files @@ -840,38 +840,17 @@ burger# @cindex Static linking @cindex Convenience libraries -Sometimes it is desirable to create a static archive that can never be -shared. The most frequent case is when you have a ``convenience -library'' that is a collection of related object files without a really -nice interface. - -@c FIXME: we should update this section Why return to @code{ar} and @code{ranlib} silliness when you've had a -taste of libtool? libtool works consistently with standard object -files, static libraries, and programs created without libtool's help. - -So, to create a static library: - -@enumerate 1 -@item -Compile the object files with or without libtool. It doesn't matter -whether these objects are PIC (end with the @samp{.lo} suffix) or not. - -@item -Link the files in the same way you would a libtool library, but use a -@samp{.a} suffix (instead of @samp{.la}): +taste of libtool? Well, sometimes it is desirable to create a static +archive that can never be shared. The most frequent case is when you +have a ``convenience library'' that is a collection of related object +files without a really nice interface. -@example -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 -burger$ -@end example +To do this, you should ignore libtool entirely, and just use the old +@code{ar} and @code{ranlib} commands to create a static library. -@item If you want to install the library (but you probably don't), then you -can use libtool to do it, too: +may use libtool if you want: @example burger$ @kbd{libtool ./install-sh -c libhello.a /local/lib/libhello.a} @@ -879,7 +858,10 @@ burger$ @kbd{libtool ./install-sh -c libhello.a /local/lib/libhello.a} ranlib /local/lib/libhello.a burger$ @end example -@end enumerate + +Using libtool for static library installation protects your library from +being accidentally stripped (if the installer used the @samp{-s} flag), +as well as automatically running the correct @code{ranlib} command. @cindex Standalone binaries Another common situation where static linking is desirable is in @@ -1098,7 +1080,7 @@ This mode deletes installed libraries (and other files). The first @var{mode-arg} is the name of the program to use to delete files (typically @file{/bin/rm}). -The remaning @var{mode-args} are either flags for the deletion program +The remaining @var{mode-args} are either flags for the deletion program (beginning with a `-'), or the names of files to delete. @node Integrating libtool @@ -1120,8 +1102,8 @@ that your users can install hassle-free shared libraries. @cindex Makefile.am @cindex Makefile.in -Libtool is fully integrated with Automake (@pxref{Top,,, automake, The -Automake Manual}), starting with Automake version 1.2. +Libtool is fully integrated with Automake (@pxref{Top,, Introduction, +automake, The Automake Manual}), starting with Automake version 1.2. If you want to use libtool in a regular @file{Makefile} (or @file{Makefile.in}), you are on your own. If you're not using Automake @@ -1892,7 +1874,7 @@ the term is used to refer to two different concepts: @item Compiling and linking a program against a shared library, which is resolved automatically at run time by the dynamic linker. In this -process, dynamic linking is transparant to the application. +process, dynamic linking is transparent to the application. @item The application calling functions such as @@ -1915,8 +1897,8 @@ On most operating systems, dlopened modules must be compiled as PIC. This restriction simplifies the implementation of the @code{dlopen(3)} family of functions by avoiding symbol relocation. ``True'' dlopen implementations, such as the unportable GNU DLD 3 implementation -(@pxref{Top,,, dld, The DLD Manual}), don't have this restriction, as -they can perform relocation at runtime. +(@pxref{Top,, Introduction, dld, The DLD Manual}), don't have this +restriction, as they can perform relocation at runtime. As of version @value{VERSION}, libtool provides only minimal support for dlopened modules, and this support is guaranteed to change and be @@ -2234,7 +2216,7 @@ behaviour you think is a problem is not already mentioned as a feature. Then, you should read the Emacs guide to reporting bugs (@pxref{Bugs, , Reporting Bugs, emacs, The Emacs Manual}). Some of the details -listed there are specific to Emacs, but the priciple behind them is a +listed there are specific to Emacs, but the principle behind them is a general one. Finally, send a bug report to @value{BUGADDR} with any appropriate diff --git a/doc/platforms.texi b/doc/platforms.texi index 1b21ba9da..baf3af914 100644 --- a/doc/platforms.texi +++ b/doc/platforms.texi @@ -12,18 +12,18 @@ 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-netbsd1.2 gcc 0.9f ok -i586-unknown-linux1.3.20 gcc 0.9 ok -i586-unknown-linux2.0.16 gcc 0.9f ok +i386-unknown-netbsd1.2 gcc 0.9g ok +i586-pc-linux-gnu1.3.20 gcc 0.9 ok +i586-pc-linux-gnu2.0.16 gcc 0.9g ok mips-sgi-irix5.3 cc 0.8 ok mips-sgi-irix5.3 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.9d ok -powerpc-ibm-aix4.1.4.0 gcc 0.9a ok +powerpc-ibm-aix4.1.4.0 xlc 0.9g ok +powerpc-ibm-aix4.1.4.0 gcc 0.9g ok rs6000-ibm-aix3.2.5 xlc 0.9e ok rs6000-ibm-aix3.2.5 gcc 0.9e ok* -rs6000-ibm-aix4.1.4.0 xlc 0.9f ok +rs6000-ibm-aix4.1.4.0 xlc 0.9g ok rs6000-ibm-aix4.1.4.0 gcc 0.9e ok sparc-sun-linux2.1.23 gcc 0.9 ok sparc-sun-sunos4.1.3_U1 cc 0.9 ok @@ -31,7 +31,7 @@ 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.9f ok +sparc-sun-solaris2.5 gcc 0.9g ok -------------------------------------------------------- * Libtool will not build shared libraries because of a bug in diff --git a/ltmain.sh.in b/ltmain.sh.in index 4c8b5b127..bf01ee68c 100644 --- a/ltmain.sh.in +++ b/ltmain.sh.in @@ -229,9 +229,14 @@ if test -z "$show_help"; then exit 1 fi - # Delete any old library objects. - $run $rm $obj $libobj - trap "$run $rm $obj $libobj; exit 1" 1 2 15 + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + $run $rm $obj $libobj + trap "$run $rm $obj $libobj; exit 1" 1 2 15 + else + $run $rm $libobj + trap "$run $rm $libobj; exit 1" 1 2 15 + fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then @@ -239,7 +244,7 @@ if test -z "$show_help"; then $show "$base_compile$pic_flag -DPIC $srcfile" if eval "$run $base_compile$pic_flag -DPIC $srcfile"; then : else - $run $rm $obj + test -n "$obj" && $run $rm $obj exit 1 fi @@ -255,16 +260,18 @@ if test -z "$show_help"; then $run $mv $obj $libobj || exit 1 fi - # Compile the position-dependent object. - $show "$base_compile $srcfile" - if eval "$run $base_compile $srcfile"; then : - else - $run $rm $obj $libobj - exit 1 + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + $show "$base_compile $srcfile" + if eval "$run $base_compile $srcfile"; then : + else + $run $rm $obj $libobj + exit 1 + fi fi - # Create an invalid object file if no PIC, so that we don't accidentally - # link it. + # Create an invalid libtool object if no PIC, so that we don't accidentally + # link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" eval "$run echo timestamp > $libobj" || exit $? @@ -534,7 +541,11 @@ if test -z "$show_help"; then fi else # Transform directly to old archives if we don't build new libraries. - test -z "$old_library" || linklib="$old_library" + if test -n "$pic_flag" && test -z "$old_library"; then + echo "$progname: cannot find static library for \`$arg'" 1>&2 + exit 1 + fi + test -n "$old_library" && linklib="$old_library" compile_command="$compile_command $dir/$linklib" finalize_command="$finalize_command $dir/$linklib" fi @@ -578,20 +589,6 @@ if test -z "$show_help"; then exit 1 ;; - *.a) - # Old archive. - libname=`echo "$output" | sed 's/\.a$//'` - build_old_libs=yes - - if test -n "$install_libdir"; then - echo "$progname: warning: \`-rpath' is ignored while linking old-style libraries" 1>&2 - fi - - if test -n "$vinfo"; then - echo "$progname: warning: \`-version-info' is ignored while linking old-style libraries" 1>&2 - fi - ;; - *.la) libname=`echo "$output" | sed 's/\.la$//'` @@ -1032,10 +1029,7 @@ EOF # See if we need to build an old-fashioned archive. if test "$build_old_libs" = "yes"; then # Now set the variables for building old libraries. - case "$output" in - *.a) oldlib="$output" ;; - *) oldlib="$objdir/$libname.a" ;; - esac + oldlib="$objdir/$libname.a" # Transform .lo files to .o files. oldobjs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`