2011-10-09 17:03:08 -04:00
AC_PREREQ([2.63])
2017-06-14 21:44:04 -04:00
dnl If doing a final release, remember to follow the instructions to
dnl update libostree-released.sym from libostree-devel.sym, and update the checksum
2017-06-19 10:23:21 -04:00
dnl in test-symbols.sh, and also set is_release_build=yes below. Then make
dnl another post-release commit to bump the version, and set is_release_build=no.
2018-01-12 15:27:44 -05:00
m4_define([year_version], [2018])
2018-03-22 16:56:08 -04:00
m4_define([release_version], [5])
2017-03-10 14:33:52 -03:00
m4_define([package_version], [year_version.release_version])
AC_INIT([libostree], [package_version], [walters@verbum.org])
2018-03-22 16:56:08 -04:00
is_release_build=no
2011-10-09 17:03:08 -04:00
AC_CONFIG_HEADER([config.h])
2016-03-02 10:28:04 -05:00
AC_CONFIG_MACRO_DIR([buildutil])
2011-10-09 17:03:08 -04:00
AC_CONFIG_AUX_DIR([build-aux])
2015-02-02 13:00:32 +01:00
AM_INIT_AUTOMAKE([1.13 -Wno-portability foreign no-define tar-ustar no-dist-gzip dist-xz
2016-03-02 10:28:04 -05:00
color-tests subdir-objects])
2011-10-09 17:03:08 -04:00
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
2013-07-10 13:24:15 -04:00
AC_USE_SYSTEM_EXTENSIONS
2013-02-24 06:35:23 -05:00
AC_SYS_LARGEFILE
2011-10-09 17:03:08 -04:00
AC_PROG_CC
AM_PROG_CC_C_O
2015-11-25 10:37:21 +01:00
AC_PROG_YACC
2011-10-09 17:03:08 -04:00
2017-03-10 14: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])
2017-07-20 15:37:27 -04:00
AS_IF([echo "$CFLAGS" | grep -q -E -e '-Werror($| )'], [], [
2016-08-04 16:47:46 -04:00
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
2017-11-02 11:50:12 -04:00
-pipe \
-Wall \
-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 18:01:44 +00:00
-Werror=parentheses \
2017-11-02 11:50:12 -04:00
-Werror=undef \
-Werror=incompatible-pointer-types \
-Werror=misleading-indentation \
-Werror=missing-include-dirs -Werror=aggregate-return \
2017-12-15 09:20:58 -05:00
-Wstrict-aliasing=2 \
2017-03-28 13:29:38 -04:00
-Werror=unused-result \
2017-07-20 15:37:27 -04:00
])])
2011-11-11 06:53:44 -05:00
AC_SUBST(WARN_CFLAGS)
2011-10-13 17:11:01 -04:00
2016-12-07 21:59:40 -05:00
AC_MSG_CHECKING([for -fsanitize=address in CFLAGS])
if echo $CFLAGS | grep -q -e -fsanitize=address; then
AC_MSG_RESULT([yes])
using_asan=yes
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(BUILDOPT_ASAN, [test x$using_asan = xyes])
2017-08-04 13:18:40 -07:00
AM_COND_IF([BUILDOPT_ASAN],
[AC_DEFINE([BUILDOPT_ASAN], 1, [Define if we are building with -fsanitize=address])])
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-07 21:59:40 -05:00
2011-10-09 17:03:08 -04:00
# Initialize libtool
2011-11-29 18:25:07 -05:00
LT_PREREQ([2.2.4])
LT_INIT([disable-static])
2011-10-09 17:03:08 -04:00
2013-05-01 19:15:06 -04:00
OSTREE_FEATURES=""
AC_SUBST([OSTREE_FEATURES])
2016-03-02 10:28:04 -05:00
GLIB_TESTS
2016-06-26 21:59:12 -04:00
LIBGLNX_CONFIGURE
2013-05-01 15:26:21 -04:00
2017-11-02 11:50:12 -04: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 09:45:20 +02:00
AC_CHECK_HEADER([sys/xattr.h],,[AC_MSG_ERROR([You must have sys/xattr.h from glibc])])
2012-02-20 13:59:52 -05:00
2016-06-07 15:08:16 -04:00
AS_IF([test "$YACC" != "bison -y"], [AC_MSG_ERROR([bison not found but required])])
2015-12-07 10:39:37 -05:00
2011-10-09 17:03:08 -04:00
PKG_PROG_PKG_CONFIG
2017-08-12 01:17:23 +00: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 10:15:38 -04:00
BASH_COMPLETIONSDIR="${datadir}/bash-completion/completions")
2017-08-12 01:17:23 +00:00
AC_SUBST(BASH_COMPLETIONSDIR)
2016-12-08 13:38:49 -05:00
AM_PATH_GLIB_2_0(,,AC_MSG_ERROR([GLib not found]))
2015-11-09 19:04:42 -05:00
2016-05-13 07:59:10 +02: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
2016-06-22 20:12:31 -04:00
GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0"
2014-04-22 09:08:35 -04:00
PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY)
2014-04-29 08:56:05 -04:00
dnl 5.1.0 is an arbitrary version here
2014-09-08 10:35:32 -04:00
PKG_CHECK_MODULES(OT_DEP_LZMA, liblzma >= 5.0.5)
2014-04-29 08:56:05 -04:00
2015-02-23 14:47:56 -05:00
dnl Needed for rollsum
PKG_CHECK_MODULES(OT_DEP_ZLIB, zlib)
2014-05-30 10: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-07 21:02:30 -05: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 10:22:43 -05:00
if test x$with_curl = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES libcurl"; fi
2017-12-12 16:04:11 -05: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 ], [
AC_DEFINE([BUILDOPT_HTTP2], 1, [Define if we enable http2])
], [
OSTREE_FEATURES="$OSTREE_FEATURES no-http2"
])
2016-12-07 21:02:30 -05:00
2016-05-13 07:59:10 +02: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 09:08:35 -04:00
SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
AC_ARG_WITH(soup,
2012-08-14 13:11:45 -04:00
AS_HELP_STRING([--with-soup], [Use libsoup @<:@default=yes@:>@]),
2016-12-07 21:02:30 -05:00
[], [with_soup=$with_soup_default])
AS_IF([test x$with_soup != xno], [
2014-06-26 07: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 09: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 13: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 09:08:35 -04:00
])
AS_IF([test x$have_soup = xyes], [
PKG_CHECK_MODULES(OT_DEP_SOUP, $SOUP_DEPENDENCY)
2015-01-30 15:06:22 +01:00
AC_DEFINE([HAVE_LIBSOUP], 1, [Define if we have libsoup.pc])
2014-04-22 09:08:35 -04:00
with_soup=yes
2014-05-01 12: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 15:06:22 +01:00
AC_DEFINE([HAVE_LIBSOUP_CLIENT_CERTS], 1, [Define if we have libsoup client certs])
2014-05-01 12:55:13 -04:00
have_libsoup_client_certs=yes
], [], [#include <libsoup/soup.h>])
2014-06-26 07: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])
])
2014-05-01 12:55:13 -04:00
CFLAGS=$save_CFLAGS
2014-04-22 09:08:35 -04:00
], [
with_soup=no
])
], [ with_soup=no ])
2017-02-17 10:22:43 -05:00
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libsoup"; fi
2012-08-14 13:11:45 -04:00
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
2014-05-01 12:55:13 -04:00
AM_CONDITIONAL(HAVE_LIBSOUP_CLIENT_CERTS, test x$have_libsoup_client_certs = xyes)
2012-06-14 16:22:23 -04:00
2017-03-07 17:32:50 -05:00
AC_ARG_ENABLE(trivial-httpd-cmdline,
[AS_HELP_STRING([--enable-trivial-httpd-cmdline],
[Continue to support "ostree trivial-httpd" [default=no]])],,
enable_trivial_httpd_cmdline=no)
2017-06-02 15:26:26 -04:00
AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes)
AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD,
2017-03-07 17:32:50 -05:00
[AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])]
)
2016-12-07 21:02:30 -05:00
AS_IF([test x$with_curl = xyes && test x$with_soup = xno], [
2018-01-08 14:53:46 +01:00
AC_MSG_WARN([Curl enabled, but libsoup is not; libsoup is needed for tests (make check, etc.)])
2016-12-07 21:02:30 -05:00
])
AM_CONDITIONAL(USE_CURL_OR_SOUP, test x$with_curl != xno || test x$with_soup != xno)
AS_IF([test x$with_curl != xno || test x$with_soup != xno],
[AC_DEFINE([HAVE_LIBCURL_OR_LIBSOUP], 1, [Define if we have soup or curl])])
AS_IF([test x$with_curl = xyes], [fetcher_backend=curl], [test x$with_soup = xyes], [fetcher_backend=libsoup], [fetcher_backend=none])
2013-07-26 19:25:07 -04:00
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
2013-10-11 11:50:15 -04:00
AM_CONDITIONAL(BUILDOPT_INTROSPECTION, test "x$found_introspection" = xyes)
2013-07-26 19:25:07 -04:00
2013-09-02 19:43:49 -06:00
LIBGPGME_DEPENDENCY="1.1.8"
2016-02-22 15:04:38 -05:00
PKG_CHECK_MODULES(OT_DEP_GPGME, gpgme-pthread >= $LIBGPGME_DEPENDENCY, have_gpgme=yes, [
m4_ifdef([AM_PATH_GPGME_PTHREAD], [
AM_PATH_GPGME_PTHREAD($LIBGPGME_DEPENDENCY, have_gpgme=yes, have_gpgme=no)
2015-03-11 15:58:42 -04:00
],[ have_gpgme=no ])
])
2015-03-11 11:34:59 -04:00
AS_IF([ test x$have_gpgme = xno ], [
2016-02-22 15:04:38 -05:00
AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later])
2015-03-11 15:58:42 -04:00
])
2017-02-17 10:22:43 -05:00
OSTREE_FEATURES="$OSTREE_FEATURES gpgme"
2013-09-02 19:43:49 -06:00
2011-12-04 12:14:08 -05:00
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
2016-02-10 12:42:54 +01:00
# What's in RHEL7.2.
FUSE_DEPENDENCY="fuse >= 2.9.2"
2011-11-30 09:21:14 -05:00
2015-06-29 13:20:57 -04:00
# check for gtk-doc
m4_ifdef([GTK_DOC_CHECK], [
2013-08-16 22:54:35 -04:00
GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
2015-06-29 13:20:57 -04:00
],[
enable_gtk_doc=no
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
2016-01-28 15:22:10 -05: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 12:19:28 +00:00
],[
enable_man=yes
2016-01-28 15:22:10 -05:00
])
])
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
2012-01-13 16:30:39 -05:00
oxidation: Add implementation of bupsplit in Rust
This is an initial drop of "oxidation", or adding implementation
of components in Rust. The bupsplit code is a good target - no
dependencies, just computation.
Translation into Rust had a few twists -
- The C code relies a lot on overflowing unsigned ints, and
also on the C promotion rules for e.g. `uint8_t -> int32_t`
- There were some odd loops that I introduced bugs in while
translating...in particular, the function always returns `len`,
but I mistakenly translated to `len+1`, resulting in an OOB
read on the C side, which was hard to debug.
On the plus side, an off-by-one array indexing in the Rust code paniced nicely.
In practice, we'll need a lot more build infrastructure to make this work, such
as using `cargo vendor` when producing build artifacts for example. Also, Cargo
is yet another thing we need to cache.
Where do we go with this? Well, I think we should merge this, it's not a lot of
code. We can just have it be an alternative CI target. Should we do a lot more
right now? Probably not immediately, but I find the medium/long term prospects
pretty exciting!
Closes: #656
Approved by: jlebon
2017-01-24 21:43:53 -05:00
AC_ARG_ENABLE(rust,
[AS_HELP_STRING([--enable-rust],
[Compile Rust code instead of C [default=no]])],,
[enable_rust=no; rust_debug_release=no])
AS_IF([test "$enable_rust" = yes], [
AC_PATH_PROG([cargo], [cargo])
AS_IF([test -z "$cargo"], [AC_MSG_ERROR([cargo is required for --enable-rust])])
AC_PATH_PROG([rustc], [rustc])
AS_IF([test -z "$rustc"], [AC_MSG_ERROR([rustc is required for --enable-rust])])
dnl These bits based on gnome:librsvg/configure.ac
dnl By default, we build in public release mode.
AC_ARG_ENABLE(rust-debug,
AC_HELP_STRING([--enable-rust-debug],
[Build Rust code with debugging information [default=no]]),
[rust_debug_release=$enableval],
[rust_debug_release=release])
AC_MSG_CHECKING(whether to build Rust code with debugging information)
if test "x$rust_debug_release" = "xyes" ; then
rust_debug_release=debug
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
RUST_TARGET_SUBDIR=${rust_debug_release}
AC_SUBST([RUST_TARGET_SUBDIR])
])
AM_CONDITIONAL(RUST_DEBUG, [test "x$rust_debug_release" = "xdebug"])
AM_CONDITIONAL(ENABLE_RUST, [test "$enable_rust" != no])
2011-12-04 12:14:08 -05:00
AC_ARG_WITH(libarchive,
AS_HELP_STRING([--without-libarchive], [Do not use libarchive]),
:, with_libarchive=maybe)
2012-08-28 16:36:07 +03:00
AS_IF([ test x$with_libarchive != xno ], [
2012-02-24 15:40:52 -05:00
AC_MSG_CHECKING([for $LIBARCHIVE_DEPENDENCY])
2011-12-04 12:14:08 -05:00
PKG_CHECK_EXISTS($LIBARCHIVE_DEPENDENCY, have_libarchive=yes, have_libarchive=no)
2012-02-24 15:40:52 -05:00
AC_MSG_RESULT([$have_libarchive])
2012-08-14 13:11:45 -04:00
AS_IF([ test x$have_libarchive = xno && test x$with_libarchive != xmaybe ], [
2011-12-04 12:14:08 -05:00
AC_MSG_ERROR([libarchive is enabled but could not be found])
2012-08-14 13:11:45 -04:00
])
AS_IF([ test x$have_libarchive = xyes], [
2015-01-30 15:06:22 +01:00
AC_DEFINE([HAVE_LIBARCHIVE], 1, [Define if we have libarchive.pc])
2011-12-04 12:14:08 -05:00
PKG_CHECK_MODULES(OT_DEP_LIBARCHIVE, $LIBARCHIVE_DEPENDENCY)
2013-08-30 10:50:29 +02:00
save_LIBS=$LIBS
LIBS=$OT_DEP_LIBARCHIVE_LIBS
AC_CHECK_FUNCS(archive_read_support_filter_all)
LIBS=$save_LIBS
2012-02-24 15:40:52 -05:00
with_libarchive=yes
2012-08-14 13:11:45 -04:00
], [
2011-12-04 12:14:08 -05:00
with_libarchive=no
2012-08-14 13:11:45 -04:00
])
2012-08-26 12:46:14 -04:00
], [ with_libarchive=no ])
2017-02-17 10:22:43 -05:00
if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libarchive"; fi
2011-12-04 12:14:08 -05:00
AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
2014-01-29 09:22:16 -05:00
dnl This is what is in RHEL7 anyways
2014-02-02 11:53:22 -05:00
SELINUX_DEPENDENCY="libselinux >= 2.1.13"
2014-01-29 09:22:16 -05: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 15:06:22 +01:00
AC_DEFINE([HAVE_SELINUX], 1, [Define if we have libselinux.pc])
2014-01-29 09:22:16 -05:00
PKG_CHECK_MODULES(OT_DEP_SELINUX, $SELINUX_DEPENDENCY)
with_selinux=yes
], [
with_selinux=no
])
], [ with_selinux=no ])
2017-02-17 10:22:43 -05:00
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES selinux"; fi
2014-01-29 09:22:16 -05:00
AM_CONDITIONAL(USE_SELINUX, test $with_selinux != no)
2017-02-21 13:58:40 -05: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 15:07:41 -04: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 15:07:41 -04:00
OPENSSL_DEPENDENCY="libcrypto >= 1.0.1"
2017-03-13 14:41:14 -04: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 14:41:14 -04: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 14:41:14 -04: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 14:41:14 -04: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
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
2017-04-19 00:13:28 +01: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 10:37:38 -04: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 10:18:27 -05:00
save_LIBS=$LIBS
LIBS=$OT_DEP_LIBMOUNT_LIBS
AC_CHECK_FUNCS(mnt_unref_cache)
LIBS=$save_LIBS
2016-03-21 10:37:38 -04:00
], [
with_libmount=no
])
], [ with_libmount=no ])
2017-02-17 10:22:43 -05:00
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libmount"; fi
2016-03-21 10:37:38 -04:00
AM_CONDITIONAL(USE_LIBMOUNT, test $with_libmount != no)
2016-02-10 12:42:54 +01: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 13:57:03 +02:00
AS_IF([ test x$enable_rofiles_fuse != xno ], [
2016-02-10 12:42:54 +01:00
PKG_CHECK_MODULES(BUILDOPT_FUSE, $FUSE_DEPENDENCY)
], [enable_rofiles_fuse=no])
AM_CONDITIONAL(BUILDOPT_FUSE, test x$enable_rofiles_fuse = xyes)
2013-06-03 14:12:40 -04:00
AC_ARG_WITH(dracut,
AS_HELP_STRING([--with-dracut],
[Install dracut module (default: no)]),,
[with_dracut=no])
2016-04-28 11:34:27 -04: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 14:12:40 -04:00
2013-10-22 22:04:32 +02: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 13:12:21 -04:00
dnl We have separate checks for libsystemd and the unit dir for historical reasons
2018-03-08 17:20:11 +01: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 ])
AM_CONDITIONAL(BUILDOPT_LIBSYSTEMD, test $with_libsystemd != no)
2016-06-14 13:12:21 -04:00
AS_IF([test "x$have_libsystemd" = "xyes"], [
2013-10-22 22:04:32 +02:00
with_systemd=yes
2013-08-12 19:27:27 +02: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])
])
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 14:54:12 -04: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 19:27:27 +02:00
])
2013-10-22 22:04:32 +02:00
AM_CONDITIONAL(BUILDOPT_SYSTEMD, test x$with_systemd = 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 14:54:12 -04:00
dnl If we have both, we use the "new /var" model with ostree-system-generator
AM_CONDITIONAL(BUILDOPT_SYSTEMD_AND_LIBMOUNT,[test x$with_systemd = xyes && test x$with_libmount = xyes])
AM_COND_IF(BUILDOPT_SYSTEMD_AND_LIBMOUNT,
AC_DEFINE([BUILDOPT_LIBSYSTEMD_AND_LIBMOUNT], 1, [Define if systemd and libmount]))
2013-08-12 19:27:27 +02:00
2016-04-01 13:51:18 +02:00
AC_ARG_WITH(builtin-grub2-mkconfig,
2016-04-12 11:26:27 +02:00
AS_HELP_STRING([--with-builtin-grub2-mkconfig],
2016-04-01 13:51:18 +02: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 14:22:19 -04: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 14:20:07 +00:00
AC_DEFINE_UNQUOTED([GRUB2_MKCONFIG_PATH], ["$GRUB2_MKCONFIG"], [The system grub2-mkconfig executable name])
2014-10-11 08:59:06 -04:00
2016-08-30 20:28:02 +01: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-14 21:03:18 +00:00
AM_CONDITIONAL(BUILDOPT_USE_STATIC_COMPILER, test "x$with_static_compiler" != xno)
2016-08-30 20:28:02 +01:00
AC_SUBST(STATIC_COMPILER, $with_static_compiler)
2016-12-07 21:59:40 -05: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 11: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 12:01:46 -04:00
AM_CONDITIONAL(BUILDOPT_GJS, test x$have_gjs = xyes)
2017-05-01 10:59:33 +01:00
# Do we enable building experimental (non-stable) API?
# The OSTREE_ENABLE_EXPERIMENTAL_API #define is used internally and in public
# headers, so any consumer of libostree who wants to use experimental API must
# #define OSTREE_ENABLE_EXPERIMENTAL_API 1
# before including libostree headers. This means the name in the AC_DEFINE below
# is public API.
AC_ARG_ENABLE([experimental-api],
[AS_HELP_STRING([--enable-experimental-api],
[Enable unstable experimental API in libostree [default=no]])],,
[enable_experimental_api=no])
AS_IF([test x$enable_experimental_api = xyes],
[AC_DEFINE([OSTREE_ENABLE_EXPERIMENTAL_API],[1],[Define if experimental API should be enabled])
OSTREE_FEATURES="$OSTREE_FEATURES experimental"]
)
AM_CONDITIONAL([ENABLE_EXPERIMENTAL_API],[test x$enable_experimental_api = xyes])
2017-06-19 10:23:21 -04:00
AM_CONDITIONAL([BUILDOPT_IS_DEVEL_BUILD],[test x$is_release_build != xyes])
2017-06-19 11:23:45 -04: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 17:38:15 +01:00
OSTREE_FEATURES="$OSTREE_FEATURES $release_build_type"
2017-05-01 10:59:33 +01:00
2011-10-09 17:03:08 -04:00
AC_CONFIG_FILES([
Makefile
2016-01-27 13:29:21 -05:00
apidoc/Makefile
2013-07-26 19:25:07 -04:00
src/libostree/ostree-1.pc
2017-03-10 14:33:52 -03:00
src/libostree/ostree-version.h
2011-10-09 17:03:08 -04:00
])
AC_OUTPUT
2012-02-24 15:40:52 -05:00
echo "
2017-08-18 11:04:58 -04:00
libostree $VERSION ($release_build_type)
2017-12-12 16:04:11 -05:00
features: $OSTREE_FEATURES
2012-02-24 15:40:52 -05:00
===============
2013-08-17 15:21:31 -04:00
introspection: $found_introspection
oxidation: Add implementation of bupsplit in Rust
This is an initial drop of "oxidation", or adding implementation
of components in Rust. The bupsplit code is a good target - no
dependencies, just computation.
Translation into Rust had a few twists -
- The C code relies a lot on overflowing unsigned ints, and
also on the C promotion rules for e.g. `uint8_t -> int32_t`
- There were some odd loops that I introduced bugs in while
translating...in particular, the function always returns `len`,
but I mistakenly translated to `len+1`, resulting in an OOB
read on the C side, which was hard to debug.
On the plus side, an off-by-one array indexing in the Rust code paniced nicely.
In practice, we'll need a lot more build infrastructure to make this work, such
as using `cargo vendor` when producing build artifacts for example. Also, Cargo
is yet another thing we need to cache.
Where do we go with this? Well, I think we should merge this, it's not a lot of
code. We can just have it be an alternative CI target. Should we do a lot more
right now? Probably not immediately, but I find the medium/long term prospects
pretty exciting!
Closes: #656
Approved by: jlebon
2017-01-24 21:43:53 -05:00
Rust (internal oxidation): $rust_debug_release
2016-02-10 12:42:54 +01:00
rofiles-fuse: $enable_rofiles_fuse
2016-12-07 21:02:30 -05:00
HTTP backend: $fetcher_backend
2017-03-07 17:32:50 -05:00
\"ostree trivial-httpd\": $enable_trivial_httpd_cmdline
2014-01-29 09:22:16 -05:00
SELinux: $with_selinux
2017-06-13 16:56:21 +03:00
cryptographic checksums: $with_crypto
2016-06-14 13:12:21 -04:00
systemd: $have_libsystemd
2016-03-21 10:37:38 -04:00
libmount: $with_libmount
2013-08-17 15:21:31 -04:00
libarchive (parse tar files directly): $with_libarchive
2016-01-27 11:06:30 -05:00
static deltas: yes (always enabled now)
2016-08-03 13:16:30 -04:00
O_TMPFILE: $enable_otmpfile
2016-10-05 10:13:33 -04:00
wrpseudo-compat: $enable_wrpseudo_compat
2016-01-28 15:22:10 -05:00
man pages (xsltproc): $enable_man
2016-01-27 13:29:21 -05:00
api docs (gtk-doc): $enable_gtk_doc
2017-05-08 10:44:43 -04:00
installed tests: $enable_installed_tests
2013-09-18 12:01:46 -04:00
gjs-based tests: $have_gjs
2013-10-22 22:04:32 +02:00
dracut: $with_dracut
2016-08-30 20:28:02 +01:00
mkinitcpio: $with_mkinitcpio
2017-05-01 10:59:33 +01:00
Static compiler for ostree-prepare-root: $with_static_compiler
Experimental API $enable_experimental_api"
2016-04-06 14:22:19 -04: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 19:27:27 +02:00
echo ""