automake
[Top][All Lists]
Advanced

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

AC_LIBOBJ and C++


From: Norman Gray
Subject: AC_LIBOBJ and C++
Date: Tue, 22 Jul 2003 21:40:41 +0100


Greetings,

How does one optionally include C++ (or any non-C) sources in automake?

I don't mean functions to replace missing system functionality, but modules within a package which the user may want or have to omit at ./configure time.

The obvious thing seems to be to use AC_LIBOBJ([function]) within configure.ac to add the object file, and, using AC_LIBSOURCE implicitly, add to the extra distributed sources. However, AC_LIBOBJ is documented to add function.c to the distribution, and automake complains if that isn't present -- it isn't, but function.cc is where function.o is supposed to come from. This all makes sense if AC_LIBOBJ is specifically for replacing missing system functionality, but in that case what _am_ I supposed to be using to mix in optional functionality?

I did have this working by defining and AC_SUBSTing a variety of @otherOBJ@ variables and adding them to the libFOO_la_LIBADD line. That sort-of works, but it would require me to do fancy sedding to turn the list of .o files which I've accumulated from configure.ac into the .lo files which should be put on the _LIBADD line.

Do I really need to do the rewriting described in section "`AC_LIBOBJ' vs. `LIBOBJS'" of the autoconf manual, even though that section appears to be trying very hard to tell me I don't have to do this any more, and that I shouldn't mess with LTLIBOBJS? It doesn't actually say that in so many words, but it warns me off hacking LIBOBJS so fiercely that I don't want to touch LTLIBOBJS either (I'm terribly obedient; I'm sure it's a vice).

[ Just by the way, there appear to be a couple of "@&t@" strings astray in that section. Is this fallout from some not-quite-working escaping, or is it something more arcane than I recognise!? ]

A fair bit of googling didn't show up anything that seemed relevant, but that's partly because searching for `ac_libobj c++' is always going to throw up lots and lots of chaff. Also, looking through the list archives for the last few months didn't come up with any likely messages.

I'm looking at (the documentation for) autoconf 2.57 and automake 1.7.5

Thanks for any pointers.  All the best,

Norman


--
----------------------------------------------------------------------
Norman Gray                   http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow    address@hidden





reply via email to

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