Skip to content

Commit

Permalink
build-sys: Cleanly split up deps of public shlib vs internals
Browse files Browse the repository at this point in the history
First, the public shared library only depends on a few
things (not the libdnf dependencies) so let's ensure we
only link it to those libraries.

And then, I realized we don't actually need the libdnf
dependencies here - I think I only added those back here
when trying vainly to keep the C unit tests working.  But
we don't have those anymore!  So we can delete the duplication
and fully rely on Cargo taking care of libdnf.

Conceptually for a static library we don't "link" it against
anything in Automake, that happens at the final stage with
the Rust linker.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Feb 4, 2021
1 parent 19c7fbb commit ae3392f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Makefile-lib.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ librpmostree_1_la_SOURCES = \

librpmostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libpriv -I$(srcdir)/src/lib \
-fvisibility=hidden '-D_RPMOSTREE_EXTERN=__attribute((visibility("default"))) extern' \
$(PKGDEP_RPMOSTREE_CFLAGS)
$(PKGDEP_LIBRPMOSTREE_CFLAGS)
librpmostree_1_la_LDFLAGS = $(AM_LDFLAGS) -version-number 1:0:0 -Bsymbolic-functions
librpmostree_1_la_LIBADD = $(PKGDEP_RPMOSTREE_LIBS) libglnx.la
librpmostree_1_la_LIBADD = $(PKGDEP_LIBRPMOSTREE_LIBS) libglnx.la

# XXX: work around clang being passed -fstack-clash-protection which it doesn't understand
# https://github.com/projectatomic/rpm-ostree/pull/1787#issuecomment-473971585
Expand Down
4 changes: 2 additions & 2 deletions Makefile-rpm-ostree.am
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ rpmostree_common_cflags = -I$(srcdir)/src/app -I$(srcdir)/src/daemon \
-DG_LOG_DOMAIN=\"rpm-ostreed\" \
-DLIBDIR=\"$(libdir)\" -DPKGLIBDIR=\"$(pkglibdir)\" \
-I $(top_srcdir)/libdnf \
$(PKGDEP_RPMOSTREE_CFLAGS)
$(PKGDEP_LIBRPMOSTREE_CFLAGS) $(PKGDEP_RPMOSTREE_CFLAGS)
rpmostree_bin_common_cflags = $(rpmostree_common_cflags)
rpmostree_common_libs = libglnx.la librpmostree-1.la librpmostreecxxrs.la $(PKGDEP_RPMOSTREE_LIBS)
rpmostree_common_libs = libglnx.la librpmostree-1.la librpmostreecxxrs.la

rpmostree_bin_common_libs = librpmostreeinternals.la $(rpmostree_common_libs)
librpmostreeinternals_la_CFLAGS = $(AM_CFLAGS) $(rpmostree_common_cflags)
Expand Down
13 changes: 5 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,12 @@ AC_SUBST([RPM_OSTREE_FEATURES])

PKG_PROG_PKG_CONFIG

# Remember to update AM_CPPFLAGS in Makefile.am when bumping GIO req.
dnl Remember to update AM_CPPFLAGS in Makefile.am when bumping GIO req.
PKG_CHECK_MODULES(PKGDEP_GIO_UNIX, [gio-unix-2.0])
# librepo libsolv etc. are libdnf dependencies
PKG_CHECK_MODULES(PKGDEP_RPMOSTREE, [gio-unix-2.0 >= 2.50.0 json-glib-1.0
ostree-1 >= 2020.7
libsystemd
polkit-gobject-1
rpm librepo libsolv libsolvext sqlite3 gpgme modulemd-2.0 json-c libcurl openssl
libarchive])
dnl These are the dependencies of the public librpmostree-1.0.0 shared library
PKG_CHECK_MODULES(PKGDEP_LIBRPMOSTREE, [gio-unix-2.0 >= 2.50.0 json-glib-1.0 ostree-1 >= 2020.7 rpm])
dnl And these additional ones are used by for the rpmostreeinternals C/C++ library
PKG_CHECK_MODULES(PKGDEP_RPMOSTREE, [polkit-gobject-1 libarchive])

dnl RHEL8.1 has old libarchive
AS_IF([pkg-config --atleast-version=3.3.3 libarchive],
Expand Down

0 comments on commit ae3392f

Please sign in to comment.