[gjs: 16/26] build: Build modules into libgjs



commit e80ff83383062709ae30f47ac0c01e016e201d4a
Author: Philip Chimento <philip chimento gmail com>
Date:   Thu Mar 21 21:30:22 2019 -0700

    build: Build modules into libgjs
    
    The built-in modules (imports.system, imports.console, imports.cairo)
    were previously built as convenience libraries, and then linked into
    libgjs. There is really no reason to do this, we can just treat their
    source files as libgjs source files and build them directly into the
    library.

 Makefile-modules.am | 43 -------------------------------------------
 Makefile.am         | 32 ++++++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 45 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9f9477ff..b0dcac68 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,6 +36,7 @@ gjs_public_includedir = $(includedir)/gjs-1.0
 
 ########################################################################
 include gjs-srcs.mk
+include gjs-modules-srcs.mk
 ########################################################################
 nobase_gjs_public_include_HEADERS = $(gjs_public_headers)
 
@@ -71,7 +72,9 @@ libgjs_la_LDFLAGS =                   \
        $(NO_UNDEFINED_FLAG)            \
        $(NULL)
 libgjs_la_LIBADD =             \
-       $(GJS_LIBS)
+       $(GJS_LIBS)             \
+       $(READLINE_LIBS)        \
+       $(NULL)
 
 if ENABLE_GTK
 libgjs_la_CPPFLAGS += $(GJS_GTK_CFLAGS)
@@ -97,6 +100,32 @@ endif
 
 libgjs_la_SOURCES += $(libgjs_private_source_files)
 
+# The built-in modules also used to be compiled separately
+
+modules_resource_files := $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/modules/modules.gresource.xml)
+modules-resources.h: $(srcdir)/modules/modules.gresource.xml $(modules_resource_files)
+       $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name modules_resources $<
+modules-resources.c: $(srcdir)/modules/modules.gresource.xml $(modules_resource_files)
+       $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name modules_resources $<
+
+EXTRA_DIST += $(modules_resource_files) $(srcdir)/modules/modules.gresource.xml
+
+modules_source_files =         \
+       $(module_resource_srcs) \
+       $(module_system_srcs)   \
+       $(module_console_srcs)  \
+       $(NULL)
+
+if ENABLE_CAIRO
+modules_source_files += $(module_cairo_srcs)
+libgjs_la_CPPFLAGS += $(GJS_CAIRO_CFLAGS) $(GJS_CAIRO_XLIB_CFLAGS)
+libgjs_la_LIBADD += $(GJS_CAIRO_LIBS) $(GJS_CAIRO_XLIB_LIBS)
+endif
+
+CLEANFILES += $(module_resource_srcs)
+
+libgjs_la_SOURCES += $(modules_source_files)
+
 GjsPrivate-1.0.gir: libgjs.la
 GjsPrivate_1_0_gir_LIBS = libgjs.la
 GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
@@ -135,7 +164,6 @@ tapsetdir   = $(datadir)/systemtap/tapset
 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
 endif
 
-include Makefile-modules.am
 include Makefile-examples.am
 
 typelibdir = $(pkglibdir)/girepository-1.0


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