* doc/automake.texi (Linking, Program and Library Variables):
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 27 Jul 2005 19:05:21 +0000 (19:05 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 27 Jul 2005 19:05:21 +0000 (19:05 +0000)
Suggest reserving -l for third-party libraries.

ChangeLog
doc/automake.texi

index 735b471..8272f1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-07-27  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * doc/automake.texi (Linking, Program and Library Variables):
+       Suggest reserving -l for third-party libraries.
+
        * lib/Automake/Variable.pm (require_variables): Mention aclocal's
        search path when suggesting to add a macro in configure.ac.
        People are confused when Automake suggests adding a macro (such as
index 085d767..190c389 100644 (file)
@@ -3226,6 +3226,16 @@ configure substitutions that are left in are only @samp{$(LIBOBJS)} and
 cause an invalid value for @code{@var{prog}_DEPENDENCIES} to be
 generated.
 
+@cindex @code{LDADD} and @option{-l}
+@cindex @option{-l} and @code{LDADD}
+We recommend that you avoid using @option{-l} options in @code{LDADD}
+or @code{@var{prog}_LDADD} when referring to libraries built by your
+package.  Instead, write the file name of the library explicitly as in
+the above @code{cpio} example.  Use @option{-l} only to list
+third-party libraries.  If you follow this rule, the default value of
+@code{@var{prog}_DEPENDENCIES} will list all your local libraries and
+omit the other ones.
+
 
 @node Conditional Sources
 @subsection Conditional compilation of sources
@@ -4057,6 +4067,11 @@ could link your program against the X libraries like so:
 maude_LDADD = $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS)
 @end example
 
+We recommend that you use @option{-l} and @option{-L} only when
+referring to third-party libraries, and give the explicit file names
+of any library built by your package.  Doing so will ensure that
+@code{maude_DEPENDENCIES} (see below) is correctly defined by default.
+
 @item maude_LDFLAGS
 This variable is used to pass extra flags to the link step of a program
 or a shared library.  It overrides the global @code{AM_LDFLAGS} variable.