]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* doc/libtool.texi (Compile mode): Document potential problem and
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 7 Apr 1999 06:33:30 +0000 (06:33 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 7 Apr 1999 06:33:30 +0000 (06:33 +0000)
work-around for `-c -o dir/foo.lo'.

ChangeLog
doc/libtool.texi

index c38d8da1d27da8e3ea03d885d20344afc4cab49a..28a9d16702a7f3b0cd092c89b4a36b08aa9982a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-04-07  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * doc/libtool.texi (Compile mode): Document potential problem and
+       work-around for `-c -o dir/foo.lo'.
+
        * tests/dryrun.test: The constant modifications of libtool would
        cause main.o to be updated at the wrong time; the new approach is
        to modify the libtool script so that it enables dry run depending
index 1c2b6c8d4b2f3389cfdfb26c3d135c34d0f41e2c..fe971f7d8f49117400129ec391fbb1221a609aa9 100644 (file)
@@ -1140,7 +1140,7 @@ If the @samp{-static} option is given, then a @samp{.o} file is built,
 even if libtool was configured with @samp{--disable-static}.
 
 Note that the @samp{-o} option is now fully supported.  It is emulated
-for the platforms that don't support it (by locking and moving the
+on the platforms that don't support it (by locking and moving the
 objects), so it is really easy to use libtool, just with minor
 modifications to your Makefiles. Typing for example
 @example
@@ -1148,6 +1148,20 @@ libtool gcc -c foo/x.c -o foo/x.lo
 @end example
 will do what you expect.
 
+Note, however, that, if the compiler does not support @samp{-c} and
+@samp{-o}, it is impossible to compile @file{foo/x.c} without
+overwriting an existing @file{./x.o}.  Therefore, if you do have a
+source file @file{./x.c}, make sure you introduce dependencies in your
+@file{Makefile} to make sure @file{./x.o} (or @file{./x.lo}) is
+re-created after any sub-directory's @file{x.lo}:
+@example
+x.o x.lo: foo/x.lo bar/x.lo
+@end example
+This will also ensure that make won't try to use a temporarily corrupted
+@file{x.o} to create a program or library.  It may cause needless
+recompilation on platforms that support @samp{-c} and @samp{-o}
+together, but it's the only way to make it safe for those that don't.
+
 @node Link mode
 @section Link mode
 @cindex link mode