[tepl] amtk: make it a real shared library
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tepl] amtk: make it a real shared library
- Date: Fri, 14 Jul 2017 14:02:39 +0000 (UTC)
commit ced379728173434f1e8e43e361a3075d5e978d8a
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Jul 14 13:28:04 2017 +0200
amtk: make it a real shared library
There are problems with the GIR, when using it in Vala (in LaTeXila) it
doesn't work.
I think it'll be simpler to have two shared libraries. But I don't want
to create yet another git repository.
Also, by having a separate shared library, other apps will be able to
use Amtk without depending on GtkSourceView, uchardet, etc.
Makefile.am | 8 ++++++--
amtk.pc.in | 12 ++++++++++++
amtk/Makefile.am | 36 ++++++++++++++++++++++++++++--------
configure.ac | 1 +
docs/reference/Makefile.am | 1 +
tepl/Makefile.am | 11 +++++++----
tests/Makefile.am | 2 +-
testsuite/Makefile.am | 2 +-
8 files changed, 57 insertions(+), 16 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index fc49cf6..0a44b0f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,12 +4,16 @@ SUBDIRS = po amtk tepl tests testsuite docs
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
-pkgconfig_DATA = tepl-$(TEPL_API_VERSION).pc
+pkgconfig_DATA = \
+ amtk-$(TEPL_API_VERSION).pc \
+ tepl-$(TEPL_API_VERSION).pc
+
DISTCLEANFILES = $(pkgconfig_DATA)
EXTRA_DIST = \
- tepl.doap \
+ amtk.pc.in \
tepl.pc.in \
+ tepl.doap \
HACKING
MAINTAINERCLEANFILES = \
diff --git a/amtk.pc.in b/amtk.pc.in
new file mode 100644
index 0000000..17071b8
--- /dev/null
+++ b/amtk.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Amtk
+Description: Actions, Menus and Toolbars Kit
+Version: @PACKAGE_VERSION@
+Requires: @AX_PACKAGE_REQUIRES@
+Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
+Libs: -L${libdir} -lamtk-@TEPL_API_VERSION@
+Cflags: -I${includedir}/amtk-@TEPL_API_VERSION@
diff --git a/amtk/Makefile.am b/amtk/Makefile.am
index b61d0a9..74a09ed 100644
--- a/amtk/Makefile.am
+++ b/amtk/Makefile.am
@@ -31,23 +31,40 @@ amtk_public_c_files = \
amtk-menu-shell.c \
amtk-utils.c
-noinst_LTLIBRARIES = libamtk.la
+# Helper Libtool library, so that the private functions can be used in unit
+# tests.
+noinst_LTLIBRARIES = libamtk-core.la
-libamtk_la_SOURCES = \
+libamtk_core_la_SOURCES = \
$(amtk_public_c_files) \
$(amtk_public_headers)
-libamtk_la_CFLAGS = \
+libamtk_core_la_CFLAGS = \
$(CODE_COVERAGE_CFLAGS)
-libamtk_la_LDFLAGS = \
+libamtk_core_la_LDFLAGS = \
-no-undefined \
$(WARN_LDFLAGS)
-libamtk_la_LIBADD = \
+libamtk_core_la_LIBADD = \
$(CODE_COVERAGE_LIBS)
-libamtk_includedir = $(includedir)/tepl-@TEPL_API_VERSION@/amtk
+# The real library.
+lib_LTLIBRARIES = libamtk-@TEPL_API_VERSION@.la
+
+libamtk_@TEPL_API_VERSION@_la_SOURCES =
+
+libamtk_@TEPL_API_VERSION@_la_LIBADD = \
+ libamtk-core.la \
+ $(DEP_LIBS)
+
+libamtk_@TEPL_API_VERSION@_la_LDFLAGS = \
+ -version-info $(TEPL_LT_VERSION) \
+ -no-undefined \
+ -export-symbols-regex "^amtk_.*" \
+ $(WARN_LDFLAGS)
+
+libamtk_includedir = $(includedir)/amtk-@TEPL_API_VERSION@/amtk
libamtk_include_HEADERS = $(amtk_public_headers)
CLEANFILES =
@@ -58,23 +75,26 @@ INTROSPECTION_GIRS = Amtk-@TEPL_API_VERSION@.gir
INTROSPECTION_SCANNER_ENV = CC="$(CC)"
-Amtk-@TEPL_API_VERSION@.gir: libamtk.la
+Amtk-@TEPL_API_VERSION@.gir: libamtk-@TEPL_API_VERSION@.la
+
INTROSPECTION_SCANNER_ARGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
--c-include=amtk/amtk.h \
--warn-all
+
Amtk_@TEPL_API_VERSION@_gir_NAMESPACE = Amtk
Amtk_@TEPL_API_VERSION@_gir_VERSION = @TEPL_API_VERSION@
Amtk_@TEPL_API_VERSION@_gir_CFLAGS = $(DEP_CFLAGS)
Amtk_@TEPL_API_VERSION@_gir_SCANNERFLAGS = $(WARN_SCANNERFLAGS)
-Amtk_@TEPL_API_VERSION@_gir_LIBS = libamtk.la
+Amtk_@TEPL_API_VERSION@_gir_LIBS = libamtk-@TEPL_API_VERSION@.la
Amtk_@TEPL_API_VERSION@_gir_FILES = \
$(amtk_public_headers) \
$(amtk_public_c_files)
Amtk_@TEPL_API_VERSION@_gir_INCLUDES = Gtk-3.0
Amtk_@TEPL_API_VERSION@_gir_PACKAGES = gtk+-3.0
+Amtk_@TEPL_API_VERSION@_gir_EXPORT_PACKAGES = amtk-@TEPL_API_VERSION@
girdir = $(datadir)/gir-1.0
gir_DATA = Amtk-@TEPL_API_VERSION@.gir
diff --git a/configure.ac b/configure.ac
index 8f0d595..aefcf91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,7 @@ PKG_CHECK_VAR([GLIB_PREFIX], [glib-2.0], [prefix])
# Output files
AC_CONFIG_FILES([
+ amtk-${TEPL_API_VERSION}.pc:amtk.pc.in
tepl-${TEPL_API_VERSION}.pc:tepl.pc.in
Makefile
amtk/Makefile
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 92799de..13463e2 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -53,6 +53,7 @@ FIXXREF_OPTIONS =
# signals and properties.
GTKDOC_CFLAGS = -I$(top_srcdir) $(DEP_CFLAGS)
GTKDOC_LIBS = \
+ $(top_builddir)/amtk/libamtk-@TEPL_API_VERSION@.la \
$(top_builddir)/tepl/libtepl-@TEPL_API_VERSION@.la \
$(DEP_LIBS)
diff --git a/tepl/Makefile.am b/tepl/Makefile.am
index b68feba..39c35cb 100644
--- a/tepl/Makefile.am
+++ b/tepl/Makefile.am
@@ -122,15 +122,15 @@ lib_LTLIBRARIES = libtepl-@TEPL_API_VERSION@.la
libtepl_@TEPL_API_VERSION@_la_SOURCES =
-libtepl_@TEPL_API_VERSION@_la_LIBADD = \
- $(top_builddir)/amtk/libamtk.la \
- libtepl-core.la \
+libtepl_@TEPL_API_VERSION@_la_LIBADD = \
+ libtepl-core.la \
+ $(top_builddir)/amtk/libamtk-@TEPL_API_VERSION@.la \
$(DEP_LIBS)
libtepl_@TEPL_API_VERSION@_la_LDFLAGS = \
-version-info $(TEPL_LT_VERSION) \
-no-undefined \
- -export-symbols-regex "^(tepl|amtk)_.*" \
+ -export-symbols-regex "^tepl_.*" \
$(WARN_LDFLAGS)
libtepl_includedir = $(includedir)/tepl-@TEPL_API_VERSION@/tepl
@@ -180,6 +180,9 @@ Tepl_@TEPL_API_VERSION@_gir_FILES = \
$(tepl_built_public_headers) \
$(tepl_built_public_c_files)
+# FIXME: list Amtk too?
+#Tepl_@TEPL_API_VERSION@_gir_INCLUDES = Gtk-3.0 GtkSource-3.0 Amtk-@TEPL_API_VERSION@
+#Tepl_@TEPL_API_VERSION@_gir_PACKAGES = gtk+-3.0 gtksourceview-3.0 amtk-@TEPL_API_VERSION@
Tepl_@TEPL_API_VERSION@_gir_INCLUDES = Gtk-3.0 GtkSource-3.0
Tepl_@TEPL_API_VERSION@_gir_PACKAGES = gtk+-3.0 gtksourceview-3.0
Tepl_@TEPL_API_VERSION@_gir_EXPORT_PACKAGES = tepl-@TEPL_API_VERSION@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3057a72..cf91e19 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS = \
AM_LDFLAGS = $(WARN_LDFLAGS)
LDADD = $(top_builddir)/tepl/libtepl-core.la \
- $(top_builddir)/amtk/libamtk.la \
+ $(top_builddir)/amtk/libamtk-core.la \
$(DEP_LIBS)
noinst_PROGRAMS = $(TEST_PROGS)
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index e2775f3..35422c4 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -18,7 +18,7 @@ AM_CPPFLAGS = \
AM_LDFLAGS = $(WARN_LDFLAGS)
LDADD = $(top_builddir)/tepl/libtepl-core.la \
- $(top_builddir)/amtk/libamtk.la \
+ $(top_builddir)/amtk/libamtk-core.la \
$(DEP_LIBS)
noinst_PROGRAMS = $(UNIT_TEST_PROGS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]