lttv: Clean up library handling in the build system
authorBenjamin Poirier <benjamin.poirier@polymtl.ca>
Mon, 10 Aug 2009 20:38:06 +0000 (16:38 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Wed, 12 Aug 2009 02:16:08 +0000 (22:16 -0400)
Take advantage of some more autoconf macros
Use LDADD instead of modifying LIBS through automake
Do not link each loadable module against lttvwindow ("Warning: Linking the
shared library [...] against the loadable module liblttvwindow.so is not
portable!")

Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
configure.in
ltt/Makefile.am
lttv/lttv/Makefile.am
lttv/lttv/lttv-gui.sh
lttv/modules/gui/common.am
lttv/modules/gui/lttvwindow/lttvwindow/Makefile.am
lttv/modules/gui/tracecontrol/Makefile.am
lttv/modules/text/Makefile.am
runlttv

index 89acdb359bdcf2c6b485636aec200def8c8a809f..926c0142d22f07d39df373558a919c2f09cafa9e 100644 (file)
@@ -42,12 +42,11 @@ AC_PROG_CC
 AC_CHECK_LIB([popt], [poptGetNextOpt], POPT_LIBS="-lpopt",AC_MSG_ERROR([libpopt is required in order to compile LinuxTraceToolkit])  )
 #AC_CHECK_LIB([m], [round], M_LIBS="-lm",AC_MSG_ERROR([Mathematical libraries are missing.])  )
 
-AC_CHECK_LIB([util], [forkpty], UTIL_LIBS="-lutil", AC_MSG_ERROR([libutil is
-required in order to compile LinuxTraceToolkit]))
+AC_CHECK_LIB([util], [forkpty], UTIL_LIBS="-lutil", AC_MSG_ERROR([libutil is required in order to compile LinuxTraceToolkit]))
 
 
 # pthread for gdb with dlopen().
-AC_CHECK_LIB(pthread, pthread_join,[THREAD_LIBS="-lpthread"], AC_MSG_ERROR([LinuxThreads is required in order to make sure gdb works fine with lttv-gui]))
+AC_CHECK_LIB(pthread, pthread_join, [], AC_MSG_ERROR([LinuxThreads is required in order to make sure gdb works fine with lttv-gui]))
 
 # Checks for header files.
 AC_HEADER_STDC
@@ -59,9 +58,13 @@ AM_PROG_CC_STDC
 AC_HEADER_STDC
 
 pkg_modules="gtk+-2.0 >= 2.0.0"
-PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
+PKG_CHECK_MODULES(GTK, [$pkg_modules])
 
-PACKAGE_CFLAGS="$PACKAGE_CFLAGS -Wall -Wformat"
+pkg_modules="gobject-2.0 >= 2.0.0"
+PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
+
+LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS"
+PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS -Wall -Wformat"
 MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
 MODULE_LDFLAGS="-module -avoid-version"
 AC_SUBST([PACKAGE_CFLAGS])
@@ -98,9 +101,8 @@ lttvincludedir="${includedir}/lttv"
 lttvwindowincludedir="${includedir}/lttvwindow"
 lttctlincludedir="${includedir}/liblttctl"
 
-AC_SUBST(POPT_LIBS)
-AC_SUBST(UTIL_LIBS)
-AC_SUBST(THREAD_LIBS)
+AC_SUBST([POPT_LIBS])
+AC_SUBST([UTIL_LIBS])
 AC_SUBST(lttvlibdir)
 AC_SUBST(lttvplugindir)
 #AC_SUBST(lttlibdir)
index aab53f96773e856c2cb38d4163a37a903eae8a47..2850f4d2e868d063545415732c00178a6f0add8f 100644 (file)
@@ -7,8 +7,6 @@
 #libdir = ${lttlibdir}
 
 AM_CFLAGS = $(PACKAGE_CFLAGS)
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
 
 lib_LTLIBRARIES = liblttvtraceread.la
 liblttvtraceread_la_SOURCES = tracefile.c marker.c event.c
index 24caa3154fe7382de3b9b2687691e9f6f336887b..944d5988132eb518284a88040c5806bef5fd9cc0 100644 (file)
@@ -1,8 +1,5 @@
 AM_CFLAGS= $(PACKAGE_CFLAGS)
-
-LIBS += $(THREAD_LIBS)
-LIBS += $(POPT_LIBS) $(GLIB_LIBS) -lgobject-2.0 -L${top_builddir}/ltt\
-          -llttvtraceread
+LDADD = $(POPT_LIBS) ${top_builddir}/ltt/liblttvtraceread.la
 
 bin_PROGRAMS = lttv.real
 
index 2de28dee5ab5c9682316b1e16219bd2e902745c8..717f15ec092918f896bb1fa929f3a6a8388f40ef 100644 (file)
@@ -5,6 +5,6 @@
 
 LTTV_CMD=`echo $0 | sed 's/-gui$//'`
 
-$LTTV_CMD.real -m guievents -m guifilter -m guicontrolflow -m resourceview \
+$LTTV_CMD.real -m lttvwindow -m guievents -m guifilter -m guicontrolflow -m resourceview \
     -m guistatistics -m guitracecontrol $*
 
index a0fda89c7406c1e0f31f157be2afadec94ab70d1..ce50113dbd7985965bd1a535d63e55489cd55b52 100644 (file)
 # MA 02111-1307, USA.
 
 AM_CFLAGS = $(MODULE_CFLAGS)
-AM_CFLAGS += $(GTK_CFLAGS)
 AM_LDFLAGS = $(MODULE_LDFLAGS)
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
 
 libdir = ${lttvplugindir}
 
index ddccc4c4d366b1e4907a16a9ac469d9c30ca57c0..00e417742fce4bb2f40694585a2da2ef30333e23 100644 (file)
@@ -39,5 +39,3 @@ lttvwindowinclude_HEADERS = \
        lttv_plugin_tab.h \
        lttv_plugin.h
 
-liblttvwindow_la_LIBADD = $(INTLLIBS)
-
index 2865e696d8b05bbaa6be1c7ded212bdccf9e3104..27b1fde118ac567becfbb6b4d719d11d309ba205 100644 (file)
@@ -7,10 +7,10 @@
 include ../common.am
 
 AM_CFLAGS += -DPACKAGE_DATA_DIR=\""$(datadir)"\" -DPACKAGE_BIN_DIR=\""$(bindir)"\"
-LIBS += $(UTIL_LIBS)
 
 lib_LTLIBRARIES = libguitracecontrol.la
 libguitracecontrol_la_SOURCES = tracecontrol.c
+libguitracecontrol_la_LIBADD = $(UTIL_LIBS)
 
 EXTRA_DIST = \
     hTraceControlInsert.xpm TraceControlStart.xpm TraceControlPause.xpm \
index 697181a80f031b8331138e453b6ecff1756098e1..ee008f21157aaa81b2e3db5b48cd0990d5e17edf 100644 (file)
@@ -1,8 +1,6 @@
 AM_CFLAGS = $(MODULE_CFLAGS)
 AM_LDFLAGS = $(MODULE_LDFLAGS)
 
-LIBS += $(THREAD_LIBS)
-LIBS += $(GLIB_LIBS) -lgobject-2.0 -L${top_builddir}/ltt -llttvtraceread
 libdir = ${lttvplugindir}
 
 lib_LTLIBRARIES = libtextDump.la libbatchAnalysis.la libtextFilter.la libprecomputeState.la libdepanalysis.la
diff --git a/runlttv b/runlttv
index cf3590c8d2c40dc90d6b424455dbe678851a3a35..fd774d3042c19c624f665f6798eb8f0828914c0d 100755 (executable)
--- a/runlttv
+++ b/runlttv
 
 RCFILE=".runlttvrc"
 
-ARGS="-L lttv/modules/gui/controlflow/.libs -m guicontrolflow -L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow -L lttv/modules/gui/detailedevents/.libs -m guievents -L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol -L lttv/modules/gui/statistics/.libs -m guistatistics -L lttv/modules/gui/resourceview/.libs -m resourceview -L lttv/modules/gui/filter/.libs -m guifilter -L lttv/modules/gui/interrupts/.libs -m interrupts -L lttv/modules/gui/histogram/.libs -m guihistogram"
+ARGS=\
+"-L lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
+"-L lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
+"-L lttv/modules/gui/detailedevents/.libs -m guievents "\
+"-L lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
+"-L lttv/modules/gui/statistics/.libs -m guistatistics "\
+"-L lttv/modules/gui/resourceview/.libs -m resourceview "\
+"-L lttv/modules/gui/filter/.libs -m guifilter "\
+"-L lttv/modules/gui/interrupts/.libs -m interrupts "\
+"-L lttv/modules/gui/histogram/.libs -m guihistogram"
+
 LTTV_EXEC="lttv/lttv/.libs/lttv.real"
 
 if [ ! -e "$LTTV_EXEC" ]; then
This page took 0.027585 seconds and 4 git commands to generate.