2011-10-10 01:03:08 +04:00
AC_PREREQ([2.63])
2020-11-18 14:14:15 +03:00
dnl To perform a release, follow the instructions in `docs/CONTRIBUTING.md`.
2023-02-17 16:25:40 +03:00
m4_define([year_version], [2023])
2023-06-30 18:10:25 +03:00
m4_define([release_version], [6])
2017-03-10 20:33:52 +03:00
m4_define([package_version], [year_version.release_version])
AC_INIT([libostree], [package_version], [walters@verbum.org])
2023-06-30 18:10:25 +03:00
is_release_build=no
2011-10-10 01:03:08 +04:00
AC_CONFIG_HEADER([config.h])
2016-03-02 18:28:04 +03:00
AC_CONFIG_MACRO_DIR([buildutil])
2011-10-10 01:03:08 +04:00
AC_CONFIG_AUX_DIR([build-aux])
2015-02-02 15:00:32 +03:00
AM_INIT_AUTOMAKE([1.13 -Wno-portability foreign no-define tar-ustar no-dist-gzip dist-xz
2016-03-02 18:28:04 +03:00
color-tests subdir-objects])
2011-10-10 01:03:08 +04:00
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
2013-07-10 21:24:15 +04:00
AC_USE_SYSTEM_EXTENSIONS
2013-02-24 15:35:23 +04:00
AC_SYS_LARGEFILE
2011-10-10 01:03:08 +04:00
AC_PROG_CC
AM_PROG_CC_C_O
2015-11-25 12:37:21 +03:00
AC_PROG_YACC
2011-10-10 01:03:08 +04:00
2017-03-10 20:33:52 +03:00
dnl Versioning information
AC_SUBST([YEAR_VERSION], [year_version])
AC_SUBST([RELEASE_VERSION], [release_version])
AC_SUBST([PACKAGE_VERSION], [package_version])
2022-01-12 00:46:49 +03:00
dnl automake variables we want in pkg-config
pkglibexecdir=$libexecdir/$PACKAGE
AC_SUBST(pkglibexecdir)
2017-07-20 22:37:27 +03:00
AS_IF([echo "$CFLAGS" | grep -q -E -e '-Werror($| )'], [], [
2016-08-04 23:47:46 +03:00
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
2017-11-02 18:50:12 +03:00
-pipe \
-Wall \
2020-09-13 00:51:40 +03:00
-Werror=shadow \
2017-11-02 18:50:12 +03:00
-Werror=empty-body \
-Werror=strict-prototypes \
-Werror=missing-prototypes \
-Werror=implicit-function-declaration \
"-Werror=format=2 -Werror=format-security -Werror=format-nonliteral" \
-Werror=pointer-arith -Werror=init-self \
-Werror=missing-declarations \
-Werror=return-type \
-Werror=switch \
-Werror=overflow \
-Werror=int-conversion \
2017-12-21 21:01:44 +03:00
-Werror=parentheses \
2017-11-02 18:50:12 +03:00
-Werror=undef \
-Werror=incompatible-pointer-types \
-Werror=misleading-indentation \
2022-02-17 22:22:27 +03:00
-Werror=missing-include-dirs \
2017-12-15 17:20:58 +03:00
-Wstrict-aliasing=2 \
2017-03-28 20:29:38 +03:00
-Werror=unused-result \
2017-07-20 22:37:27 +03:00
])])
2011-11-11 15:53:44 +04:00
AC_SUBST(WARN_CFLAGS)
2011-10-14 01:11:01 +04:00
2021-02-03 17:48:49 +03:00
AC_ARG_ENABLE(sanitizers,
AS_HELP_STRING([--enable-sanitizers],
[Enable ASAN and UBSAN (default: no)]),,
[enable_sanitizers=no])
AM_CONDITIONAL(BUILDOPT_ASAN, [test x$enable_sanitizers != xno])
AM_COND_IF([BUILDOPT_ASAN], [
sanitizer_flags="-fsanitize=address -fsanitize=undefined -fsanitize-undefined-trap-on-error"
CFLAGS="$CFLAGS ${sanitizer_flags}"
CXXFLAGS="$CXXFLAGS ${sanitizer_flags}"
AC_DEFINE([BUILDOPT_ASAN], 1, [Define if we are building with asan and ubsan])
])
2017-08-04 23:18:40 +03:00
AC_MSG_CHECKING([for -fsanitize=thread in CFLAGS])
if echo $CFLAGS | grep -q -e -fsanitize=thread; then
AC_MSG_RESULT([yes])
using_tsan=yes
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(BUILDOPT_TSAN, [test x$using_tsan = xyes])
AM_COND_IF([BUILDOPT_TSAN],
[AC_DEFINE([BUILDOPT_TSAN], 1, [Define if we are building with -fsanitize=thread])])
2016-12-08 05:59:40 +03:00
2011-10-10 01:03:08 +04:00
# Initialize libtool
2011-11-30 03:25:07 +04:00
LT_PREREQ([2.2.4])
LT_INIT([disable-static])
2011-10-10 01:03:08 +04:00
2013-05-02 03:15:06 +04:00
OSTREE_FEATURES=""
AC_SUBST([OSTREE_FEATURES])
2016-03-02 18:28:04 +03:00
GLIB_TESTS
2016-06-27 04:59:12 +03:00
LIBGLNX_CONFIGURE
2013-05-01 23:26:21 +04:00
2017-11-02 18:50:12 +03:00
dnl These bits attempt to mirror https://github.com/coreutils/gnulib/blob/e369b04cca4da1534c98628b8ee4648bfca2bb3a/m4/parse-datetime.m4#L27
AC_CHECK_FUNCS([nanotime clock_gettime])
AC_STRUCT_TIMEZONE
2015-04-01 10:45:20 +03:00
AC_CHECK_HEADER([sys/xattr.h],,[AC_MSG_ERROR([You must have sys/xattr.h from glibc])])
2012-02-20 22:59:52 +04:00
2016-06-07 22:08:16 +03:00
AS_IF([test "$YACC" != "bison -y"], [AC_MSG_ERROR([bison not found but required])])
2015-12-07 18:39:37 +03:00
2011-10-10 01:03:08 +04:00
PKG_PROG_PKG_CONFIG
2017-08-12 04:17:23 +03:00
# PKG_CHECK_VAR added to pkg-config 0.28
m4_define_default(
[PKG_CHECK_VAR],
[AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
AS_IF([test -z "$$1"], [$1=`$PKG_CONFIG --variable="$3" "$2"`])
AS_IF([test -n "$$1"], [$4], [$5])])
PKG_CHECK_VAR(BASH_COMPLETIONSDIR, [bash-completion], [completionsdir], ,
2017-08-16 17:15:38 +03:00
BASH_COMPLETIONSDIR="${datadir}/bash-completion/completions")
2017-08-12 04:17:23 +03:00
AC_SUBST(BASH_COMPLETIONSDIR)
2016-12-08 21:38:49 +03:00
AM_PATH_GLIB_2_0(,,AC_MSG_ERROR([GLib not found]))
2015-11-10 03:04:42 +03:00
2016-05-13 08:59:10 +03:00
dnl When bumping the gio-unix-2.0 dependency (or glib-2.0 in general),
dnl remember to bump GLIB_VERSION_MIN_REQUIRED and
dnl GLIB_VERSION_MAX_ALLOWED in Makefile.am
2022-02-17 22:12:18 +03:00
GIO_DEPENDENCY="gio-unix-2.0 >= 2.66.0"
2014-04-22 17:08:35 +04:00
PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY)
2014-04-29 16:56:05 +04:00
dnl 5.1.0 is an arbitrary version here
2014-09-08 18:35:32 +04:00
PKG_CHECK_MODULES(OT_DEP_LZMA, liblzma >= 5.0.5)
2014-04-29 16:56:05 +04:00
2015-02-23 22:47:56 +03:00
dnl Needed for rollsum
PKG_CHECK_MODULES(OT_DEP_ZLIB, zlib)
2014-05-30 18:02:01 +04:00
dnl We're not actually linking to this, just using the header
PKG_CHECK_MODULES(OT_DEP_E2P, e2p)
2016-12-08 05:02:30 +03:00
dnl Arbitrary version that's in CentOS7.2 now
CURL_DEPENDENCY=7.29.0
AC_ARG_WITH(curl,
AS_HELP_STRING([--with-curl], [Use libcurl @<:@default=no@:>@]),
[], [with_curl=no])
AS_IF([test x$with_curl != xno ], [
PKG_CHECK_MODULES(OT_DEP_CURL, libcurl >= $CURL_DEPENDENCY)
with_curl=yes
AC_DEFINE([HAVE_LIBCURL], 1, [Define if we have libcurl.pc])
dnl Currently using libcurl requires soup for trivial-httpd for tests
with_soup_default=yes
], [with_soup_default=check])
AM_CONDITIONAL(USE_CURL, test x$with_curl != xno)
2017-02-17 18:22:43 +03:00
if test x$with_curl = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES libcurl"; fi
2017-12-13 00:04:11 +03:00
AC_ARG_ENABLE(http2,
AS_HELP_STRING([--disable-http2],
[Disable use of http2 (default: no)]),,
[enable_http2=yes])
AS_IF([test x$enable_http2 != xno ], [
2019-01-08 18:24:10 +03:00
AC_DEFINE([BUILDOPT_HTTP2], 1, [Define if we enable http2 by default])
2017-12-13 00:04:11 +03:00
], [
OSTREE_FEATURES="$OSTREE_FEATURES no-http2"
])
2016-12-08 05:02:30 +03:00
2022-02-17 22:12:18 +03:00
SOUP3_DEPENDENCY="libsoup-3.0 >= 3.0.0"
AC_ARG_WITH(soup3,
AS_HELP_STRING([--with-soup3], [Use libsoup3 @<:@default=no@:>@]),
[], [with_soup3=no])
AS_IF([test x$with_soup3 != xno], [
PKG_CHECK_MODULES(OT_DEP_SOUP3, $SOUP3_DEPENDENCY)
with_soup3=yes
AC_DEFINE([HAVE_LIBSOUP3], 1, [Define if we have libsoup3])
OSTREE_FEATURES="$OSTREE_FEATURES libsoup3"
with_soup_default=no
dnl soup3 always supports client certs
have_libsoup_client_certs=yes
], [with_soup_default=check])
AM_CONDITIONAL(USE_LIBSOUP3, test x$with_soup3 != xno)
2016-05-13 08:59:10 +03:00
dnl When bumping the libsoup-2.4 dependency, remember to bump
dnl SOUP_VERSION_MIN_REQUIRED and SOUP_VERSION_MAX_ALLOWED in
dnl Makefile.am
2014-04-22 17:08:35 +04:00
SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
AC_ARG_WITH(soup,
2012-08-14 21:11:45 +04:00
AS_HELP_STRING([--with-soup], [Use libsoup @<:@default=yes@:>@]),
2016-12-08 05:02:30 +03:00
[], [with_soup=$with_soup_default])
AS_IF([test x$with_soup != xno], [
2014-06-26 15:54:41 +04:00
AC_ARG_ENABLE(libsoup_client_certs,
AS_HELP_STRING([--enable-libsoup-client-certs],
[Require availability of new enough libsoup TLS client cert API (default: auto)]),,
[enable_libsoup_client_certs=auto])
2014-04-22 17:08:35 +04:00
AC_MSG_CHECKING([for $SOUP_DEPENDENCY])
PKG_CHECK_EXISTS($SOUP_DEPENDENCY, have_soup=yes, have_soup=no)
AC_MSG_RESULT([$have_soup])
2012-08-14 21:11:45 +04:00
AS_IF([ test x$have_soup = xno && test x$with_soup != xcheck], [
AC_MSG_ERROR([libsoup is enabled but could not be found])
2014-04-22 17:08:35 +04:00
])
AS_IF([test x$have_soup = xyes], [
PKG_CHECK_MODULES(OT_DEP_SOUP, $SOUP_DEPENDENCY)
2015-01-30 17:06:22 +03:00
AC_DEFINE([HAVE_LIBSOUP], 1, [Define if we have libsoup.pc])
2014-04-22 17:08:35 +04:00
with_soup=yes
2014-05-01 20:55:13 +04:00
save_CFLAGS=$CFLAGS
CFLAGS=$OT_DEP_SOUP_CFLAGS
have_libsoup_client_certs=no
AC_CHECK_DECL([SOUP_SESSION_TLS_INTERACTION], [
2015-01-30 17:06:22 +03:00
AC_DEFINE([HAVE_LIBSOUP_CLIENT_CERTS], 1, [Define if we have libsoup client certs])
2014-05-01 20:55:13 +04:00
have_libsoup_client_certs=yes
], [], [#include <libsoup/soup.h>])
2014-06-26 15:54:41 +04:00
AS_IF([test x$enable_libsoup_client_certs = xyes && test x$have_libsoup_client_certs != xyes], [
AC_MSG_ERROR([libsoup client certs explicitly requested but not found])
2022-02-17 22:12:18 +03:00
])
2014-05-01 20:55:13 +04:00
CFLAGS=$save_CFLAGS
2014-04-22 17:08:35 +04:00
], [
with_soup=no
])
], [ with_soup=no ])
2017-02-17 18:22:43 +03:00
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libsoup"; fi
2012-08-14 21:11:45 +04:00
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
2014-05-01 20:55:13 +04:00
AM_CONDITIONAL(HAVE_LIBSOUP_CLIENT_CERTS, test x$have_libsoup_client_certs = xyes)
2012-06-15 00:22:23 +04:00
2022-02-17 22:12:18 +03:00
dnl Some components use either soup2 or soup3.
AM_CONDITIONAL([USE_LIBSOUP_OR_LIBSOUP3],
[test x$with_soup = xyes || test x$with_soup3 = xyes])
AS_IF([test x$with_soup = xyes || test x$with_soup3 = xyes], [
AC_DEFINE([HAVE_LIBSOUP_OR_LIBSOUP3], 1, [Define if we have libsoup.pc or libsoup3.pc])
])
AS_IF([test x$with_curl = xyes && test x$with_soup = xno && test x$with_soup3 = xno], [
2018-01-08 16:53:46 +03:00
AC_MSG_WARN([Curl enabled, but libsoup is not; libsoup is needed for tests (make check, etc.)])
2016-12-08 05:02:30 +03:00
])
2022-02-17 22:12:18 +03:00
AM_CONDITIONAL(USE_CURL_OR_SOUP, test x$with_curl != xno || test x$with_soup != xno || test x$with_soup3 != xno)
AS_IF([test x$with_curl != xno || test x$with_soup != xno || test x$with_soup3 != xno],
2016-12-08 05:02:30 +03:00
[AC_DEFINE([HAVE_LIBCURL_OR_LIBSOUP], 1, [Define if we have soup or curl])])
2022-02-17 22:12:18 +03:00
AS_IF([test x$with_curl = xyes], [fetcher_backend=curl],
[test x$with_soup = xyes], [fetcher_backend=libsoup],
[test x$with_soup3 = xyes], [fetcher_backend=libsoup3],
[fetcher_backend=none])
2016-12-08 05:02:30 +03:00
2013-07-27 03:25:07 +04:00
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
2023-02-08 12:24:50 +03:00
GOBJECT_INTROSPECTION_CHECK([1.51.5])
2013-07-27 03:25:07 +04:00
])
2013-10-11 19:50:15 +04:00
AM_CONDITIONAL(BUILDOPT_INTROSPECTION, test "x$found_introspection" = xyes)
2013-07-27 03:25:07 +04:00
2022-11-24 19:39:35 +03:00
LIBGPGME_DEPENDENCY="1.8.0"
LIBGPGME_PTHREAD_DEPENDENCY="1.1.8"
2019-05-19 16:24:40 +03:00
AC_ARG_WITH(gpgme,
AS_HELP_STRING([--with-gpgme], [Use gpgme @<:@default=yes@:>@]),
[], [with_gpgme=yes])
AS_IF([test x$with_gpgme != xno], [
2022-11-24 19:39:35 +03:00
have_gpgme=yes
2023-06-13 00:04:44 +03:00
PKG_CHECK_MODULES([OT_DEP_GPGME], [gpgme >= $LIBGPGME_DEPENDENCY gpg-error], [have_gpgme=yes], [have_gpgme=no])
2022-11-24 19:39:35 +03:00
]
)
AS_IF([test x$with_gpgme != xno && test x$have_gpgme != xyes], [
PKG_CHECK_MODULES(OT_DEP_GPGME, gpgme-pthread >= $LIBGPGME_PTHREAD_DEPENDENCY, have_gpgme=yes, [
2019-05-19 16:24:40 +03:00
m4_ifdef([AM_PATH_GPGME_PTHREAD], [
2022-11-24 19:39:35 +03:00
AM_PATH_GPGME_PTHREAD($LIBGPGME_PTHREAD_DEPENDENCY, have_gpgme=yes, have_gpgme=no)
2019-05-19 16:24:40 +03:00
],[ have_gpgme=no ])
])
AS_IF([ test x$have_gpgme = xno ], [
2022-11-24 19:39:35 +03:00
AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_PTHREAD_DEPENDENCY or later])
2019-05-19 16:24:40 +03:00
])
OSTREE_FEATURES="$OSTREE_FEATURES gpgme"
PKG_CHECK_MODULES(OT_DEP_GPG_ERROR, [gpg-error], [], [
2018-07-16 21:43:17 +03:00
dnl This apparently doesn't ship a pkg-config file either, and we need
dnl to link to it directly.
2019-05-19 16:24:40 +03:00
AC_PATH_PROG(GPG_ERROR_CONFIG, [gpg-error-config], [AC_MSG_ERROR([Missing gpg-error-config])])
OT_DEP_GPG_ERROR_CFLAGS="$( $GPG_ERROR_CONFIG --cflags )"
OT_DEP_GPG_ERROR_LIBS="$( $GPG_ERROR_CONFIG --libs )"
])
OT_DEP_GPGME_CFLAGS="${OT_DEP_GPGME_CFLAGS} ${OT_DEP_GPG_ERROR_CFLAGS}"
OT_DEP_GPGME_LIBS="${OT_DEP_GPGME_LIBS} ${OT_DEP_GPG_ERROR_LIBS}"
2022-11-24 19:39:35 +03:00
]
)
AS_IF([test x$with_gpgme != xno && test x$have_gpgme != xyes],
[AC_MSG_ERROR([Need GPGME_PTHREAD and GPG_ERROR])]
)
AS_IF([test x$have_gpgme = xyes],
[ OSTREE_FEATURES="$OSTREE_FEATURES gpgme" ],
2019-05-19 16:24:40 +03:00
[
AC_DEFINE([OSTREE_DISABLE_GPGME], 1, [Define to disable internal GPGME support])
2022-11-24 19:39:35 +03:00
have_gpgme=no
2019-05-19 16:24:40 +03:00
]
)
AM_CONDITIONAL(USE_GPGME, test "x$have_gpgme" = xyes)
2013-09-03 05:43:49 +04:00
2023-05-23 11:31:23 +03:00
# These are needed by libcomposefs
AC_MSG_CHECKING([for new mount API (fsconfig)])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
#include <sys/mount.h>
int cmd = FSCONFIG_CMD_CREATE;
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_FSCONFIG_CMD_CREATE_SYS_MOUNT_H], 1, [Define if FSCONFIG_CMD_CREATE is available in sys/mount.h])],
[AC_MSG_RESULT(no)])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
/* also make sure it doesn't conflict with <sys/mount.h> since it is always used. */
#include <sys/mount.h>
#include <linux/mount.h>
int cmd = FSCONFIG_CMD_CREATE;
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_FSCONFIG_CMD_CREATE_LINUX_MOUNT_H], 1, [Define if FSCONFIG_CMD_CREATE is available in linux/mount.h])],
[AC_MSG_RESULT(no)])
lib: Add (private) API for checking out commits into a composefs image
This supports checking out a commit into a tree which is then
converted into a composefs image containing fs-verity digests for all
the regular files, and payloads that are relative to a the
`repo/objects` directory of a bare ostree repo.
Some specal files are always created in the image. This ensures that
various directories (usr, etc, boot, var, sysroot) exists in the
created image, even if they were not in the source commit. These are
needed (as bindmount targets) if you want to boot from the image. In
the non-composefs case these are just created as needed in the checked
out deploydir, but we can't do that here.
This is all controlled by the new ex-integrity config section, which
has the following layout:
```
[ex-integrity]
fsverity=yes/no/maybe
composefs=yes/no/maybe
composefs-apply-sig=yes/no
composefs-add-metadata=yes/no
composefs-keyfiile=/a/path
composefs-certfile=/a/path
```
The `fsverity` key overrides the old `ex-fsverity` section if
specified. The default for all these is for the new behaviour to be
disabled. Additionally, enabling composefs implies fsverity defaults
to `maybe`, to avoid having to set both.
2022-06-09 18:15:29 +03:00
AC_ARG_WITH(composefs,
2023-05-23 11:31:23 +03:00
AS_HELP_STRING([--with-composefs], [Support composefs]),
:, with_composefs=no)
if test x$with_composefs != xno; then OSTREE_FEATURES="$OSTREE_FEATURES composefs";
AC_DEFINE([HAVE_COMPOSEFS], 1, [Define if we have libcomposefs])
fi
lib: Add (private) API for checking out commits into a composefs image
This supports checking out a commit into a tree which is then
converted into a composefs image containing fs-verity digests for all
the regular files, and payloads that are relative to a the
`repo/objects` directory of a bare ostree repo.
Some specal files are always created in the image. This ensures that
various directories (usr, etc, boot, var, sysroot) exists in the
created image, even if they were not in the source commit. These are
needed (as bindmount targets) if you want to boot from the image. In
the non-composefs case these are just created as needed in the checked
out deploydir, but we can't do that here.
This is all controlled by the new ex-integrity config section, which
has the following layout:
```
[ex-integrity]
fsverity=yes/no/maybe
composefs=yes/no/maybe
composefs-apply-sig=yes/no
composefs-add-metadata=yes/no
composefs-keyfiile=/a/path
composefs-certfile=/a/path
```
The `fsverity` key overrides the old `ex-fsverity` section if
specified. The default for all these is for the new behaviour to be
disabled. Additionally, enabling composefs implies fsverity defaults
to `maybe`, to avoid having to set both.
2022-06-09 18:15:29 +03:00
AM_CONDITIONAL(USE_COMPOSEFS, test $with_composefs != no)
2019-06-15 20:10:47 +03:00
LIBSODIUM_DEPENDENCY="1.0.14"
2020-04-17 19:22:37 +03:00
AC_ARG_WITH(ed25519_libsodium,
AS_HELP_STRING([--with-ed25519-libsodium], [Use libsodium for ed25519 @<:@default=no@:>@]),
[], [with_ed25519_libsodium=no])
AS_IF([test x$with_ed25519_libsodium != xno], [
2019-06-15 20:10:47 +03:00
AC_DEFINE([HAVE_LIBSODIUM], 1, [Define if using libsodium])
PKG_CHECK_MODULES(OT_DEP_LIBSODIUM, libsodium >= $LIBSODIUM_DEPENDENCY, have_libsodium=yes, have_libsodium=no)
AS_IF([ test x$have_libsodium = xno ], [
AC_MSG_ERROR([Need LIBSODIUM version $LIBSODIUM_DEPENDENCY or later])
])
2020-04-17 19:22:37 +03:00
], with_ed25519_libsodium=no )
2019-06-15 20:10:47 +03:00
AM_CONDITIONAL(USE_LIBSODIUM, test "x$have_libsodium" = xyes)
2011-12-04 21:14:08 +04:00
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
2022-01-04 12:41:38 +03:00
FUSE3_DEPENDENCY="fuse3 >= 3.1.1"
2016-02-10 14:42:54 +03:00
# What's in RHEL7.2.
FUSE_DEPENDENCY="fuse >= 2.9.2"
2011-11-30 18:21:14 +04:00
2019-10-26 01:07:44 +03:00
AC_CHECK_HEADERS([linux/fsverity.h])
AS_IF([test x$ac_cv_header_linux_fsverity_h = xyes ],
[OSTREE_FEATURES="$OSTREE_FEATURES ex-fsverity"])
2015-06-29 20:20:57 +03:00
# check for gtk-doc
m4_ifdef([GTK_DOC_CHECK], [
2013-08-17 06:54:35 +04:00
GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
2015-06-29 20:20:57 +03:00
],[
enable_gtk_doc=no
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
2016-01-28 23:22:10 +03:00
AC_ARG_ENABLE(man,
[AS_HELP_STRING([--enable-man],
[generate man pages [default=auto]])],,
enable_man=maybe)
AS_IF([test "$enable_man" != no], [
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test -z "$XSLTPROC"], [
AS_IF([test "$enable_man" = yes], [
AC_MSG_ERROR([xsltproc is required for --enable-man])
])
enable_man=no
2017-03-06 15:19:28 +03:00
],[
enable_man=yes
2016-01-28 23:22:10 +03:00
])
])
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
2012-01-14 01:30:39 +04:00
2021-05-21 20:57:54 +03:00
AC_ARG_ENABLE([man-html],
[AS_HELP_STRING([--enable-man-html],
[generate man HTML pages [default=no]])],,
enable_man_html=no)
AS_IF([test "$enable_man_html" = yes && test "$enable_man" = no], [
AC_MSG_ERROR([--enable-man is required for --enable-man-html])
])
AM_CONDITIONAL(ENABLE_MAN_HTML, test "$enable_man_html" = yes)
2011-12-04 21:14:08 +04:00
AC_ARG_WITH(libarchive,
AS_HELP_STRING([--without-libarchive], [Do not use libarchive]),
:, with_libarchive=maybe)
2012-08-28 17:36:07 +04:00
AS_IF([ test x$with_libarchive != xno ], [
2012-02-25 00:40:52 +04:00
AC_MSG_CHECKING([for $LIBARCHIVE_DEPENDENCY])
2011-12-04 21:14:08 +04:00
PKG_CHECK_EXISTS($LIBARCHIVE_DEPENDENCY, have_libarchive=yes, have_libarchive=no)
2012-02-25 00:40:52 +04:00
AC_MSG_RESULT([$have_libarchive])
2012-08-14 21:11:45 +04:00
AS_IF([ test x$have_libarchive = xno && test x$with_libarchive != xmaybe ], [
2011-12-04 21:14:08 +04:00
AC_MSG_ERROR([libarchive is enabled but could not be found])
2012-08-14 21:11:45 +04:00
])
AS_IF([ test x$have_libarchive = xyes], [
2015-01-30 17:06:22 +03:00
AC_DEFINE([HAVE_LIBARCHIVE], 1, [Define if we have libarchive.pc])
2011-12-04 21:14:08 +04:00
PKG_CHECK_MODULES(OT_DEP_LIBARCHIVE, $LIBARCHIVE_DEPENDENCY)
2013-08-30 12:50:29 +04:00
save_LIBS=$LIBS
LIBS=$OT_DEP_LIBARCHIVE_LIBS
AC_CHECK_FUNCS(archive_read_support_filter_all)
LIBS=$save_LIBS
2012-02-25 00:40:52 +04:00
with_libarchive=yes
2012-08-14 21:11:45 +04:00
], [
2011-12-04 21:14:08 +04:00
with_libarchive=no
2012-08-14 21:11:45 +04:00
])
2012-08-26 20:46:14 +04:00
], [ with_libarchive=no ])
2017-02-17 18:22:43 +03:00
if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libarchive"; fi
2011-12-04 21:14:08 +04:00
AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
2014-01-29 18:22:16 +04:00
dnl This is what is in RHEL7 anyways
2014-02-02 20:53:22 +04:00
SELINUX_DEPENDENCY="libselinux >= 2.1.13"
2014-01-29 18:22:16 +04:00
AC_ARG_WITH(selinux,
AS_HELP_STRING([--without-selinux], [Do not use SELinux]),
:, with_selinux=maybe)
AS_IF([ test x$with_selinux != xno ], [
AC_MSG_CHECKING([for $SELINUX_DEPENDENCY])
PKG_CHECK_EXISTS($SELINUX_DEPENDENCY, have_selinux=yes, have_selinux=no)
AC_MSG_RESULT([$have_selinux])
AS_IF([ test x$have_selinux = xno && test x$with_selinux != xmaybe ], [
AC_MSG_ERROR([SELinux is enabled but could not be found])
])
AS_IF([ test x$have_selinux = xyes], [
2015-01-30 17:06:22 +03:00
AC_DEFINE([HAVE_SELINUX], 1, [Define if we have libselinux.pc])
2014-01-29 18:22:16 +04:00
PKG_CHECK_MODULES(OT_DEP_SELINUX, $SELINUX_DEPENDENCY)
with_selinux=yes
], [
with_selinux=no
])
], [ with_selinux=no ])
2017-02-17 18:22:43 +03:00
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES selinux"; fi
2014-01-29 18:22:16 +04:00
AM_CONDITIONAL(USE_SELINUX, test $with_selinux != no)
2017-02-21 21:58:40 +03:00
AC_ARG_WITH(smack,
AS_HELP_STRING([--with-smack], [Enable smack]),
:, with_smack=no)
AS_IF([ test x$with_smack = xyes], [
AC_DEFINE([WITH_SMACK], 1, [Define if we have smack.pc])
])
AM_CONDITIONAL(USE_SMACK, test $with_smack != no)
2017-06-13 16:56:21 +03:00
dnl crypto
AC_ARG_WITH(crypto,
AS_HELP_STRING([--with-crypto], [Choose library for checksums, one of glib, openssl, gnutls (default: glib)]),
:, with_crypto=glib)
AS_IF([test $with_crypto = glib],
[],
[test $with_crypto = openssl],
[with_openssl=yes],
[test $with_crypto = gnutls],
[],
[AC_MSG_ERROR([Invalid --with-crypto $with_crypto])]
)
2017-03-21 22:07:41 +03:00
dnl begin openssl (really just libcrypto right now)
2017-06-13 16:56:21 +03:00
dnl Note this option is now deprecated in favor of --with-crypto=openssl
2017-03-21 22:07:41 +03:00
OPENSSL_DEPENDENCY="libcrypto >= 1.0.1"
2017-03-13 21:41:14 +03:00
AC_ARG_WITH(openssl,
2017-06-13 16:56:21 +03:00
AS_HELP_STRING([--with-openssl], [Enable use of OpenSSL libcrypto (checksums)]),with_openssl=$withval,with_openssl=no)
2017-03-13 21:41:14 +03:00
AS_IF([ test x$with_openssl != xno ], [
2017-06-13 16:56:21 +03:00
PKG_CHECK_MODULES(OT_DEP_CRYPTO, $OPENSSL_DEPENDENCY)
2017-03-13 21:41:14 +03:00
AC_DEFINE([HAVE_OPENSSL], 1, [Define if we have openssl])
2017-06-13 16:56:21 +03:00
with_crypto=openssl
2017-03-13 21:41:14 +03:00
with_openssl=yes
], [
with_openssl=no
])
if test x$with_openssl != xno; then OSTREE_FEATURES="$OSTREE_FEATURES openssl"; fi
AM_CONDITIONAL(USE_OPENSSL, test $with_openssl != no)
dnl end openssl
2023-07-06 18:12:46 +03:00
if test x$with_openssl != xno || test x$with_ed25519_libsodium != xno; then
AC_DEFINE([HAVE_ED25519], 1, [Define if ed25519 is supported ])
OSTREE_FEATURES="$OSTREE_FEATURES sign-ed25519"
fi
2017-06-13 16:56:21 +03:00
dnl begin gnutls; in contrast to openssl this one only
dnl supports --with-crypto=gnutls
GNUTLS_DEPENDENCY="gnutls >= 3.5.0"
AS_IF([ test $with_crypto = gnutls ], [
PKG_CHECK_MODULES(OT_DEP_CRYPTO, $GNUTLS_DEPENDENCY)
AC_DEFINE([HAVE_GNUTLS], 1, [Define if we have gnutls])
OSTREE_FEATURES="$OSTREE_FEATURES gnutls"
])
AM_CONDITIONAL(USE_GNUTLS, test $with_crypto = gnutls)
dnl end gnutls
2023-07-08 22:42:12 +03:00
dnl we always inject libsodium into our crypto deps in addition to openssl/gnutls
OT_DEP_CRYPTO_CFLAGS="${OT_DEP_CRYPTO_CFLAGS} ${OT_DEP_LIBSODIUM_CFLAGS}"
OT_DEP_CRYPTO_LIBS="${OT_DEP_CRYPTO_LIBS} ${OT_DEP_LIBSODIUM_LIBS}"
2017-04-19 02:13:28 +03:00
dnl Avahi dependency for finding repos
AVAHI_DEPENDENCY="avahi-client >= 0.6.31 avahi-glib >= 0.6.31"
AC_ARG_WITH(avahi,
AS_HELP_STRING([--without-avahi], [Do not use Avahi]),
:, with_avahi=maybe)
AS_IF([ test x$with_avahi != xno ], [
AC_MSG_CHECKING([for $AVAHI_DEPENDENCY])
PKG_CHECK_EXISTS($AVAHI_DEPENDENCY, have_avahi=yes, have_avahi=no)
AC_MSG_RESULT([$have_avahi])
AS_IF([ test x$have_avahi = xno && test x$with_avahi != xmaybe ], [
AC_MSG_ERROR([Avahi is enabled but could not be found])
])
AS_IF([ test x$have_avahi = xyes], [
AC_DEFINE([HAVE_AVAHI], 1, [Define if we have avahi-client.pc and avahi-glib.pc])
PKG_CHECK_MODULES(OT_DEP_AVAHI, $AVAHI_DEPENDENCY)
with_avahi=yes
], [
with_avahi=no
])
], [ with_avahi=no ])
if test x$with_avahi != xno; then OSTREE_FEATURES="$OSTREE_FEATURES avahi"; fi
AM_CONDITIONAL(USE_AVAHI, test $with_avahi != no)
2016-03-21 17:37:38 +03:00
dnl This is what is in RHEL7.2 right now, picking it arbitrarily
LIBMOUNT_DEPENDENCY="mount >= 2.23.0"
AC_ARG_WITH(libmount,
AS_HELP_STRING([--without-libmount], [Do not use libmount]),
:, with_libmount=maybe)
AS_IF([ test x$with_libmount != xno ], [
AC_MSG_CHECKING([for $LIBMOUNT_DEPENDENCY])
PKG_CHECK_EXISTS($LIBMOUNT_DEPENDENCY, have_libmount=yes, have_libmount=no)
AC_MSG_RESULT([$have_libmount])
AS_IF([ test x$have_libmount = xno && test x$with_libmount != xmaybe ], [
AC_MSG_ERROR([libmount is enabled but could not be found])
])
AS_IF([ test x$have_libmount = xyes], [
AC_DEFINE([HAVE_LIBMOUNT], 1, [Define if we have libmount.pc])
PKG_CHECK_MODULES(OT_DEP_LIBMOUNT, $LIBMOUNT_DEPENDENCY)
with_libmount=yes
2017-02-24 18:18:27 +03:00
save_LIBS=$LIBS
LIBS=$OT_DEP_LIBMOUNT_LIBS
AC_CHECK_FUNCS(mnt_unref_cache)
LIBS=$save_LIBS
2016-03-21 17:37:38 +03:00
], [
with_libmount=no
])
], [ with_libmount=no ])
2017-02-17 18:22:43 +03:00
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libmount"; fi
2016-03-21 17:37:38 +03:00
AM_CONDITIONAL(USE_LIBMOUNT, test $with_libmount != no)
2016-02-10 14:42:54 +03:00
# Enabled by default because I think people should use it.
AC_ARG_ENABLE(rofiles-fuse,
[AS_HELP_STRING([--enable-rofiles-fuse],
[generate rofiles-fuse helper [default=yes]])],,
enable_rofiles_fuse=yes)
2016-04-25 14:57:03 +03:00
AS_IF([ test x$enable_rofiles_fuse != xno ], [
2022-01-04 12:41:38 +03:00
PKG_CHECK_MODULES([FUSE3], [$FUSE3_DEPENDENCY],
[
FUSE_USE_VERSION=31
BUILDOPT_FUSE_CFLAGS="$FUSE3_CFLAGS"
BUILDOPT_FUSE_LIBS="$FUSE3_LIBS"
],
[PKG_CHECK_MODULES([FUSE], [$FUSE_DEPENDENCY],
[
FUSE_USE_VERSION=26
BUILDOPT_FUSE_CFLAGS="$FUSE_CFLAGS"
BUILDOPT_FUSE_LIBS="$FUSE_LIBS"
])])
AC_DEFINE_UNQUOTED([FUSE_USE_VERSION], [$FUSE_USE_VERSION], [Define to the FUSE API version])
AC_SUBST([BUILDOPT_FUSE_CFLAGS])
AC_SUBST([BUILDOPT_FUSE_LIBS])
], [enable_rofiles_fuse=no])
2016-02-10 14:42:54 +03:00
AM_CONDITIONAL(BUILDOPT_FUSE, test x$enable_rofiles_fuse = xyes)
2013-06-03 22:12:40 +04:00
AC_ARG_WITH(dracut,
AS_HELP_STRING([--with-dracut],
[Install dracut module (default: no)]),,
[with_dracut=no])
2016-04-28 18:34:27 +03:00
case x$with_dracut in
xno) ;;
xyes) ;;
xyesbutnoconf) ;;
*) AC_MSG_ERROR([Unknown --with-dracut value $with_dracut])
esac
AM_CONDITIONAL(BUILDOPT_DRACUT, test x$with_dracut = xyes || test x$with_dracut = xyesbutnoconf)
AM_CONDITIONAL(BUILDOPT_DRACUT_CONF, test x$with_dracut = xyes)
2013-06-03 22:12:40 +04:00
2013-10-23 00:04:32 +04:00
AC_ARG_WITH(mkinitcpio,
AS_HELP_STRING([--with-mkinitcpio],
[Install mkinitcpio module (default: no)]),,
[with_mkinitcpio=no])
AM_CONDITIONAL(BUILDOPT_MKINITCPIO, test x$with_mkinitcpio = xyes)
2016-06-14 20:12:21 +03:00
dnl We have separate checks for libsystemd and the unit dir for historical reasons
2018-03-08 19:20:11 +03:00
AC_ARG_WITH(libsystemd,
AS_HELP_STRING([--without-libsystemd], [Do not use libsystemd]),
:, with_libsystemd=maybe)
AS_IF([ test x$with_libsystemd != xno ], [
AC_MSG_CHECKING([for libsystemd])
PKG_CHECK_EXISTS(libsystemd, have_libsystemd=yes, have_libsystemd=no)
AC_MSG_RESULT([$have_libsystemd])
AS_IF([ test x$have_libsystemd = xno && test x$with_libsystemd != xmaybe ], [
AC_MSG_ERROR([libsystemd is enabled but could not be found])
])
AS_IF([ test x$have_libsystemd = xyes], [
AC_DEFINE([HAVE_LIBSYSTEMD], 1, [Define if we have libsystemd.pc])
PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd])
with_libsystemd=yes
], [
with_libsystemd=no
])
], [ with_libsystemd=no ])
2016-06-14 20:12:21 +03:00
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
AS_IF([test "x$with_libsystemd" = "xyes"], [
2013-08-12 21:27:27 +04:00
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[],
[with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
2021-06-16 16:26:24 +03:00
AC_DEFINE_UNQUOTED([SYSTEM_DATA_UNIT_PATH], ["$with_systemdsystemunitdir"], ["unit path"])
2013-08-12 21:27:27 +04:00
])
Switch to using a systemd generator for /var
If one wants to set up a mount for `/var` in `/etc/fstab`, it
won't be mounted since `ostree-prepare-root` set up a bind mount for
`/var` to `/sysroot/ostree/$stateroot/var`, and systemd will take
the already extant mount over what's in `/etc/fstab`.
There are a few options to fix this, but what I settled on is parsing
`/etc/fstab` in a generator (exactly like `systemd-fstab-generator` does),
except here we look for an explicit mount for `/var`, and if one *isn't* found,
synthesize the default ostree mount to the stateroot. Another nice property is
that if an admin creates a `var.mount` unit in `/etc` for example, that will
also override our mount.
Note that today ostree doesn't hard depend on systemd, so this behavior only
kicks in if we're built with systemd *and* libmount support (for parsing
`/etc/fstab`). I didn't really test that case though.
Initially I started writing this as a "pure libc" program, but at one point
decided to use `libostree.so` to find the booted deployment. That didn't work
out because `/boot` wasn't necessarily mounted and hence we couldn't find the
bootloader config. A leftover artifact from this is that the generator code
calls into libostree via the "cmd private" infrastructure. But it's an easy way
to share code, and doesn't hurt.
Closes: #859
Approved by: jlebon
2017-05-11 21:54:12 +03:00
AC_ARG_WITH([systemdsystemgeneratordir],
AS_HELP_STRING([--with-systemdsystemgeneratordir=DIR], [Directory for systemd generators]),
[],
[with_systemdsystemgeneratordir=$($PKG_CONFIG --variable=systemdsystemgeneratordir systemd)])
AS_IF([test "x$with_systemdsystemgeneratordir" != "xno"], [
AC_SUBST([systemdsystemgeneratordir], [$with_systemdsystemgeneratordir])
])
2013-08-12 21:27:27 +04:00
])
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
AM_CONDITIONAL(BUILDOPT_SYSTEMD, test x$with_libsystemd = xyes)
Switch to using a systemd generator for /var
If one wants to set up a mount for `/var` in `/etc/fstab`, it
won't be mounted since `ostree-prepare-root` set up a bind mount for
`/var` to `/sysroot/ostree/$stateroot/var`, and systemd will take
the already extant mount over what's in `/etc/fstab`.
There are a few options to fix this, but what I settled on is parsing
`/etc/fstab` in a generator (exactly like `systemd-fstab-generator` does),
except here we look for an explicit mount for `/var`, and if one *isn't* found,
synthesize the default ostree mount to the stateroot. Another nice property is
that if an admin creates a `var.mount` unit in `/etc` for example, that will
also override our mount.
Note that today ostree doesn't hard depend on systemd, so this behavior only
kicks in if we're built with systemd *and* libmount support (for parsing
`/etc/fstab`). I didn't really test that case though.
Initially I started writing this as a "pure libc" program, but at one point
decided to use `libostree.so` to find the booted deployment. That didn't work
out because `/boot` wasn't necessarily mounted and hence we couldn't find the
bootloader config. A leftover artifact from this is that the generator code
calls into libostree via the "cmd private" infrastructure. But it's an easy way
to share code, and doesn't hurt.
Closes: #859
Approved by: jlebon
2017-05-11 21:54:12 +03:00
dnl If we have both, we use the "new /var" model with ostree-system-generator
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
AM_CONDITIONAL(BUILDOPT_SYSTEMD_AND_LIBMOUNT,[test x$with_libsystemd = xyes && test x$with_libmount = xyes])
Switch to using a systemd generator for /var
If one wants to set up a mount for `/var` in `/etc/fstab`, it
won't be mounted since `ostree-prepare-root` set up a bind mount for
`/var` to `/sysroot/ostree/$stateroot/var`, and systemd will take
the already extant mount over what's in `/etc/fstab`.
There are a few options to fix this, but what I settled on is parsing
`/etc/fstab` in a generator (exactly like `systemd-fstab-generator` does),
except here we look for an explicit mount for `/var`, and if one *isn't* found,
synthesize the default ostree mount to the stateroot. Another nice property is
that if an admin creates a `var.mount` unit in `/etc` for example, that will
also override our mount.
Note that today ostree doesn't hard depend on systemd, so this behavior only
kicks in if we're built with systemd *and* libmount support (for parsing
`/etc/fstab`). I didn't really test that case though.
Initially I started writing this as a "pure libc" program, but at one point
decided to use `libostree.so` to find the booted deployment. That didn't work
out because `/boot` wasn't necessarily mounted and hence we couldn't find the
bootloader config. A leftover artifact from this is that the generator code
calls into libostree via the "cmd private" infrastructure. But it's an easy way
to share code, and doesn't hurt.
Closes: #859
Approved by: jlebon
2017-05-11 21:54:12 +03:00
AM_COND_IF(BUILDOPT_SYSTEMD_AND_LIBMOUNT,
AC_DEFINE([BUILDOPT_LIBSYSTEMD_AND_LIBMOUNT], 1, [Define if systemd and libmount]))
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 test x$with_libsystemd = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES systemd"; fi
2013-08-12 21:27:27 +04:00
2021-03-18 15:55:01 +03:00
AC_ARG_WITH(modern-grub,
AS_HELP_STRING([--with-modern-grub],
[Omit grub linux and initrd suffixes for EFI/BIOS booting on GRUB >2.02 (default: no)]),,
[with_modern_grub=no])
AS_IF([ test x$with_modern_grub = xyes], [
AC_DEFINE([WITH_MODERN_GRUB], 1, [Define if we have a GRUB version newer than 2.02])
])
2016-04-01 14:51:18 +03:00
AC_ARG_WITH(builtin-grub2-mkconfig,
2016-04-12 12:26:27 +03:00
AS_HELP_STRING([--with-builtin-grub2-mkconfig],
2016-04-01 14:51:18 +03:00
[Use a builtin minimal grub2-mkconfig to generate a GRUB2 configuration file (default: no)]),,
[with_builtin_grub2_mkconfig=no])
AM_CONDITIONAL(BUILDOPT_BUILTIN_GRUB2_MKCONFIG, test x$with_builtin_grub2_mkconfig = xyes)
AM_COND_IF(BUILDOPT_BUILTIN_GRUB2_MKCONFIG,
2016-04-06 21:22:19 +03:00
AC_DEFINE([USE_BUILTIN_GRUB2_MKCONFIG], 1, [Define if using internal ostree-grub-generator]))
AC_ARG_WITH(grub2-mkconfig-path,
AS_HELP_STRING([--with-grub2-mkconfig-path],
[Path to grub2-mkconfig]))
AS_IF([test x$with_grub2_mkconfig_path = x], [
dnl Otherwise, look for the path to the system generator. On some
dnl distributions GRUB2 *-mkconfig executable has 'grub2' prefix and
dnl on some 'grub'. We default to grub2-mkconfig.
AC_CHECK_PROGS(GRUB2_MKCONFIG, [grub2-mkconfig grub-mkconfig], [grub2-mkconfig])
],[GRUB2_MKCONFIG=$with_grub2_mkconfig_path])
2017-11-16 17:20:07 +03:00
AC_DEFINE_UNQUOTED([GRUB2_MKCONFIG_PATH], ["$GRUB2_MKCONFIG"], [The system grub2-mkconfig executable name])
2014-10-11 16:59:06 +04:00
2016-08-30 22:28:02 +03:00
AC_ARG_WITH(static-compiler,
AS_HELP_STRING([--with-static-compiler],
[Use the given compiler to build ostree-prepare-root statically linked (default: no)]),,
[with_static_compiler=no])
2018-02-15 00:03:18 +03:00
AM_CONDITIONAL(BUILDOPT_USE_STATIC_COMPILER, test "x$with_static_compiler" != xno)
2016-08-30 22:28:02 +03:00
AC_SUBST(STATIC_COMPILER, $with_static_compiler)
2016-12-08 05:59:40 +03:00
dnl for tests (but we can't use asan with gjs or any introspection,
dnl see https://github.com/google/sanitizers/wiki/AddressSanitizerAsDso for more info)
AS_IF([test "x$found_introspection" = xyes && test x$using_asan != xyes], [
2013-10-11 19:50:15 +04:00
AC_PATH_PROG(GJS, [gjs])
if test -n "$GJS"; then
have_gjs=yes
else
have_gjs=no
fi
], [have_gjs=no])
2013-09-18 20:01:46 +04:00
AM_CONDITIONAL(BUILDOPT_GJS, test x$have_gjs = xyes)
2017-06-19 17:23:21 +03:00
AM_CONDITIONAL([BUILDOPT_IS_DEVEL_BUILD],[test x$is_release_build != xyes])
2017-06-19 18:23:45 +03:00
AM_COND_IF([BUILDOPT_IS_DEVEL_BUILD],
AC_DEFINE([BUILDOPT_IS_DEVEL_BUILD], [1], [Define if doing a development build])
release_build_type=devel,
release_build_type=release)
2017-06-20 19:38:15 +03:00
OSTREE_FEATURES="$OSTREE_FEATURES $release_build_type"
2017-05-01 12:59:33 +03:00
Make P2P API public (no longer experimental)
Currently the API that allows P2P operations (e.g. pulling an ostree ref
from a LAN or USB source) is hidden behind the configure flag
--enable-experimental-api. This commit makes the API public and makes
that flag essentially a no-op (leaving it in place in case we want to
use it again in the future). The P2P API has been tested over the last
several months and proven to work.
This means that since we're no longer using the "experimental" feature
flag, P2P builds of Flatpak will fail when using versions of OSTree from
this commit onwards, until Flatpak is patched in the near future. If you
want to build Flatpak < 0.11.8 with P2P enabled and link against OSTree
2018.6, you'll have to patch Flatpak. However, since Flatpak won't yet
have a hard dependency on OSTree 2018.6, it needs a new way to determine
if the P2P API in OSTree is available, so this commit adds a "p2p"
feature flag. This way the feature set is more semantically correct than
if we had continued to use the "experimental" feature flag.
In addition to making the P2P API public, this commit makes the P2P unit
tests run by default, removes the f27-experimental CI instance that's no
longer needed, changes a few man pages to reflect the changes, and
updates the bash completion script to accept the new commands and
options.
Closes: #1596
Approved by: cgwalters
2018-05-23 01:55:14 +03:00
# P2P API is public in OSTree >= 2018.6
OSTREE_FEATURES="$OSTREE_FEATURES p2p"
2019-07-25 00:31:54 +03:00
# Strip leading whitespace
OSTREE_FEATURES=$(echo ${OSTREE_FEATURES})
2011-10-10 01:03:08 +04:00
AC_CONFIG_FILES([
Makefile
2016-01-27 21:29:21 +03:00
apidoc/Makefile
2013-07-27 03:25:07 +04:00
src/libostree/ostree-1.pc
2017-03-10 20:33:52 +03:00
src/libostree/ostree-version.h
2011-10-10 01:03:08 +04:00
])
AC_OUTPUT
2012-02-25 00:40:52 +04:00
echo "
2017-08-18 18:04:58 +03:00
libostree $VERSION ($release_build_type)
2017-12-13 00:04:11 +03:00
features: $OSTREE_FEATURES
2012-02-25 00:40:52 +04:00
===============
2013-08-17 23:21:31 +04:00
introspection: $found_introspection
2016-02-10 14:42:54 +03:00
rofiles-fuse: $enable_rofiles_fuse
2016-12-08 05:02:30 +03:00
HTTP backend: $fetcher_backend
2014-01-29 18:22:16 +04:00
SELinux: $with_selinux
2019-10-26 01:07:44 +03:00
fs-verity: $ac_cv_header_linux_fsverity_h
2017-06-13 16:56:21 +03:00
cryptographic checksums: $with_crypto
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
systemd: $with_libsystemd
2016-03-21 17:37:38 +03:00
libmount: $with_libmount
2020-04-17 19:22:37 +03:00
libsodium (ed25519 signatures): $with_ed25519_libsodium
2023-07-06 18:12:46 +03:00
openssl (ed25519 signatures): $with_openssl
2013-08-17 23:21:31 +04:00
libarchive (parse tar files directly): $with_libarchive
2016-01-27 19:06:30 +03:00
static deltas: yes (always enabled now)
2016-08-03 20:16:30 +03:00
O_TMPFILE: $enable_otmpfile
2016-10-05 17:13:33 +03:00
wrpseudo-compat: $enable_wrpseudo_compat
2016-01-28 23:22:10 +03:00
man pages (xsltproc): $enable_man
2016-01-27 21:29:21 +03:00
api docs (gtk-doc): $enable_gtk_doc
2017-05-08 17:44:43 +03:00
installed tests: $enable_installed_tests
2013-09-18 20:01:46 +04:00
gjs-based tests: $have_gjs
2013-10-23 00:04:32 +04:00
dracut: $with_dracut
2016-08-30 22:28:02 +03:00
mkinitcpio: $with_mkinitcpio
lib: Add (private) API for checking out commits into a composefs image
This supports checking out a commit into a tree which is then
converted into a composefs image containing fs-verity digests for all
the regular files, and payloads that are relative to a the
`repo/objects` directory of a bare ostree repo.
Some specal files are always created in the image. This ensures that
various directories (usr, etc, boot, var, sysroot) exists in the
created image, even if they were not in the source commit. These are
needed (as bindmount targets) if you want to boot from the image. In
the non-composefs case these are just created as needed in the checked
out deploydir, but we can't do that here.
This is all controlled by the new ex-integrity config section, which
has the following layout:
```
[ex-integrity]
fsverity=yes/no/maybe
composefs=yes/no/maybe
composefs-apply-sig=yes/no
composefs-add-metadata=yes/no
composefs-keyfiile=/a/path
composefs-certfile=/a/path
```
The `fsverity` key overrides the old `ex-fsverity` section if
specified. The default for all these is for the new behaviour to be
disabled. Additionally, enabling composefs implies fsverity defaults
to `maybe`, to avoid having to set both.
2022-06-09 18:15:29 +03:00
Static compiler for ostree-prepare-root: $with_static_compiler
Composefs: $with_composefs"
2016-04-06 21:22:19 +03:00
AS_IF([test x$with_builtin_grub2_mkconfig = xyes], [
echo " builtin grub2-mkconfig (instead of system): $with_builtin_grub2_mkconfig"
], [
echo " grub2-mkconfig path: $GRUB2_MKCONFIG"
])
2013-08-12 21:27:27 +04:00
echo ""