summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2004-10-22 20:00:27 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2004-10-22 20:00:27 +0000
commitde019ad5ce0170e4d3f75d0538b6509091940e65 (patch)
tree21f84e547a683d69f75852760c2cc7dca1d04300
parent1a5a0962c2ad25b52d60646592cf0cd9ee04e19e (diff)
downloadautomake-de019ad5ce0170e4d3f75d0538b6509091940e65.tar.gz
* doc/automake.texi (Libtool Convenience Libraries): Explain how
to force the linker selection.
-rw-r--r--ChangeLog3
-rw-r--r--doc/automake.texi37
-rw-r--r--doc/stamp-vti2
-rw-r--r--doc/version.texi2
4 files changed, 42 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e43858da..2bb8c4ac7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2004-10-22 Alexandre Duret-Lutz <adl@gnu.org>
+ * doc/automake.texi (Libtool Convenience Libraries): Explain how
+ to force the linker selection.
+
* lib/install-sh: Fix the dirname emulation to ignore trailing
slashes, i.e., the direname of `a/b/' is `a', not `a/b/'. This
caused `install-sh a/b/' to fail.
diff --git a/doc/automake.texi b/doc/automake.texi
index af989206c..583e9697e 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -3210,6 +3210,43 @@ libsub2_la_LIBADD = \
@dots{}
@end example
+When using such setup, beware that @command{automake} will assume
+@file{libtop.la} is to be linked with the C linker. This is because
+@code{libtop_la_SOURCES} is empty, so @command{automake} picks C as
+default language. If @code{libtop_la_SOURCES} was not empty,
+@command{automake} would select the linker as explained in @ref{How
+the Linker is Chosen}.
+
+If one of the sublibraries contains non-C source, it is important that
+the appropriate linker be chosen. One way to achieve this is to
+pretend that there is such a non-C file among the sources of the
+library, thus forcing @command{automake} to select the appropriate
+linker. Here is the top-level @file{Makefile} of our example updated
+to force C++ linking.
+
+@example
+SUBDIRS = sub1 sub2 @dots{}
+lib_LTLIBRARIES = libtop.la
+libtop_la_SOURCES =
+# Dummy C++ source to cause C++ linking.
+nodist_EXTRA_libtop_la_SOURCES = dummy.cxx
+libtop_la_LIBADD = \
+ sub1/libsub1.la \
+ sub2/libsub2.la \
+ @dots{}
+@end example
+
+@code{EXTRA_*_SOURCES} variables are used to keep track of source
+files that might be compiled (this is mostly useful when doing
+conditional compilation using @code{AC_SUBST}, see @ref{Conditional
+Libtool Sources}), and the @code{nodist_} prefix means the listed
+sources are not to be distributed (@pxref{Program and Library
+Variables}). In effect the file @file{dummy.cxx} does not need to
+exist in the source tree. Of course if you have some real source file
+to list in @code{libtop_la_SOURCES} there is no point in cheating with
+@code{nodist_EXTRA_libtop_la_SOURCES}.
+
+
@node Libtool Modules
@subsection Libtool Modules
@cindex modules, libtool
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 65cc8de82..ec47b48b6 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 12 October 2004
+@set UPDATED 22 October 2004
@set UPDATED-MONTH October 2004
@set EDITION 1.9.2a
@set VERSION 1.9.2a
diff --git a/doc/version.texi b/doc/version.texi
index 65cc8de82..ec47b48b6 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 12 October 2004
+@set UPDATED 22 October 2004
@set UPDATED-MONTH October 2004
@set EDITION 1.9.2a
@set VERSION 1.9.2a