[gnome-system-monitor] Move all C files to src/legacy. This is required because PKG_MODULE_CHEK doesn't know the difference



commit e828468ac0c02ae1a33e4a65f169a6927c98e156
Author: Benoît Dejean <bdejean gmail com>
Date:   Sat Feb 18 18:02:24 2017 +0100

    Move all C files to src/legacy.
    This is required because PKG_MODULE_CHEK doesn't know the difference between
    C and C++. So This way, the C files are built with C flags.

 configure.ac                        |   10 ++++++++++
 src/Makefile.am                     |   22 ++++++----------------
 src/application.h                   |    2 +-
 src/disks.cpp                       |    2 +-
 src/interface.cpp                   |    2 +-
 src/legacy/Makefile.am              |   33 +++++++++++++++++++++++++++++++++
 src/{ => legacy}/e_date.c           |    0
 src/{ => legacy}/e_date.h           |    0
 src/{ => legacy}/gsm_color_button.c |    0
 src/{ => legacy}/gsm_color_button.h |    0
 src/{ => legacy}/treeview.c         |    0
 src/{ => legacy}/treeview.h         |    0
 src/load-graph.cpp                  |    2 +-
 src/load-graph.h                    |    2 +-
 src/memmaps.cpp                     |    2 +-
 src/openfiles.cpp                   |    2 +-
 src/procproperties.cpp              |    2 +-
 src/proctable.cpp                   |    2 +-
 src/proctable.h                     |    2 +-
 src/util.cpp                        |    2 +-
 20 files changed, 60 insertions(+), 27 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 293e424..ed00bc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,15 @@ PKG_CHECK_MODULES(GSM,
   gmodule-2.0
 )
 
+PKG_CHECK_MODULES(GSM_LEGACY,
+  glib-2.0 >= $GLIB_REQUIRED
+  libgtop-2.0 >= $LIBGTOP_REQUIRED
+  gtk+-3.0 >= $GTK_REQUIRED
+  libxml-2.0 >= $LIBXML_REQUIRED
+  librsvg-2.0 >= $RSVG_REQUIRED
+  gmodule-2.0
+)
+
 AC_PATH_PROG(APPDATA_VALIDATE, appdata-validate)
 AC_PATH_PROG(DESKTOP_FILE_VALIDATE, desktop-file-validate)
 
