[latexila] Autotools: compile GResources
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Autotools: compile GResources
- Date: Tue, 4 Sep 2012 20:02:54 +0000 (UTC)
commit 9fb26b562c6159e43afa621569822df7cdc8e144
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Wed Aug 29 23:27:24 2012 +0200
Autotools: compile GResources
The generated .c are compiled as a static library, which is added to the
main executable.
Makefile.am | 2 +
configure.ac | 5 +
src/Makefile.am | 5 +
src/resources/Makefile.am | 108 ++++++++++++++++++++
.../resources}/stock-icons.gresource.xml | 0
.../resources}/symbols-arrows.gresource.xml | 0
.../resources}/symbols-delimiters.gresource.xml | 0
.../resources}/symbols-greek.gresource.xml | 0
.../resources}/symbols-misc-math.gresource.xml | 0
.../resources}/symbols-misc-text.gresource.xml | 0
.../resources}/symbols-operators.gresource.xml | 0
.../resources}/symbols-relations.gresource.xml | 0
12 files changed, 120 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index af437a6..f8238b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1,3 @@
+ACLOCAL_AMFLAGS = -I m4
+
SUBDIRS = src
diff --git a/configure.ac b/configure.ac
index 21201cc..37a6572 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,10 @@ AM_INIT_AUTOMAKE([1.11 foreign tar-ustar no-dist-gzip dist-xz])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
+# Init Libtool
+LT_PREREQ([2.2])
+LT_INIT
+
# Required dependencies versions
GLIB_REQUIRED_VERSION="2.32"
GTK_REQUIRED_VERSION="3.4.3"
@@ -84,6 +88,7 @@ AC_DEFINE([DESKTOP_SCHEMAS],
# Generate files
AC_CONFIG_FILES([Makefile
src/Makefile
+ src/resources/Makefile
README
INSTALL])
diff --git a/src/Makefile.am b/src/Makefile.am
index 0d94522..a78b98f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = resources
+
bin_PROGRAMS = latexila
VALAFLAGS = \
@@ -69,8 +71,11 @@ latexila_SOURCES = \
latexila_CPPFLAGS = \
-I$(top_srcdir) \
-I$(srcdir)/gedit \
+ -I$(srcdir)/resources \
$(LATEXILA_CFLAGS)
latexila_LDFLAGS = $(LATEXILA_LIBS)
+latexila_LDADD = resources/libresources.la
+
INCLUDES = -include config.h
diff --git a/src/resources/Makefile.am b/src/resources/Makefile.am
new file mode 100644
index 0000000..1254ec9
--- /dev/null
+++ b/src/resources/Makefile.am
@@ -0,0 +1,108 @@
+noinst_LTLIBRARIES = libresources.la
+
+libresources_la_CPPFLAGS = $(LATEXILA_CFLAGS)
+libresources_la_LDFLAGS = $(LATEXILA_LIBS)
+
+# Stock icons
+
+res1 = stock-icons-resources.c
+xml1 = $(srcdir)/stock-icons.gresource.xml
+dir1 = $(top_srcdir)/data/images/stock-icons
+
+nodist_libresources_la_SOURCES = $(res1)
+CLEANFILES = $(res1)
+libresources.$(OBJEXT): $(res1)
+
+$(res1): $(xml1) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir1) --generate-dependencies $(xml1))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir1) --generate-source $(xml1)
+
+# Arrows symbols
+
+res2 = symbols-arrows-resources.c
+xml2 = $(srcdir)/symbols-arrows.gresource.xml
+dir2 = $(top_srcdir)/data/images/arrows
+
+nodist_libresources_la_SOURCES += $(res2)
+CLEANFILES += $(res2)
+libresources.$(OBJEXT): $(res2)
+
+$(res2): $(xml2) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir2) --generate-dependencies $(xml2))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir2) --generate-source $(xml2)
+
+# Delimiters symbols
+
+res3 = symbols-delimiters-resources.c
+xml3 = $(srcdir)/symbols-delimiters.gresource.xml
+dir3 = $(top_srcdir)/data/images/delimiters
+
+nodist_libresources_la_SOURCES += $(res3)
+CLEANFILES += $(res3)
+libresources.$(OBJEXT): $(res3)
+
+$(res3): $(xml3) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir3) --generate-dependencies $(xml3))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir3) --generate-source $(xml3)
+
+# Greek symbols
+
+res4 = symbols-greek-resources.c
+xml4 = $(srcdir)/symbols-greek.gresource.xml
+dir4 = $(top_srcdir)/data/images/greek
+
+nodist_libresources_la_SOURCES += $(res4)
+CLEANFILES += $(res4)
+libresources.$(OBJEXT): $(res4)
+
+$(res4): $(xml4) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir4) --generate-dependencies $(xml4))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir4) --generate-source $(xml4)
+
+# Misc math symbols
+
+res5 = symbols-misc-math-resources.c
+xml5 = $(srcdir)/symbols-misc-math.gresource.xml
+dir5 = $(top_srcdir)/data/images/misc-math
+
+nodist_libresources_la_SOURCES += $(res5)
+CLEANFILES += $(res5)
+libresources.$(OBJEXT): $(res5)
+
+$(res5): $(xml5) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir5) --generate-dependencies $(xml5))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir5) --generate-source $(xml5)
+
+# Misc text symbols
+
+res6 = symbols-misc-text-resources.c
+xml6 = $(srcdir)/symbols-misc-text.gresource.xml
+dir6 = $(top_srcdir)/data/images/misc-text
+
+nodist_libresources_la_SOURCES += $(res6)
+CLEANFILES += $(res6)
+libresources.$(OBJEXT): $(res6)
+
+$(res6): $(xml6) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir6) --generate-dependencies $(xml6))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir6) --generate-source $(xml6)
+
+# Operators symbols
+
+res7 = symbols-operators-resources.c
+xml7 = $(srcdir)/symbols-operators.gresource.xml
+dir7 = $(top_srcdir)/data/images/operators
+
+nodist_libresources_la_SOURCES += $(res7)
+CLEANFILES += $(res7)
+libresources.$(OBJEXT): $(res7)
+
+$(res7): $(xml7) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir7) --generate-dependencies $(xml7))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir7) --generate-source $(xml7)
+
+# Relations symbols
+
+res8 = symbols-relations-resources.c
+xml8 = $(srcdir)/symbols-relations.gresource.xml
+dir8 = $(top_srcdir)/data/images/relations
+
+nodist_libresources_la_SOURCES += $(res8)
+CLEANFILES += $(res8)
+libresources.$(OBJEXT): $(res8)
+
+$(res8): $(xml8) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(dir8) --generate-dependencies $(xml8))
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(dir8) --generate-source $(xml8)
diff --git a/data/images/stock-icons/stock-icons.gresource.xml b/src/resources/stock-icons.gresource.xml
similarity index 100%
rename from data/images/stock-icons/stock-icons.gresource.xml
rename to src/resources/stock-icons.gresource.xml
diff --git a/data/images/arrows/symbols-arrows.gresource.xml b/src/resources/symbols-arrows.gresource.xml
similarity index 100%
rename from data/images/arrows/symbols-arrows.gresource.xml
rename to src/resources/symbols-arrows.gresource.xml
diff --git a/data/images/delimiters/symbols-delimiters.gresource.xml b/src/resources/symbols-delimiters.gresource.xml
similarity index 100%
rename from data/images/delimiters/symbols-delimiters.gresource.xml
rename to src/resources/symbols-delimiters.gresource.xml
diff --git a/data/images/greek/symbols-greek.gresource.xml b/src/resources/symbols-greek.gresource.xml
similarity index 100%
rename from data/images/greek/symbols-greek.gresource.xml
rename to src/resources/symbols-greek.gresource.xml
diff --git a/data/images/misc-math/symbols-misc-math.gresource.xml b/src/resources/symbols-misc-math.gresource.xml
similarity index 100%
rename from data/images/misc-math/symbols-misc-math.gresource.xml
rename to src/resources/symbols-misc-math.gresource.xml
diff --git a/data/images/misc-text/symbols-misc-text.gresource.xml b/src/resources/symbols-misc-text.gresource.xml
similarity index 100%
rename from data/images/misc-text/symbols-misc-text.gresource.xml
rename to src/resources/symbols-misc-text.gresource.xml
diff --git a/data/images/operators/symbols-operators.gresource.xml b/src/resources/symbols-operators.gresource.xml
similarity index 100%
rename from data/images/operators/symbols-operators.gresource.xml
rename to src/resources/symbols-operators.gresource.xml
diff --git a/data/images/relations/symbols-relations.gresource.xml b/src/resources/symbols-relations.gresource.xml
similarity index 100%
rename from data/images/relations/symbols-relations.gresource.xml
rename to src/resources/symbols-relations.gresource.xml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]