[Telepathy-commits] [telepathy-qt4/master] Don't use TP_QT4_LIBS or PROTO_LIBS, they interfere with dependency tracking

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Dec 3 04:35:23 PST 2008


Autoconf substitutions in *_LDADD do not generate Makefile dependencies,
so using $(TP_QT4_LIBS) meant that tests/examples were not automatically
rebuilt when telepathy-qt4 changed.

Also simplify makefiles by using LDADD.
---
 configure.ac                    |    9 +++------
 examples/extensions/Makefile.am |    6 +++++-
 tests/dbus/Makefile.am          |    7 ++++++-
 tests/pinocchio/Makefile.am     |    8 +++-----
 tests/prototype/Makefile.am     |    7 +++----
 5 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index c4e7928..d60ee62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,18 +141,15 @@ PKG_CHECK_MODULES(QTTEST, [QtTest >= 4.5])
 AC_SUBST(QTTEST_CFLAGS)
 AC_SUBST(QTTEST_LIBS)
 
-dnl We want the examples to be able to use TP_QT4_CFLAGS, TP_QT4_LIBS
-dnl as though they were independent programs that got them from pkgconfig
+dnl We want examples/tests to be able to use TP_QT4_CFLAGS as though they
+dnl were independent programs that got them from pkgconfig; AC_SUBST'ing
+dnl TP_QT4_LIBS would interfere with dependency tracking, so don't do that
 TP_QT4_CFLAGS='-I${top_builddir} -I${top_srcdir}'
-TP_QT4_LIBS='${top_builddir}/TelepathyQt4/libtelepathy-qt4.la'
 AC_SUBST(TP_QT4_CFLAGS)
-AC_SUBST(TP_QT4_LIBS)
 
 dnl Likewise for the prototype library
 PROTO_CFLAGS='-I${top_builddir} -I${top_srcdir}'
-PROTO_LIBS='${top_builddir}/TelepathyQt4/Prototype/libtpqt4-prototype.la'
 AC_SUBST(PROTO_CFLAGS)
-AC_SUBST(PROTO_LIBS)
 
 AC_PATH_PROGS([PINOCCHIO], [telepathy-pinocchio], [none],
   [$PATH:/usr/local/libexec:/usr/libexec:/usr/lib/telepathy])
diff --git a/examples/extensions/Makefile.am b/examples/extensions/Makefile.am
index da4f047..8d11840 100644
--- a/examples/extensions/Makefile.am
+++ b/examples/extensions/Makefile.am
@@ -29,8 +29,12 @@ EXTRA_DIST = \
 
 noinst_LTLIBRARIES = libexample-extensions.la
 
+# In an external project you'd use $(TP_QT4_LIBS) (obtained from pkg-config
+# via autoconf) instead of the path to libtelepathy-qt4.la
 libexample_extensions_la_LIBADD = \
-    $(TP_QT4_LIBS)
+    $(QTCORE_LIBS) \
+    $(QTDBUS_LIBS) \
+    $(top_builddir)/TelepathyQt4/libtelepathy-qt4.la
 
 libexample_extensions_la_SOURCES = \
     cli-connection.cpp \
diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am
index f8e58cd..915bc61 100644
--- a/tests/dbus/Makefile.am
+++ b/tests/dbus/Makefile.am
@@ -13,7 +13,12 @@ _gen/%.moc.hpp: %.cpp
 noinst_PROGRAMS = $(TESTS)
 
 test_do_nothing_SOURCES = do-nothing.cpp
-test_do_nothing_LDADD = $(TP_QT4_LIBS) $(QTTEST_LIBS)
+
+LDADD = \
+    $(QTCORE_LIBS) \
+    $(QTDBUS_LIBS) \
+    $(QTTEST_LIBS) \
+    ${top_builddir}/TelepathyQt4/libtelepathy-qt4.la
 
 LIB_CFLAGS = \
     $(QTCORE_CFLAGS) \
diff --git a/tests/pinocchio/Makefile.am b/tests/pinocchio/Makefile.am
index 61279a6..62d8497 100644
--- a/tests/pinocchio/Makefile.am
+++ b/tests/pinocchio/Makefile.am
@@ -24,24 +24,22 @@ _gen/%.moc.hpp: %
 noinst_PROGRAMS = $(TESTS)
 
 test_chan_basics_SOURCES = chan-basics.cpp lib.cpp
-test_chan_basics_LDADD = $(ALL_LIBS)
 
 test_conn_basics_SOURCES = conn-basics.cpp lib.cpp
-test_conn_basics_LDADD = $(ALL_LIBS)
 
 test_do_nothing_SOURCES = do-nothing.cpp lib.cpp
-test_do_nothing_LDADD = $(ALL_LIBS)
 
 LIB_CFLAGS = \
     $(QTCORE_CFLAGS) \
     $(QTDBUS_CFLAGS) \
     $(QTTEST_CFLAGS) \
     $(TP_QT4_CFLAGS)
-ALL_LIBS = \
+
+LDADD = \
     $(QTCORE_LIBS) \
     $(QTDBUS_LIBS) \
     $(QTTEST_LIBS) \
-    $(TP_QT4_LIBS)
+    ${top_builddir}/TelepathyQt4/libtelepathy-qt4.la
 
 AM_CXXFLAGS = \
     $(ERROR_CXXFLAGS) \
diff --git a/tests/prototype/Makefile.am b/tests/prototype/Makefile.am
index 59e8f67..d3c4a34 100644
--- a/tests/prototype/Makefile.am
+++ b/tests/prototype/Makefile.am
@@ -18,7 +18,6 @@ BUILT_SOURCES = \
     _gen/prototype.h.moc
 
 test_prototype_SOURCES = prototype.cpp prototype.h _gen/images.hpp
-test_prototype_LDADD = $(DEP_LIBS)
 
 EXTRA_DIST = images.qrc avatar.png
 
@@ -34,13 +33,13 @@ DEP_CFLAGS = \
     $(TP_QT4_CFLAGS) \
     $(PROTO_CFLAGS)
 
-DEP_LIBS = \
+LDADD = \
     $(QTCORE_LIBS) \
     $(QTDBUS_LIBS) \
     $(QTGUI_LIBS) \
-    $(TP_QT4_LIBS) \
     $(QTTEST_LIBS) \
-    $(PROTO_LIBS)
+    $(top_builddir)/TelepathyQt4/libtelepathy-qt4.la \
+    $(top_builddir)/TelepathyQt4/Prototype/libtpqt4-prototype.la
 
 AM_CXXFLAGS = \
     $(ERROR_CXXFLAGS) \
-- 
1.5.6.5




More information about the Telepathy-commits mailing list