From 6f1d9645f9dbdcb41ff3708c138190800588ce14 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 4 Apr 1997 02:21:13 +0000 Subject: [PATCH] ltlibrary fix --- ChangeLog | 7 +++++++ TODO | 6 +++++- automake.in | 15 ++++++++++++--- automake.texi | 8 ++++++++ lib/am/ltlibrary.am | 2 +- ltlibrary.am | 2 +- stamp-vti | 2 +- version.texi | 2 +- 8 files changed, 36 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfc77e7ca..865342623 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Apr 3 19:07:59 1997 Tom Tromey + + * ltlibrary.am (@LTLIBRARY@): use @RPATH@, not explicit -rpath. + + * automake.in (handle_ltlibraries): Treat EXTRA_ libraries + specially. + Wed Apr 2 00:03:50 1997 Tom Tromey * automake.in (handle_source_transform): Don't generate dependency diff --git a/TODO b/TODO index 9968d7a42..44201d4ea 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,13 @@ * NORMAL_INSTALL / NORMAL_UNINSTALL -vs- recursive rules - [ requires changes to the standard, I think ] + [ requires changes to the standard ] * dependency tracking doesn't work well when a file is removed the new code to track header dependencies exacerbates this what is the fix? + it would probably be better to use "gcc -MD" and move the .d + file into the .deps directory. That is, create the dependencies + as a side effect of compilation + This still won't solve the file-deletion problem * make sure `missing' defines are generated diff --git a/automake.in b/automake.in index 2ab5daecf..6f686c874 100755 --- a/automake.in +++ b/automake.in @@ -1591,7 +1591,6 @@ sub handle_ltlibraries } # Get the installation directory of each library. - next if ($key eq 'EXTRA'); for (&variable_value_as_list ($key . '_LTLIBRARIES')) { if ($instdirs{$_}) @@ -1668,14 +1667,24 @@ sub handle_ltlibraries $xlink = $linker ? $linker : 'LINK'; } + local ($rpath); + if ($instdirs{$onelib} eq 'EXTRA') + { + # It's an EXTRA_ library, so we can't specify -rpath. + # Yuck. + $rpath = 's/\@RPATH\@//go;'; + } + else + { + $rpath = 's/\@RPATH\@/-rpath ' . $instdirs{$onelib} . '/go;'; + } $output_rules .= &file_contents_with_transform ('s/\@LTLIBRARY\@/' . $onelib . '/go;' . 's/\@XLTLIBRARY\@/' . $xlib . '/go;' - . 's/\@DIR\@/' - . $instdirs{$onelib} . '/go;' + . $rpath . 's/\@XLINK\@/' . $xlink . '/go;', 'ltlibrary'); } diff --git a/automake.texi b/automake.texi index bf1b89096..3dd896edc 100644 --- a/automake.texi +++ b/automake.texi @@ -1294,6 +1294,14 @@ of extra libtool objects (@samp{.lo} files) to add to the shared library. The @samp{library_LDFLAGS} variable contains any additional libtool flags, such as @samp{-version-info} or @samp{-static}. +For libraries installed in some directory, @code{automake} will +automatically supply the appropriate @samp{-rpath} option. However, for +libraries determined at configure time (and thus mentioned in +@code{EXTRA_LTLIBRARIES}), @code{automake} does not know the eventual +installation directory; for such libraries you must add the +@samp{-rpath} option to the appropriate @samp{_LDFLAGS} variable by +hand. + @xref{Using Automake, Using Automake with Libtool, The Libtool Manual, libtool, The Libtool Manual}, for more information. diff --git a/lib/am/ltlibrary.am b/lib/am/ltlibrary.am index dd1d8178f..886533a7d 100644 --- a/lib/am/ltlibrary.am +++ b/lib/am/ltlibrary.am @@ -16,4 +16,4 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. @LTLIBRARY@: $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_DEPENDENCIES) - $(@XLINK@) -rpath $(@DIR@dir) $(@XLTLIBRARY@_LDFLAGS) $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_LIBADD) $(LIBS) + $(@XLINK@) @RPATH@ $(@XLTLIBRARY@_LDFLAGS) $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_LIBADD) $(LIBS) diff --git a/ltlibrary.am b/ltlibrary.am index dd1d8178f..886533a7d 100644 --- a/ltlibrary.am +++ b/ltlibrary.am @@ -16,4 +16,4 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. @LTLIBRARY@: $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_DEPENDENCIES) - $(@XLINK@) -rpath $(@DIR@dir) $(@XLTLIBRARY@_LDFLAGS) $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_LIBADD) $(LIBS) + $(@XLINK@) @RPATH@ $(@XLTLIBRARY@_LDFLAGS) $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_LIBADD) $(LIBS) diff --git a/stamp-vti b/stamp-vti index 0e52250dd..b5d034171 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,3 +1,3 @@ -@set UPDATED 27 March 1997 +@set UPDATED 3 April 1997 @set EDITION 1.1n @set VERSION 1.1n diff --git a/version.texi b/version.texi index 0e52250dd..b5d034171 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 27 March 1997 +@set UPDATED 3 April 1997 @set EDITION 1.1n @set VERSION 1.1n -- 2.47.3