build: Add an --enable-p2p configure option for the peer to peer feature

A series of following commits will introduce a peer to peer feature for
pulling apps and runtimes from LAN peers and USB sticks without needing
an internet connection. This requires experimental API in libostree
(which needs to have been configured with --enable-experimental-api), so
needs to be hidden behind a configure option in flatpak too. It’s called
--enable-p2p, and bumps our libostree dependency to 2017.8 with
experimental API required too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
tingping/wmclass
Philip Withnall 2017-06-30 10:26:04 +01:00 committed by Alexander Larsson
parent f9a06a0fcd
commit 655e7ce5c3
1 changed files with 23 additions and 0 deletions

View File

@ -243,6 +243,28 @@ AC_ARG_ENABLE(sudo,
[SUDO_BIN="sudo"], [SUDO_BIN=""])
AC_SUBST([SUDO_BIN])
# Do we enable building peer to peer support using libostrees experimental (non-stable) API?
# If so, OSTREE_ENABLE_EXPERIMENTAL_API needs to be #defined before ostree.h is
# included.
AC_ARG_ENABLE([p2p],
[AS_HELP_STRING([--enable-p2p],
[Enable unstable peer to peer support [default=no]])],,
[enable_p2p=no])
AS_IF([test x$enable_p2p = xyes],[
PKG_CHECK_MODULES(OSTREE, [ostree-1 >= $OSTREE_REQS])
ostree_features=$($PKG_CONFIG --variable=features ostree-1)
AS_CASE(["$ostree_features"],
[*experimental*],[have_ostree_experimental=yes])
AS_IF([test "x$have_ostree_experimental" != "xyes"],
[AC_MSG_ERROR([Experimental API not found in ostree-1, which is needed for --enable-p2p. OSTree must be compiled with --enable-experimental-api.])])
AC_DEFINE([OSTREE_ENABLE_EXPERIMENTAL_API],[1],[Define if libostree experimental API should be enabled])
AC_DEFINE([FLATPAK_ENABLE_P2P],[1],[Define if peer to peer support should be enabled])
])
AM_CONDITIONAL([ENABLE_P2P],[test x$enable_p2p = xyes])
dnl ************************
dnl *** check for libelf ***
dnl ************************
@ -464,4 +486,5 @@ echo " Use sandboxed triggers: $enable_sandboxed_triggers"
echo " Use seccomp: $enable_seccomp"
echo " Privileged group: $PRIVILEGED_GROUP"
echo " Privilege mode: $with_priv_mode"
echo " Peer to peer support: $enable_p2p"
echo ""