]> 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:32:50 +0000 (06:32 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 7 Apr 1999 06:32:50 +0000 (06:32 +0000)
work-around for `-c -o dir/foo.lo'.

ChangeLog
doc/libtool.texi

index 68311626b09caf453069393d554413348ce138ef..e388c7d0a16a0007d407f823a84040e8f7d5dab1 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 3818760b5392e25abe8f2a402133b1181892cc1f..1608dc9e72e0d930a4382fccb00e90574e084587 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