[Libosinfo] [libosinfo PATCH v2 1/2] osinfo: Create an intermediate convenience library
Fabiano Fidêncio
fidencio at redhat.com
Tue Nov 20 14:11:23 UTC 2018
Let's create libosinfo-impl.la which is nothing else than
libosinfo-1.0.la without stripping out its non-public symbols.
libosinfo-impl.la can be used to link directly against our tests (as
those may use private functions that we do *not* want to expose), while
the "official" one (libosinfo-1.0.la) will remain the same.
Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
osinfo/Makefile.am | 48 ++++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am
index 058653a..60b601f 100644
--- a/osinfo/Makefile.am
+++ b/osinfo/Makefile.am
@@ -24,9 +24,9 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libosinfo-1.0.pc
-lib_LTLIBRARIES = libosinfo-1.0.la
+noinst_LTLIBRARIES = libosinfo-impl.la
-libosinfo_1_0_la_CFLAGS = \
+libosinfo_impl_la_CFLAGS = \
$(WARN_CFLAGS) \
$(COVERAGE_CFLAGS) \
-I$(top_srcdir) \
@@ -42,24 +42,16 @@ libosinfo_1_0_la_CFLAGS = \
-DLOCALEDIR="\"$(datadir)/locale\"" \
$(NULL)
-libosinfo_1_0_la_LIBADD = \
+libosinfo_impl_la_LIBADD = \
$(LIBXML_LIBS) \
$(LIBXSLT_LIBS) \
$(GOBJECT_LIBS) \
$(GLIB_LIBS) \
$(GIO_LIBS)
-libosinfo_1_0_la_LDFLAGS = \
- $(COVERAGE_LDFLAGS) \
- $(VERSION_SCRIPT_FLAGS)$(LIBOSINFO_VERSION_FILE) \
- -version-info $(LIBOSINFO_VERSION_INFO) \
- $(NO_UNDEFINED_FLAGS)
-
-libosinfo_1_0_la_DEPENDENCIES = libosinfo.syms
+libosinfo_impl_includedir = $(includedir)/libosinfo-1.0/osinfo
-libosinfo_1_0_includedir = $(includedir)/libosinfo-1.0/osinfo
-
-libosinfo_1_0_include_HEADERS = \
+libosinfo_impl_include_HEADERS = \
osinfo.h \
osinfo_avatar_format.h \
osinfo_db.h \
@@ -100,7 +92,7 @@ libosinfo_1_0_include_HEADERS = \
osinfo_treelist.h \
$(NULL)
-nodist_libosinfo_1_0_include_HEADERS = \
+nodist_libosinfo_impl_include_HEADERS = \
osinfo_version.h \
osinfo_enum_types.h \
$(NULL)
@@ -155,21 +147,35 @@ libosinfo_private_header_files = \
ignore-value.h \
$(NULL)
-libosinfo_1_0_la_SOURCES = \
+libosinfo_impl_la_SOURCES = \
$(libosinfo_c_files) \
$(libosinfo_private_header_files) \
$(NULL)
-nodist_libosinfo_1_0_la_SOURCES = \
+nodist_libosinfo_impl_la_SOURCES = \
osinfo_enum_types.c \
$(NULL)
+lib_LTLIBRARIES = libosinfo-1.0.la
+
+libosinfo_1_0_la_SOURCES =
+
+libosinfo_1_0_la_LIBADD = libosinfo-impl.la
+libosinfo_1_0_la_LIBADD += $(libosinfo_impl_la_LIBADD)
+
+libosinfo_1_0_la_LDFLAGS = \
+ $(COVERAGE_LDFLAGS) \
+ $(VERSION_SCRIPT_FLAGS)$(LIBOSINFO_VERSION_FILE) \
+ -version-info $(LIBOSINFO_VERSION_INFO) \
+ $(NO_UNDEFINED_FLAGS)
+
+libosinfo_1_0_la_DEPENDENCIES = libosinfo.syms libosinfo-impl.la
-osinfo_enum_types.h: $(libosinfo_1_0_include_HEADERS) osinfo_enum_types.h.template
- $(AM_V_GEN) ( LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 $(GLIB_MKENUMS) --template $(srcdir)/osinfo_enum_types.h.template $(libosinfo_1_0_include_HEADERS:%=$(srcdir)/%) ) > $@
+osinfo_enum_types.h: $(libosinfo_impl_include_HEADERS) osinfo_enum_types.h.template
+ $(AM_V_GEN) ( LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 $(GLIB_MKENUMS) --template $(srcdir)/osinfo_enum_types.h.template $(libosinfo_impl_include_HEADERS:%=$(srcdir)/%) ) > $@
osinfo_enum_types.c: $(OSINFO_HEADER_FILES) osinfo_enum_types.c.template osinfo_enum_types.h
- $(AM_V_GEN) ( LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 $(GLIB_MKENUMS) --template $(srcdir)/osinfo_enum_types.c.template $(libosinfo_1_0_include_HEADERS:%=$(srcdir)/%) ) > $@
+ $(AM_V_GEN) ( LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 $(GLIB_MKENUMS) --template $(srcdir)/osinfo_enum_types.c.template $(libosinfo_impl_include_HEADERS:%=$(srcdir)/%) ) > $@
DISTCLEANFILES += \
osinfo_enum_types.c \
@@ -203,8 +209,8 @@ Libosinfo_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 libxml2-2.0
Libosinfo_1_0_gir_PACKAGES = gobject-2.0 gio-2.0 libxml-2.0 libxslt
Libosinfo_1_0_gir_EXPORT_PACKAGES = libosinfo-1.0
Libosinfo_1_0_gir_LIBS = libosinfo-1.0.la
-Libosinfo_1_0_gir_FILES = $(libosinfo_1_0_include_HEADERS) $(nodist_libosinfo_1_0_include_HEADERS) $(libosinfo_c_files) $(nodist_libosinfo_1_0_la_SOURCES)
-Libosinfo_1_0_gir_CFLAGS = $(libosinfo_1_0_la_CFLAGS)
+Libosinfo_1_0_gir_FILES = $(libosinfo_impl_include_HEADERS) $(nodist_libosinfo_impl_include_HEADERS) $(libosinfo_c_files) $(nodist_libosinfo_impl_la_SOURCES)
+Libosinfo_1_0_gir_CFLAGS = $(libosinfo_impl_la_CFLAGS)
Libosinfo_1_0_gir_SCANNERFLAGS = --identifier-prefix=Osinfo --symbol-prefix=osinfo --c-include="osinfo/osinfo.h"
INTROSPECTION_GIRS += Libosinfo-1.0.gir
--
2.19.1
More information about the Libosinfo
mailing list