octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #47317] "make tags" fails


From: Rik
Subject: [Octave-bug-tracker] [bug #47317] "make tags" fails
Date: Wed, 02 Mar 2016 01:13:51 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #2, bug #47317 (project octave):

I think I see what is going on.  According to the Automake documentation:


For each primary, there is one additional variable named by prepending
‘EXTRA_’ to the primary name. This variable is used to list objects that
may or may not be built, depending on what configure decides. This variable is
required because Automake must statically know the entire list of objects that
may be built in order to generate a Makefile.in that will work in all cases. 


Separately, the hack we are using to force liboctave and libgui to be linked
using the CXX linker is also in the documentation. 



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 automake
to select the appropriate linker. Here is the top-level Makefile of our
example updated to force C++ linking.

SUBDIRS = sub1 sub2 …
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 \
  …

‘EXTRA_*_SOURCES’ variables are used to keep track of source files that
might be compiled (this is mostly useful when doing conditional compilation
using AC_SUBST, see Conditional Libtool Sources), and the nodist_ prefix means
the listed sources are not to be distributed (see Program and Library
Variables). In effect the file dummy.cxx does not need to exist in the source
tree. Of course if you have some real source file to list in libtop_la_SOURCES
there is no point in cheating with nodist_EXTRA_libtop_la_SOURCES. 


I think the problem is that the EXTRA_ tag is meant to be used for conditional
compilation where some of the files might or might not be included in a
particular build.  This works fine for our build system because there are no
rules to process dummy.cxx and there are no dependencies on dummy.cxx.  The
only result is a side effect that the generated linker command is for C++
sources.

However, tags, ctags, and scope are meant to operate on all files declared in
_SOURCES.  Just because the file isn't used in this particular build, doesn't
mean it doesn't require indexing.

I pushed a cset that makes a real file .dummy_force_cxx_link.cc in liboctave
and libgui.  The file is empty and the leading '.' should make it invisible
most of the time.  I opted to distribute it in the tarball so that someone
could use the tags or cscope target after downloading.  If we feel that these
makefile targets are only for developers then we could add nodist_ to the
Automake rule.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47317>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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