ostree/Makefile-libostree.am

312 lines
11 KiB
Plaintext
Raw Normal View History

2011-11-02 23:45:32 +04:00
# Makefile for C source code
#
# Copyright (C) 2011,2014 Colin Walters <walters@verbum.org>
2011-11-02 23:45:32 +04:00
#
# SPDX-License-Identifier: LGPL-2.0+
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
2011-11-02 23:45:32 +04:00
#
# This library is distributed in the hope that it will be useful,
2011-11-02 23:45:32 +04:00
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
2011-11-02 23:45:32 +04:00
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
2011-11-02 23:45:32 +04:00
include Makefile-libostree-defines.am
bupsplitpath = libbupsplit.la
noinst_LTLIBRARIES += libbupsplit.la
libbupsplit_la_SOURCES = src/libostree/bupsplit.h src/libostree/bupsplit.c
lib_LTLIBRARIES += libostree-1.la
2011-11-02 23:45:32 +04:00
libostreeincludedir = $(includedir)/ostree-1
libostreeinclude_HEADERS = $(libostree_public_headers) $(libostree_public_built_headers)
ENUM_TYPES = $(NULL)
ENUM_TYPES += $(srcdir)/src/libostree/ostree-fetcher.h
# TODO: GLIB_CHECK_VERSION > 2.5x: use --output instead of mv (see https://github.com/ostreedev/ostree/pull/1329)
src/libostree/ostree-enumtypes.h: src/libostree/ostree-enumtypes.h.template $(ENUM_TYPES)
$(AM_V_GEN) $(GLIB_MKENUMS) \
--template $< \
$(ENUM_TYPES) > $@.tmp && mv $@.tmp $@
src/libostree/ostree-enumtypes.c: src/libostree/ostree-enumtypes.c.template src/libostree/ostree-enumtypes.h $(ENUM_TYPES)
$(AM_V_GEN) $(GLIB_MKENUMS) \
--template $< \
$(ENUM_TYPES) > $@.tmp && mv $@.tmp $@
nodist_libostree_1_la_SOURCES = \
src/libostree/ostree-enumtypes.h \
src/libostree/ostree-enumtypes.c \
$(NULL)
BUILT_SOURCES += $(nodist_libostree_1_la_SOURCES)
CLEANFILES += $(BUILT_SOURCES)
libostree_1_la_SOURCES = \
src/libostree/ostree-async-progress.c \
src/libostree/ostree-cmdprivate.h \
src/libostree/ostree-cmdprivate.c \
2013-10-16 00:30:09 +04:00
src/libostree/ostree-core-private.h \
src/libostree/ostree-core.c \
src/libostree/ostree-date-utils.c \
src/libostree/ostree-date-utils-private.h \
src/libostree/ostree-dummy-enumtypes.c \
src/libostree/ostree-checksum-input-stream.c \
src/libostree/ostree-checksum-input-stream.h \
src/libostree/ostree-chain-input-stream.c \
src/libostree/ostree-chain-input-stream.h \
src/libostree/ostree-lzma-common.c \
src/libostree/ostree-lzma-common.h \
src/libostree/ostree-lzma-compressor.c \
src/libostree/ostree-lzma-compressor.h \
src/libostree/ostree-lzma-decompressor.c \
src/libostree/ostree-lzma-decompressor.h \
src/libostree/ostree-rollsum.h \
src/libostree/ostree-rollsum.c \
src/libostree/ostree-varint.h \
src/libostree/ostree-varint.c \
src/libostree/ostree-linuxfsutil.h \
src/libostree/ostree-linuxfsutil.c \
src/libostree/ostree-diff.c \
src/libostree/ostree-mutable-tree.c \
src/libostree/ostree-ref.c \
src/libostree/ostree-remote.c \
src/libostree/ostree-remote-private.h \
src/libostree/ostree-repo-os.c \
src/libostree/ostree-repo.c \
src/libostree/ostree-repo-checkout.c \
src/libostree/ostree-repo-commit.c \
src/libostree/ostree-repo-pull.c \
src/libostree/ostree-repo-pull-private.h \
src/libostree/ostree-repo-pull-verify.c \
2013-07-10 03:11:37 +04:00
src/libostree/ostree-repo-libarchive.c \
src/libostree/ostree-repo-prune.c \
src/libostree/ostree-repo-refs.c \
src/libostree/ostree-repo-verity.c \
src/libostree/ostree-repo-traverse.c \
src/libostree/ostree-repo-private.h \
src/libostree/ostree-repo-file.c \
src/libostree/ostree-repo-file-enumerator.c \
src/libostree/ostree-repo-file-enumerator.h \
src/libostree/ostree-sepolicy.c \
src/libostree/ostree-sepolicy-private.h \
src/libostree/ostree-sysroot-private.h \
src/libostree/ostree-sysroot.c \
src/libostree/ostree-sysroot-cleanup.c \
src/libostree/ostree-sysroot-deploy.c \
src/libostree/ostree-sysroot-upgrader.c \
src/libostree/ostree-impl-system-generator.c \
src/libostree/ostree-bootconfig-parser.c \
src/libostree/ostree-deployment.c \
src/libostree/ostree-bootloader.h \
src/libostree/ostree-bootloader.c \
src/libostree/ostree-bootloader-grub2.h \
src/libostree/ostree-bootloader-grub2.c \
src/libostree/ostree-bootloader-zipl.h \
src/libostree/ostree-bootloader-zipl.c \
src/libostree/ostree-bootloader-syslinux.h \
src/libostree/ostree-bootloader-syslinux.c \
src/libostree/ostree-bootloader-uboot.h \
src/libostree/ostree-bootloader-uboot.c \
src/libostree/ostree-repo-static-delta-core.c \
src/libostree/ostree-repo-static-delta-processing.c \
src/libostree/ostree-repo-static-delta-compilation.c \
src/libostree/ostree-repo-static-delta-compilation-analysis.c \
src/libostree/ostree-repo-static-delta-private.h \
src/libostree/ostree-autocleanups.h \
src/libostree/ostree-bloom.c \
src/libostree/ostree-bloom-private.h \
src/libostree/ostree-repo-finder.c \
src/libostree/ostree-repo-finder-avahi.c \
src/libostree/ostree-repo-finder-config.c \
src/libostree/ostree-repo-finder-mount.c \
src/libostree/ostree-repo-finder-override.c \
src/libostree/ostree-kernel-args.h \
src/libostree/ostree-kernel-args.c \
2011-11-02 23:45:32 +04:00
$(NULL)
if USE_LIBARCHIVE
libostree_1_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
src/libostree/ostree-libarchive-input-stream.c \
src/libostree/ostree-libarchive-private.h \
$(NULL)
endif
if HAVE_LIBSOUP_CLIENT_CERTS
libostree_1_la_SOURCES += \
src/libostree/ostree-tls-cert-interaction.c \
src/libostree/ostree-tls-cert-interaction.h \
$(NULL)
endif
libostree_experimental_headers = \
$(NULL)
if !ENABLE_EXPERIMENTAL_API
libostree_1_la_SOURCES += $(libostree_experimental_headers)
else # if ENABLE_EXPERIMENTAL_API
libostree_1_la_SOURCES += \
$(NULL)
endif
if USE_AVAHI
libostree_1_la_SOURCES += \
src/libostree/ostree-repo-finder-avahi-parser.c \
src/libostree/ostree-repo-finder-avahi-private.h \
$(NULL)
endif # USE_AVAHI
if USE_GPGME
libostree_1_la_SOURCES += \
src/libostree/ostree-gpg-verifier.c \
src/libostree/ostree-gpg-verifier.h \
src/libostree/ostree-gpg-verify-result.c \
src/libostree/ostree-gpg-verify-result-private.h \
$(NULL)
else
libostree_1_la_SOURCES += \
src/libostree/ostree-gpg-verify-result-dummy.c \
$(NULL)
endif # USE_GPGME
symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym
2020-11-17 13:14:16 +03:00
# Uncomment this include when adding new development symbols.
2021-03-20 00:53:37 +03:00
#if BUILDOPT_IS_DEVEL_BUILD
#symbol_files += $(top_srcdir)/src/libostree/libostree-devel.sym
#endif
2020-11-17 13:14:16 +03:00
# http://blog.jgc.org/2007/06/escaping-comma-and-space-in-gnu-make.html
wl_versionscript_arg = -Wl,--version-script=
EXTRA_DIST += \
$(top_srcdir)/src/libostree/libostree-devel.sym \
$(top_srcdir)/src/libostree/libostree-released.sym \
$(NULL)
libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(builddir)/src/libostree \
$(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS) $(OT_DEP_LZMA_CFLAGS) $(OT_DEP_ZLIB_CFLAGS) $(OT_DEP_CRYPTO_CFLAGS) \
-fvisibility=hidden '-D_OSTREE_PUBLIC=__attribute__((visibility("default"))) extern'
libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions $(addprefix $(wl_versionscript_arg),$(symbol_files))
libostree_1_la_LIBADD = libotutil.la libglnx.la libbsdiff.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) \
$(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS) $(OT_DEP_CRYPTO_LIBS)
# Some change between rust-1.21.0-1.fc27 and rust-1.22.1-1.fc27.x86_64
libostree_1_la_LIBADD += $(bupsplitpath)
EXTRA_libostree_1_la_DEPENDENCIES = $(symbol_files)
if USE_LIBARCHIVE
libostree_1_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
endif
if USE_AVAHI
libostree_1_la_CFLAGS += $(OT_DEP_AVAHI_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_AVAHI_LIBS)
endif
build: fix systemd feature advertisement 17db0f15a798 ("configure: add option for libsystemd") exposed --without-libsystemd to allow systemd to be disabled even if the systemd pkgconfig script was present, introducing a new variable with_libsystemd; there are now three, almost identical variables: - with_libsystemd [yes, no, maybe] - controlled by --without-libsystemd, resolved into yes/no by the initial checks - have_libsystemd [yes, no, <undefined>] - only set if with_libsystemd is yes/maybe, otherwise undefined - with_systemd [yes, <undefined>] - yes if have_systemd is yes, otherwise undefined with_systemd is the earliest variable and was previously set by a set of checks for dracut and mkinitcpio. These checks were changed for a systemd check in 9e2763106be0 ("lib: Use sd_journal directly (optionally)"). This commit also introduced BUILDOPT_LIBSYSTEMD, which will always match BUILDOPT_SYSTEMD. Fix the confusion by removing with_systemd which will always be yes when with_libsystemd=yes, or undefined if with_libsystemd=no. We can ignore the with_libsystemd=maybe case because it will always be resolved into yes/no before with_systemd is set. And replace all uses of BUILDOPT_SYSTEMD with BUILDOPT_LIBSYSTEMD, since they again always match. This fixes both the advertised features and the summary output when systemd is disabled by using with_libsystemd which is always defined. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Fixes: 5c62a7e4d0a5 ("build: Expose systemd in OSTREE_FEATURES") Fixes: 17db0f15a798 ("configure: add option for libsystemd") Supersedes: #1992
2020-01-21 15:37:52 +03:00
if BUILDOPT_SYSTEMD
libostree_1_la_CFLAGS += $(LIBSYSTEMD_CFLAGS)
libostree_1_la_LIBADD += $(LIBSYSTEMD_LIBS)
endif
if USE_CURL_OR_SOUP
libostree_1_la_SOURCES += \
src/libostree/ostree-fetcher.h \
src/libostree/ostree-fetcher-util.h \
src/libostree/ostree-fetcher-util.c \
src/libostree/ostree-fetcher-uri.c \
src/libostree/ostree-metalink.h \
src/libostree/ostree-metalink.c \
$(NULL)
endif
if USE_CURL
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-curl.c \
src/libostree/ostree-soup-uri.h src/libostree/ostree-soup-uri.c \
src/libostree/ostree-soup-form.c \
$(NULL)
libostree_1_la_CFLAGS += $(OT_DEP_CURL_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_CURL_LIBS)
else
if USE_LIBSOUP
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-soup.c
libostree_1_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_1_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
else
if USE_AVAHI
libostree_1_la_SOURCES += src/libostree/ostree-soup-uri.h \
src/libostree/ostree-soup-uri.c \
src/libostree/ostree-soup-form.c \
$(NULL)
endif
endif
endif
if USE_LIBMOUNT
libostree_1_la_CFLAGS += $(OT_DEP_LIBMOUNT_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_LIBMOUNT_LIBS)
endif
if USE_SELINUX
libostree_1_la_CFLAGS += $(OT_DEP_SELINUX_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_SELINUX_LIBS)
endif
libostree_1_la_SOURCES += \
src/libostree/ostree-sign.c \
src/libostree/ostree-sign.h \
src/libostree/ostree-sign-dummy.c \
src/libostree/ostree-sign-dummy.h \
src/libostree/ostree-sign-ed25519.c \
src/libostree/ostree-sign-ed25519.h \
$(NULL)
if USE_LIBSODIUM
libostree_1_la_CFLAGS += $(OT_DEP_LIBSODIUM_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_LIBSODIUM_LIBS)
endif # USE_LIBSODIUM
# XXX: work around clang being passed -fstack-clash-protection which it doesn't understand
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1672012
INTROSPECTION_SCANNER_ENV = CC=gcc
if BUILDOPT_INTROSPECTION
OSTree-1.0.gir: libostree-1.la Makefile
OSTree_1_0_gir_EXPORT_PACKAGES = ostree-1
OSTree_1_0_gir_INCLUDES = Gio-2.0
OSTree_1_0_gir_CFLAGS = $(libostree_1_la_CFLAGS)
if ENABLE_EXPERIMENTAL_API
# When compiling this is set via config.h, but g-ir-scanner can't use that
OSTree_1_0_gir_CFLAGS += -DOSTREE_ENABLE_EXPERIMENTAL_API=1
endif
OSTree_1_0_gir_LIBS = libostree-1.la
OSTree_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Ostree --symbol-prefix=ostree $(GI_SCANNERFLAGS)
OSTree_1_0_gir_FILES = $(libostreeinclude_HEADERS) $(filter-out %-private.h %/ostree-soup-uri.h $(libostree_experimental_headers),$(libostree_1_la_SOURCES))
INTROSPECTION_GIRS += OSTree-1.0.gir
gir_DATA += OSTree-1.0.gir
typelib_DATA += OSTree-1.0.typelib
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
pkgconfig_DATA += src/libostree/ostree-1.pc
gpgreadme_DATA = src/libostree/README-gpg
gpgreadmedir = $(datadir)/ostree/trusted.gpg.d
EXTRA_DIST += src/libostree/README-gpg src/libostree/bupsplit.h \
src/libostree/ostree-enumtypes.h.template \
src/libostree/ostree-enumtypes.c.template \
src/libostree/ostree-deployment-private.h \
src/libostree/ostree-repo-deprecated.h \
src/libostree/ostree-version.h
install-mkdir-remotes-d-hook:
mkdir -p $(DESTDIR)$(sysconfdir)/ostree/remotes.d
INSTALL_DATA_HOOKS += install-mkdir-remotes-d-hook