[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making tests dependent on the library that they test...

From: Alexandre Duret-Lutz
Subject: Re: making tests dependent on the library that they test...
Date: Wed, 27 Jul 2005 21:05:03 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

>>> "EH" == Ed Hartnett <address@hidden> writes:


 EH> # These linker flags will be applied to all test program compiles.
 EH> LDADD = -lnetcdf -lhdf5 -lhdf5_hl
 EH> # Test programs (unless they have _h_ in the name) are dependent on
 EH> # the netcdf library (i.e. should be rebuilt if the library's more
 EH> # recent).
 EH> tst_nc_converts_DEPENDENCIES =
 EH> tst_lists_DEPENDENCIES =
 EH> tst_dims_DEPENDENCIES =
 EH> tst_files_DEPENDENCIES =
 EH> ...

 EH> Is there a better way to do this? Specifically, one which doesn't
 EH> require me to explicitly list the dependency program for each and
 EH> every test program that depends on it.


I'm installing the following on HEAD and branch-1-9.

2005-07-27  Alexandre Duret-Lutz  <address@hidden>

        * doc/automake.texi (Linking, Program and Library Variables):
        Suggest reserving -l for third-party libraries.

Index: doc/automake.texi
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.120
diff -u -r1.120 automake.texi
--- doc/automake.texi   27 Jul 2005 06:34:18 -0000      1.120
+++ doc/automake.texi   27 Jul 2005 19:02:42 -0000
@@ -3226,6 +3226,16 @@
 cause an invalid value for @address@hidden to be
address@hidden @code{LDADD} and @option{-l}
address@hidden @option{-l} and @code{LDADD}
+We recommend that you avoid using @option{-l} options in @code{LDADD}
+or @address@hidden 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
address@hidden@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 @@
 @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
address@hidden (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.

Alexandre Duret-Lutz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]