2011-10-10 01:03:08 +04:00
AC_PREREQ([2.63])
2015-04-17 21:16:08 +03:00
AC_INIT([ostree], [2015.6], [walters@verbum.org])
2011-10-10 01:03:08 +04:00
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
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
color-tests parallel-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
2011-10-14 01:11:01 +04:00
changequote(,)dnl
if test "x$GCC" = "xyes"; then
2012-06-28 04:26:08 +04:00
WARN_CFLAGS="-Wall -Wstrict-prototypes -Werror=missing-prototypes \
-Werror=implicit-function-declaration \
-Werror=pointer-arith -Werror=init-self -Werror=format=2 \
-Werror=format-security \
-Werror=missing-include-dirs -Werror=aggregate-return \
-Werror=declaration-after-statement"
2011-10-14 01:11:01 +04:00
fi
changequote([,])dnl
2011-11-11 15:53:44 +04:00
AC_SUBST(WARN_CFLAGS)
2011-10-14 01:11:01 +04: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])
2013-05-01 23:26:21 +04:00
AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
[Install test programs (default: no)]),,
[enable_installed_tests=no])
AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes)
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
2011-10-10 01:03:08 +04:00
PKG_PROG_PKG_CONFIG
2015-03-02 22:05:16 +03:00
GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0 libgsystem >= 2015.1"
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)
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@:>@]),
[], [with_soup=check])
2014-04-22 17:08:35 +04:00
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])
])
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 ])
2013-05-02 03:15:06 +04: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
2013-07-27 03:25:07 +04:00
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
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
2013-09-03 05:43:49 +04:00
LIBGPGME_DEPENDENCY="1.1.8"
2015-03-11 22:58:42 +03:00
PKG_CHECK_MODULES(OT_DEP_GPGME, gpgme >= $LIBGPGME_DEPENDENCY, have_gpgme=yes, [
m4_ifdef([AM_PATH_GPGME], [
AM_PATH_GPGME($LIBGPGME_DEPENDENCY, have_gpgme=yes, have_gpgme=no)
],[ have_gpgme=no ])
])
2015-03-11 18:34:59 +03:00
AS_IF([ test x$have_gpgme = xno ], [
2015-03-11 22:58:42 +03:00
AC_MSG_ERROR([Need GPGME version $LIBGPGME_DEPENDENCY or later])
])
2015-03-11 18:34:59 +03:00
OSTREE_FEATURES="$OSTREE_FEATURES +gpgme"
2013-09-03 05:43:49 +04:00
2011-12-04 21:14:08 +04:00
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
2011-11-30 18:21:14 +04:00
2013-08-17 06:54:35 +04:00
GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
2013-08-17 07:14:30 +04:00
AC_PATH_PROG([XSLTPROC], [xsltproc])
2012-01-14 01:30:39 +04:00
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 ])
2013-05-02 03:15:06 +04: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 ])
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +selinux"; fi
AM_CONDITIONAL(USE_SELINUX, test $with_selinux != no)
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])
AM_CONDITIONAL(BUILDOPT_DRACUT, test x$with_dracut = xyes)
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)
AS_IF([test "x$with_dracut" = "xyes" || test "x$with_mkinitcpio" = "xyes"], [
with_systemd=yes
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])
])
])
2013-10-23 00:04:32 +04:00
AM_CONDITIONAL(BUILDOPT_SYSTEMD, test x$with_systemd = xyes)
2013-08-12 21:27:27 +04:00
2014-10-11 16:59:06 +04:00
AC_ARG_WITH(grub2,
AS_HELP_STRING([--with-grub2],
[Install grub2 hook (default: yes)]),,
[with_grub2=yes])
AM_CONDITIONAL(BUILDOPT_GRUB2, test x$with_grub2 = xyes)
2013-09-18 20:01:46 +04:00
dnl for tests
2013-10-11 19:50:15 +04:00
AS_IF([test "x$found_introspection" = xyes], [
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)
2015-01-23 00:19:11 +03:00
AC_ARG_ENABLE(static_deltas,
AS_HELP_STRING([--enable-static-deltas],
[Enable static delta code (default: yes)]),,
[enable_static_deltas=yes])
AS_IF([test x$enable_static_deltas = xyes], [
2015-01-30 17:06:22 +03:00
AC_DEFINE([BUILDOPT_STATIC_DELTAS], 1, [Define if static deltas are enabled])
2015-01-23 00:19:11 +03:00
])
AM_CONDITIONAL(BUILDOPT_STATIC_DELTAS, test x$enable_static_deltas = xyes)
2011-10-10 01:03:08 +04:00
AC_CONFIG_FILES([
Makefile
2013-08-17 06:54:35 +04:00
doc/Makefile
2013-07-27 03:25:07 +04:00
src/libostree/ostree-1.pc
2011-10-10 01:03:08 +04:00
])
AC_OUTPUT
2012-02-25 00:40:52 +04:00
echo "
OSTree $VERSION
===============
2013-08-17 23:21:31 +04:00
introspection: $found_introspection
libsoup (retrieve remote HTTP repositories): $with_soup
2014-06-26 15:54:41 +04:00
libsoup TLS client certs: $have_libsoup_client_certs
2014-01-29 18:22:16 +04:00
SELinux: $with_selinux
2013-08-17 23:21:31 +04:00
libarchive (parse tar files directly): $with_libarchive
2015-01-23 00:19:11 +03:00
static deltas: $enable_static_deltas
2013-08-17 23:21:31 +04:00
documentation: $enable_gtk_doc
2013-09-18 20:01:46 +04:00
gjs-based tests: $have_gjs
2013-10-23 00:04:32 +04:00
dracut: $with_dracut
mkinitcpio: $with_mkinitcpio"
AS_IF([test "x$with_systemd" = "xyes"], [
2013-08-17 23:21:31 +04:00
echo " systemd unit dir: $with_systemdsystemunitdir"
2013-08-16 02:33:19 +04:00
])
2013-08-12 21:27:27 +04:00
echo ""