2011-10-10 01:03:08 +04:00
AC_PREREQ([2.63])
2016-03-23 22:39:15 +03:00
AC_INIT([ostree], [2016.4], [walters@verbum.org])
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
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])
2016-03-02 18:28:04 +03:00
GLIB_TESTS
2013-05-01 23:26:21 +04:00
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
2015-12-07 18:39:37 +03:00
AC_CHECK_PROGS(YACC, 'bison -y', :)
AS_IF([test "$YACC" = :], [AC_MSG_ERROR([bison not found but required])])
2011-10-10 01:03:08 +04:00
PKG_PROG_PKG_CONFIG
2015-11-10 03:04:42 +03:00
AM_PATH_GLIB_2_0
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"
2016-02-22 23:04:38 +03: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 22:58:42 +03:00
],[ have_gpgme=no ])
])
2015-03-11 18:34:59 +03:00
AS_IF([ test x$have_gpgme = xno ], [
2016-02-22 23:04:38 +03:00
AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later])
2015-03-11 22:58:42 +03:00
])
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"
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
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
])
enable_man=yes
])
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
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)
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
], [
with_libmount=no
])
], [ with_libmount=no ])
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libmount"; fi
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)
AS_IF([ test $enable_rofiles_fuse != xno ], [
PKG_CHECK_MODULES(BUILDOPT_FUSE, $FUSE_DEPENDENCY)
], [enable_rofiles_fuse=no])
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])
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)
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
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
2016-02-10 14:42:54 +03:00
rofiles-fuse: $enable_rofiles_fuse
2013-08-17 23:21:31 +04:00
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
2016-03-21 17:37:38 +03:00
libmount: $with_libmount
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-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
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 ""