@@ -121,6 +130,7 @@ AC_CONFIG_FILES([
 Makefile
 scripts/Makefile
 src/Makefile
+src/legacy/Makefile
 src/org.gnome.gnome-system-monitor.gschema.xml.in
 po/Makefile.in
 help/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 122316c..5df84c8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,8 +9,6 @@ AM_CPPFLAGS = \
 
 bin_PROGRAMS = gnome-system-monitor
 
-BUILT_SOURCES = gsm-resources.c
-
 gnome_system_monitor_cpp_files = \
        argv.cpp \
        interface.cpp \
@@ -35,36 +33,27 @@ gnome_system_monitor_cpp_files = \
        prefsdialog.cpp \
        application.cpp
 
-gnome_system_monitor_c_files = \
-       e_date.c \
-       gsm_color_button.c \
-       treeview.c
 
 gnome_system_monitor_h_files = \
        $(gnome_system_monitor_cpp_files:.cpp=.h) \
-       $(gnome_system_monitor_c_files:.c=.h) \
        defaulttable.h \
        settings-keys.h
 
 gnome_system_monitor_SOURCES = \
-       $(BUILT_SOURCES) \
        $(gnome_system_monitor_h_files) \
        $(gnome_system_monitor_cpp_files) \
-       $(gnome_system_monitor_c_files) \
        main.cpp
 
 LDADD = \
        $(GSM_LIBS) \
        $(SYSTEMD_LIBS) \
-       $(WNCK_LIBS)
-
-gsm-resources.c: gsm.gresource.xml $(shell glib-compile-resources --sourcedir=$(top_srcdir) 
--generate-dependencies $(srcdir)/gsm.gresource.xml)
-       $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(top_srcdir) --generate-source 
$(srcdir)/gsm.gresource.xml
+       $(WNCK_LIBS) \
+       legacy/libgsmlegacy.la
 
 
 # GSettings schemas, enum files and conversion file
 gsettings_ENUM_NAMESPACE = org.gnome.gnome-system-monitor
-gsettings_ENUM_FILES = $(top_srcdir)/src/*.h
+gsettings_ENUM_FILES = $(top_srcdir)/src/*.h $(top_srcdir)/src/legacy/*.h
 gsettings_in_file = org.gnome.gnome-system-monitor.gschema.xml.in
 gsettings_SCHEMAS = $(gsettings_in_file:.xml.in=.xml)
 @INTLTOOL_XML_NOMERGE_RULE@
@@ -77,9 +66,10 @@ EXTRA_DIST = \
        gsm.gresource.xml
 
 CLEANFILES = \
-       $(gsettings_SCHEMAS) \
-       $(BUILT_SOURCES)
+       $(gsettings_SCHEMAS)
 
 MAINTAINERCLEANFILES = $(gsettings_SCHEMAS:.xml=.valid)
 
+SUBDIRS = legacy
+
 -include $(top_srcdir)/git.mk
diff --git a/src/application.h b/src/application.h
index 730b9c5..5542de4 100644
--- a/src/application.h
+++ b/src/application.h
@@ -12,7 +12,7 @@ struct LoadGraph;
 
 #include "smooth_refresh.h"
 #include "prettytable.h"
-#include "treeview.h"
+#include "legacy/treeview.h"
 #include "util.h"
 
 static const unsigned MIN_UPDATE_INTERVAL =   1 * 1000;
diff --git a/src/disks.cpp b/src/disks.cpp
index d1933de..8ab19c5 100644
--- a/src/disks.cpp
+++ b/src/disks.cpp
@@ -10,7 +10,7 @@
 #include "application.h"
 #include "util.h"
 #include "settings-keys.h"
-#include "treeview.h"
+#include "legacy/treeview.h"
 
 enum DiskColumns
 {
diff --git a/src/interface.cpp b/src/interface.cpp
index 1ca4eac..626b6b8 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -41,7 +41,7 @@
 #include "util.h"
 #include "disks.h"
 #include "settings-keys.h"
-#include "gsm_color_button.h"
+#include "legacy/gsm_color_button.h"
 
 
 static gboolean
diff --git a/src/legacy/Makefile.am b/src/legacy/Makefile.am
new file mode 100644
index 0000000..9f3e68b
--- /dev/null
+++ b/src/legacy/Makefile.am
@@ -0,0 +1,33 @@
+AM_CPPFLAGS = \
+       -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
+       -DGSM_LIBEXEC_DIR=\""$(pkglibexecdir)"\" \
+       $(GSM_LEGACY_CFLAGS) \
+       $(SYSTEMD_CFLAGS) \
+       $(WNCK_CFLAGS)
+
+BUILT_SOURCES = gsm-resources.c
+
+libgsmlegacy_c_files = \
+       e_date.c \
+       gsm_color_button.c \
+       treeview.c
+
+libgsmlegacy_h_files = \
+       $(libgsmlegacy_c_files:.c=.h)
+
+noinst_LTLIBRARIES = libgsmlegacy.la
+libgsmlegacy_la_SOURCES = \
+       $(libgsmlegacy_c_files) \
+       $(libgsmlegacy_h_files) \
+       $(BUILT_SOURCES)
+
+gsm-resources.c: $(top_srcdir)/src/gsm.gresource.xml $(shell glib-compile-resources 
--sourcedir=$(top_srcdir) --generate-dependencies $(top_srcdir)/src/gsm.gresource.xml)
+       $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(top_srcdir) --generate-source 
$(top_srcdir)/src/gsm.gresource.xml
+
+
+
+CLEANFILES = \
+       $(BUILT_SOURCES)
+
+-include $(top_srcdir)/git.mk
+
diff --git a/src/e_date.c b/src/legacy/e_date.c
similarity index 100%
rename from src/e_date.c
rename to src/legacy/e_date.c
diff --git a/src/e_date.h b/src/legacy/e_date.h
similarity index 100%
rename from src/e_date.h
rename to src/legacy/e_date.h
diff --git a/src/gsm_color_button.c b/src/legacy/gsm_color_button.c
similarity index 100%
rename from src/gsm_color_button.c
rename to src/legacy/gsm_color_button.c
diff --git a/src/gsm_color_button.h b/src/legacy/gsm_color_button.h
similarity index 100%
rename from src/gsm_color_button.h
rename to src/legacy/gsm_color_button.h
diff --git a/src/treeview.c b/src/legacy/treeview.c
similarity index 100%
rename from src/treeview.c
rename to src/legacy/treeview.c
diff --git a/src/treeview.h b/src/legacy/treeview.h
similarity index 100%
rename from src/treeview.h
rename to src/legacy/treeview.h
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 5775d43..649fa11 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -13,7 +13,7 @@
 #include "application.h"
 #include "load-graph.h"
 #include "util.h"
-#include "gsm_color_button.h"
+#include "legacy/gsm_color_button.h"
 
 
 void LoadGraph::clear_background()
diff --git a/src/load-graph.h b/src/load-graph.h
index 07f8035..3ebf708 100644
--- a/src/load-graph.h
+++ b/src/load-graph.h
@@ -5,7 +5,7 @@
 #include <glib.h>
 #include <glibtop/cpu.h>
 
-#include "gsm_color_button.h"
+#include "legacy/gsm_color_button.h"
 #include "util.h"
 
 enum
diff --git a/src/memmaps.cpp b/src/memmaps.cpp
index d789e7f..78ffd17 100644
--- a/src/memmaps.cpp
+++ b/src/memmaps.cpp
@@ -19,7 +19,7 @@ using std::string;
 #include "memmaps.h"
 #include "proctable.h"
 #include "settings-keys.h"
-#include "treeview.h"
+#include "legacy/treeview.h"
 #include "util.h"
 
 
diff --git a/src/openfiles.cpp b/src/openfiles.cpp
index 3c05b81..8875cbb 100644
--- a/src/openfiles.cpp
+++ b/src/openfiles.cpp
@@ -15,7 +15,7 @@
 #include "proctable.h"
 #include "util.h"
 #include "settings-keys.h"
-#include "treeview.h"
+#include "legacy/treeview.h"
 
 #ifndef NI_IDN
 #define NI_IDN 0
diff --git a/src/procproperties.cpp b/src/procproperties.cpp
index 02b0c1c..dd6b769 100644
--- a/src/procproperties.cpp
+++ b/src/procproperties.cpp
@@ -29,7 +29,7 @@
 #include "procproperties.h"
 #include "proctable.h"
 #include "util.h"
-#include "e_date.h"
+#include "legacy/e_date.h"
 
 enum
 {
diff --git a/src/proctable.cpp b/src/proctable.cpp
index f5439fd..6682908 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -56,7 +56,7 @@
 #include "selinux.h"
 #include "settings-keys.h"
 #include "cgroups.h"
-#include "treeview.h"
+#include "legacy/treeview.h"
 #include "systemd.h"
 
 #ifdef GDK_WINDOWING_X11
diff --git a/src/proctable.h b/src/proctable.h
index 2254d70..ff9e4fd 100644
--- a/src/proctable.h
+++ b/src/proctable.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 #include "application.h"
-#include "treeview.h"
+#include "legacy/treeview.h"
 
 enum
 {
diff --git a/src/util.cpp b/src/util.cpp
index f35f702..205c963 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -12,7 +12,7 @@
 #include "application.h"
 
 extern "C" {
-#include "e_date.h"
+#include "legacy/e_date.h"
 }
 
 


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