From c440070d0674ade9df3bcc98bd5b34ba6de89625 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 7 Apr 1999 06:32:50 +0000 Subject: [PATCH] * doc/libtool.texi (Compile mode): Document potential problem and work-around for `-c -o dir/foo.lo'. --- ChangeLog | 3 +++ doc/libtool.texi | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 68311626b..e388c7d0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1999-04-07 Alexandre Oliva + * 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 diff --git a/doc/libtool.texi b/doc/libtool.texi index 3818760b5..1608dc9e7 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -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 -- 2.47.3