Remove some duplicate code in the build system
authorBenjamin Poirier <benjamin.poirier@polymtl.ca>
Mon, 10 Aug 2009 20:37:27 +0000 (16:37 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Wed, 12 Aug 2009 02:13:04 +0000 (22:13 -0400)
Centralize CFLAGS, LDFLAGS
Use some common automake directives for modules

Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
18 files changed:
configure.in
ltt/Makefile.am
lttv/Makefile.am
lttv/lttv/Makefile.am
lttv/modules/examples/Makefile.am
lttv/modules/gui/common.am [new file with mode: 0644]
lttv/modules/gui/controlflow/Makefile.am
lttv/modules/gui/detailedevents/Makefile.am
lttv/modules/gui/diskperformance/Makefile.am
lttv/modules/gui/filter/Makefile.am
lttv/modules/gui/histogram/Makefile.am
lttv/modules/gui/interrupts/Makefile.am
lttv/modules/gui/lttvwindow/lttvwindow/Makefile.am
lttv/modules/gui/resourceview/Makefile.am
lttv/modules/gui/statistics/Makefile.am
lttv/modules/gui/tracecontrol/Makefile.am
lttv/modules/gui/tutorial/Makefile.am
lttv/modules/text/Makefile.am

index c48c3aa830b0c2c347d382e0574771c9a974f19c..89acdb359bdcf2c6b485636aec200def8c8a809f 100644 (file)
@@ -60,9 +60,13 @@ AC_HEADER_STDC
 
 pkg_modules="gtk+-2.0 >= 2.0.0"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
-PACKAGE_CFLAGS="-Wall -Wformat"
-AC_SUBST(PACKAGE_CFLAGS)
-AC_SUBST(PACKAGE_LIBS)
+
+PACKAGE_CFLAGS="$PACKAGE_CFLAGS -Wall -Wformat"
+MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
+MODULE_LDFLAGS="-module -avoid-version"
+AC_SUBST([PACKAGE_CFLAGS])
+AC_SUBST([MODULE_CFLAGS])
+AC_SUBST([MODULE_LDFLAGS])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
@@ -89,9 +93,6 @@ top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
 
 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
 
-#CPPFLAGS="${GLIB_CFLAGS}"
-#AC_SUBST(CPPFLAGS)
-
 lttincludedir="${includedir}/ltt"
 lttvincludedir="${includedir}/lttv"
 lttvwindowincludedir="${includedir}/lttvwindow"
index 8f17b098f61af1a6a96f44648a1e6db4a57367ab..aab53f96773e856c2cb38d4163a37a903eae8a47 100644 (file)
@@ -6,7 +6,7 @@
 
 #libdir = ${lttlibdir}
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
+AM_CFLAGS = $(PACKAGE_CFLAGS)
 LIBS += $(GLIB_LIBS)
 LIBS += $(THREAD_LIBS)
 
index 8e473bb2459e2c8db5ca81b5205f402243de2cde..8370b90af5cb6604b9916a66d9251bc6e6aa9b1f 100644 (file)
@@ -2,4 +2,3 @@
 # themselves to libraries compiled here but not installed in the system.
 SUBDIRS = lttv modules
 
-modules_CFLAGS = -fvisibility=hidden
index 170f4d5bd3d48d35c52538da70cf0435bb7bd1f9..24caa3154fe7382de3b9b2687691e9f6f336887b 100644 (file)
@@ -1,4 +1,5 @@
-AM_CFLAGS = $(GLIB_CFLAGS) 
+AM_CFLAGS= $(PACKAGE_CFLAGS)
+
 LIBS += $(THREAD_LIBS)
 LIBS += $(POPT_LIBS) $(GLIB_LIBS) -lgobject-2.0 -L${top_builddir}/ltt\
           -llttvtraceread
@@ -24,25 +25,10 @@ lttv-gui: lttv-gui.sh
 
 INCLUDES = \
        -DPACKAGE_PLUGIN_DIR=\""$(lttvplugindir)"\" \
-       @PACKAGE_CFLAGS@ \
        $(DEFAULT_INCLUDES)
 
 libdir = ${lttvplugindir}
 
-lttvinclude_HEADERS = \
-       attribute.h\
-       hook.h\
-       iattribute.h\
-       lttv.h\
-       module.h\
-       option.h\
-       state.h\
-       stats.h\
-       tracecontext.h\
-       traceset.h\
-       filter.h\
-       print.h
-
 #noinst_HEADERS = \
 #      filter.h
 
index 82f7ec9d484505569bcf4cb19e04721ad7b5ec9a..c90c0d118c77a1adfa77a5d029033b91c24141c5 100644 (file)
@@ -4,14 +4,14 @@
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-libdir = ${lttvplugindir}
-AM_CFLAGS = $(GLIB_CFLAGS) 
+AM_CFLAGS = $(PACKAGE_CFLAGS)
+AM_LDFLAGS = $(MODULE_LDFLAGS)
+
 LIBS += $(GLIB_LIBS)
 
+libdir = ${lttvplugindir}
+
 lib_LTLIBRARIES = libsampledep.la libsamplemodule.la libsamplemodule2.la
-libsampledep_la_LDFLAGS = -module -avoid-version
 libsampledep_la_SOURCES = sampledep.c
-libsamplemodule_la_LDFLAGS = -module -avoid-version
 libsamplemodule_la_SOURCES = samplemodule.c
-libsamplemodule2_la_LDFLAGS = -module -avoid-version
 libsamplemodule2_la_SOURCES = samplemodule2.c
diff --git a/lttv/modules/gui/common.am b/lttv/modules/gui/common.am
new file mode 100644 (file)
index 0000000..a0fda89
--- /dev/null
@@ -0,0 +1,27 @@
+# vim: set syntax=automake:
+# This file is part of the Linux Trace Toolkit viewer
+# Copyright (C) 2003-2004 Mathieu Desnoyers
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License Version 2 as
+# published by the Free Software Foundation;
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# 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 2f3cc0c2616bbb7370cb2d6ff1b465c65481109a..86a48cd76f51e763a9c2fc3ae6d7a56bc48b2a9f 100644 (file)
 # Created by Mathieu Desnoyers on September 27, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libguicontrolflow.la
-libguicontrolflow_la_LDFLAGS = -module -avoid-version
 libguicontrolflow_la_SOURCES =         module.c eventhooks.c cfv.c processlist.c\
                                drawing.c drawitem.c lttv_plugin_cfv.c
 
index 51a63d64b047657b34f4e329735b37d4164ce692..a417fab069a4ecbf5267eb9568b5045f7d5597bd 100644 (file)
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libguievents.la
-libguievents_la_LDFLAGS = -module -avoid-version
 libguievents_la_SOURCES = events.c lttv_plugin_evd.c
 
 noinst_HEADERS =       lttv_plugin_evd.h events.h
index 4c2c77124912179cdace3a4add6054a0cd3d72d9..3d30a5bf323f3188031850a8ffb98b85279ccef8 100644 (file)
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libdiskperformance.la
-libdiskperformance_la_LDFLAGS = -module -avoid-version
 libdiskperformance_la_SOURCES = diskperformance.c
 
 EXTRA_DIST = \
index 79d86fdfb5fd794c20e1ae563411c1da70151b6f..7d3c7ff9ade8230dcc22574f695f13a58e7e8fe9 100644 (file)
@@ -4,17 +4,9 @@
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-LIBS += $(THREAD_LIBS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libguifilter.la
-libguifilter_la_LDFLAGS = -module -avoid-version
 libguifilter_la_SOURCES = filter.c
 
 EXTRA_DIST = \
index a40c59b2c15a7db724d8e6fbe1bb49806be3e5cb..dfb1975d975cfd321390d1aca4c3faef714e2f0f 100644 (file)
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libguihistogram.la
-libguihistogram_la_LDFLAGS = -module -avoid-version
 libguihistogram_la_SOURCES = histomodule.c histoeventhooks.c histocfv.c \
                        histobuttonwidget.c histodrawing.c histodrawitem.c
 
index c564049a249b32d240cb6cd8bb72085b9ec75107..e1c530e7db138918eacf8ba3fb8ed4a9d1eda65e 100644 (file)
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libinterrupts.la
-libinterrupts_la_LDFLAGS = -module -avoid-version
 libinterrupts_la_SOURCES = interrupts.c
 
 EXTRA_DIST = \
index be552644bccfd4759af3d1a3f14c0c103d31136f..ddccc4c4d366b1e4907a16a9ac469d9c30ca57c0 100644 (file)
@@ -1,16 +1,10 @@
 ## Process this file with automake to produce Makefile.in
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS)
+include ../../common.am
 
 INCLUDES = \
        -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-       @PACKAGE_CFLAGS@ \
        $(DEFAULT_INCLUDES)
 
 #libdir = ${lttvplugindir}
@@ -45,5 +39,5 @@ lttvwindowinclude_HEADERS = \
        lttv_plugin_tab.h \
        lttv_plugin.h
 
-liblttvwindow_la_LIBADD = @PACKAGE_LIBS@ $(INTLLIBS)
+liblttvwindow_la_LIBADD = $(INTLLIBS)
 
index eea691a8368a60edd7b9bd9eaebd2ac89bad6c3e..e22738ce508c3e797a880efc8fc5e5c107e04db1 100644 (file)
 # Created by Mathieu Desnoyers on September 27, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libresourceview.la
-libresourceview_la_LDFLAGS = -module -avoid-version
 libresourceview_la_SOURCES =   module.c eventhooks.c cfv.c processlist.c drawing.c drawitem.c lttv_plugin_cfv.c
 
 noinst_HEADERS = eventhooks.h cfv.h processlist.h drawing.h drawitem.h lttv_plugin_cfv.h
index f6568c514b878e74b99c0cbeddc107483b55065d..9418a731cf694b3de6b7976fcb16c1072387f31f 100644 (file)
@@ -4,17 +4,9 @@
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libguistatistics.la
-libguistatistics_la_LDFLAGS = -module -avoid-version
 libguistatistics_la_SOURCES = statistics.c
 
 EXTRA_DIST = \
index 96a13df54cfe2590aabffc83d90711f7b4d470d6..2865e696d8b05bbaa6be1c7ded212bdccf9e3104 100644 (file)
@@ -4,19 +4,12 @@
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
+include ../common.am
+
 AM_CFLAGS += -DPACKAGE_DATA_DIR=\""$(datadir)"\" -DPACKAGE_BIN_DIR=\""$(bindir)"\"
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
 LIBS += $(UTIL_LIBS)
 
-libdir = ${lttvplugindir}
-
 lib_LTLIBRARIES = libguitracecontrol.la
-libguitracecontrol_la_LDFLAGS = -module -avoid-version
 libguitracecontrol_la_SOURCES = tracecontrol.c
 
 EXTRA_DIST = \
index 7aed5b42b2854a3a10ff9274c9bf0c85e4c55282..372facf68161073899d4c887a07e804b1f721aa5 100644 (file)
 # Created by Mathieu Desnoyers on May 6, 2003
 #
 
-AM_CFLAGS = $(GLIB_CFLAGS) 
-AM_CFLAGS += $(GTK_CFLAGS)
-AM_CFLAGS += -fvisibility=hidden
-LIBS += $(GLIB_LIBS)
-LIBS += $(THREAD_LIBS)
-LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
-
-libdir = ${lttvplugindir}
+include ../common.am
 
 lib_LTLIBRARIES = libtutorial.la
-libtutorial_la_LDFLAGS = -module -avoid-version
 libtutorial_la_SOURCES = tutorial.c
 
 EXTRA_DIST = \
index 0e91ebef4c071e8b95f8f7787fc9613c9ca1432d..697181a80f031b8331138e453b6ecff1756098e1 100644 (file)
@@ -1,19 +1,16 @@
-AM_CFLAGS = $(GLIB_CFLAGS) 
+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
-libtextDump_la_LDFLAGS = -module -avoid-version
+
 libtextDump_la_SOURCES = textDump.c
-libbatchAnalysis_la_LDFLAGS = -module -avoid-version
 libbatchAnalysis_la_SOURCES = batchAnalysis.c
-libtextFilter_la_LDFLAGS = -module -avoid-version
 libtextFilter_la_SOURCES = textFilter.c
-libprecomputeState_la_LDFLAGS = -module -avoid-version
 libprecomputeState_la_SOURCES = precomputeState.c
-libdepanalysis_la_LDFLAGS = -module -avoid-version
 libdepanalysis_la_SOURCES = depanalysis.c sstack.c
 
 noinst_HEADERS = \
This page took 0.032458 seconds and 4 git commands to generate.