2011-10-09 17:03:08 -04:00
AC_PREREQ([2.63])
2016-07-08 15:29:11 -04:00
AC_INIT([ostree], [2016.7], [walters@verbum.org])
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
2011-10-13 17:11:01 -04:00
changequote(,)dnl
if test "x$GCC" = "xyes"; then
2016-06-16 13:59:06 -06:00
WARN_CFLAGS="-Wall -Wempty-body -Wstrict-prototypes -Werror=missing-prototypes \
2012-06-27 20:26:08 -04:00
-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-13 17:11:01 -04:00
fi
changequote([,])dnl
2011-11-11 06:53:44 -05:00
AC_SUBST(WARN_CFLAGS)
2011-10-13 17:11:01 -04: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
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
2015-11-09 19:04:42 -05:00
AM_PATH_GLIB_2_0
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
2015-03-02 14:05:16 -05:00
GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0 libgsystem >= 2015.1"
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-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@:>@]),
[], [with_soup=check])
2014-04-22 09:08:35 -04:00
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 ])
2013-05-01 19:15:06 -04: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
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
])
2015-03-11 11:34:59 -04: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
])
enable_man=yes
])
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
2012-01-13 16:30:39 -05:00
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 ])
2013-05-01 19:15:06 -04: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 ])
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +selinux"; fi
AM_CONDITIONAL(USE_SELINUX, test $with_selinux != 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
], [
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 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
PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd], [have_libsystemd=yes], [have_libsystemd=no])
AM_CONDITIONAL(BUILDOPT_LIBSYSTEMD, test x$have_libsystemd = xyes)
AM_COND_IF(BUILDOPT_LIBSYSTEMD,
AC_DEFINE([HAVE_LIBSYSTEMD], 1, [Define if we have libsystemd]))
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])
])
])
2013-10-22 22:04:32 +02:00
AM_CONDITIONAL(BUILDOPT_SYSTEMD, test x$with_systemd = xyes)
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])
AC_DEFINE_UNQUOTED([GRUB2_MKCONFIG_PATH], ["$GRUB2_MKCONFIG"], [The system grub2-mkconfig executible name])
2014-10-11 08:59:06 -04:00
2013-09-18 12:01:46 -04:00
dnl for tests
2013-10-11 11: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 12:01:46 -04:00
AM_CONDITIONAL(BUILDOPT_GJS, test x$have_gjs = xyes)
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
2011-10-09 17:03:08 -04:00
])
AC_OUTPUT
2012-02-24 15:40:52 -05:00
echo "
OSTree $VERSION
===============
2013-08-17 15:21:31 -04:00
introspection: $found_introspection
2016-02-10 12:42:54 +01:00
rofiles-fuse: $enable_rofiles_fuse
2013-08-17 15:21:31 -04:00
libsoup (retrieve remote HTTP repositories): $with_soup
2014-06-26 07:54:41 -04:00
libsoup TLS client certs: $have_libsoup_client_certs
2014-01-29 09:22:16 -05:00
SELinux: $with_selinux
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-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
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-04-06 14:22:19 -04:00
mkinitcpio: $with_mkinitcpio"
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 ""