Blame configure.ac

rpm-build c487f7
AC_PREREQ([2.63])
rpm-build c487f7
rpm-build c487f7
# Making releases:
rpm-build c487f7
#   FLATPAK_MICRO_VERSION += 1;
rpm-build c487f7
#   FLATPAK_INTERFACE_AGE += 1;
rpm-build c487f7
#   FLATPAK_BINARY_AGE += 1;
rpm-build c487f7
# if any functions have been added, set FLATPAK_INTERFACE_AGE to 0.
rpm-build c487f7
# if backwards compatibility has been broken,
rpm-build c487f7
# set FLATPAK_BINARY_AGE and FLATPAK_INTERFACE_AGE to 0.
rpm-build c487f7
#
rpm-build c487f7
# in easier to understand terms:
rpm-build c487f7
#
rpm-build c487f7
# on the stable branch, interface age == micro
rpm-build c487f7
# on the unstable (ie master), interface age = 0
rpm-build c487f7
rpm-build c487f7
m4_define([flatpak_builder_major_version], [1])
rpm-build c487f7
m4_define([flatpak_builder_minor_version], [0])
rpm-build c487f7
m4_define([flatpak_builder_micro_version], [9])
rpm-build c487f7
m4_define([flatpak_builder_version],
rpm-build c487f7
          [flatpak_builder_major_version.flatpak_builder_minor_version.flatpak_builder_micro_version])
rpm-build c487f7
rpm-build c487f7
AC_INIT([flatpak-builder],
rpm-build c487f7
        [flatpak_builder_version],
rpm-build c487f7
        [https://github.com/flatpak/flatpak-builder/issues],
rpm-build c487f7
        [flatpak-builder],
rpm-build c487f7
        [http://flatpak.org/])
rpm-build c487f7
rpm-build c487f7
GLIB_REQS=2.44
rpm-build c487f7
OSTREE_REQS=2017.14
rpm-build c487f7
FLATPAK_REQS=0.99.1
rpm-build c487f7
rpm-build c487f7
AC_USE_SYSTEM_EXTENSIONS
rpm-build c487f7
AC_SYS_LARGEFILE
rpm-build c487f7
LIBGLNX_CONFIGURE
rpm-build c487f7
rpm-build c487f7
AC_PROG_CC
rpm-build c487f7
AM_PROG_CC_C_O
rpm-build c487f7
AC_PROG_CC_STDC
rpm-build c487f7
AC_DISABLE_STATIC
rpm-build c487f7
rpm-build c487f7
AC_CHECK_PROG([FLATPAK], [flatpak], [flatpak], [false])
rpm-build c487f7
rpm-build c487f7
if test "x$FLATPAK" = xfalse; then
rpm-build c487f7
   AC_MSG_ERROR([You need flatpak installed])
rpm-build c487f7
else
rpm-build c487f7
   FLATPAK_VERSION=`$FLATPAK --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
rpm-build c487f7
   AX_COMPARE_VERSION([$FLATPAK_REQS],[gt],[$FLATPAK_VERSION],
rpm-build c487f7
                      [AC_MSG_ERROR([You need at least version $FLATPAK_REQS of flatpak, your version is $FLATPAK_VERSION])])
rpm-build c487f7
fi
rpm-build c487f7
rpm-build c487f7
rpm-build c487f7
LT_PREREQ([2.2.6])
rpm-build c487f7
LT_INIT([disable-static])
rpm-build c487f7
rpm-build c487f7
AC_CONFIG_SRCDIR([src/builder-main.c])
rpm-build c487f7
AC_CONFIG_HEADERS([config.h])
rpm-build c487f7
AC_CONFIG_MACRO_DIR([m4])
rpm-build c487f7
AM_INIT_AUTOMAKE([1.13.4 no-define no-dist-gzip dist-xz tar-ustar foreign subdir-objects])
rpm-build c487f7
AC_PROG_SED
rpm-build c487f7
rpm-build c487f7
AM_GNU_GETTEXT([external])
rpm-build c487f7
AM_GNU_GETTEXT_VERSION([0.18.2])
rpm-build c487f7
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$PACKAGE", [gettext domain])
rpm-build c487f7
rpm-build c487f7
# Enable silent rules is available
rpm-build c487f7
AM_SILENT_RULES([yes])
rpm-build c487f7
AM_MAINTAINER_MODE([enable])
rpm-build c487f7
rpm-build c487f7
dnl This list is shared with https://github.com/ostreedev/ostree
rpm-build c487f7
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
rpm-build c487f7
-pipe \
rpm-build c487f7
-Wall \
rpm-build c487f7
-Werror=empty-body \
rpm-build c487f7
-Werror=strict-prototypes \
rpm-build c487f7
-Werror=missing-prototypes \
rpm-build c487f7
-Werror=implicit-function-declaration \
rpm-build c487f7
"-Werror=format=2 -Werror=format-security -Werror=format-nonliteral" \
rpm-build c487f7
-Werror=pointer-arith -Werror=init-self \
rpm-build c487f7
-Werror=missing-declarations \
rpm-build c487f7
-Werror=return-type \
rpm-build c487f7
-Werror=overflow \
rpm-build c487f7
-Werror=int-conversion \
rpm-build c487f7
-Werror=parenthesis \
rpm-build c487f7
-Werror=incompatible-pointer-types \
rpm-build c487f7
-Werror=misleading-indentation \
rpm-build c487f7
-Werror=missing-include-dirs \
rpm-build c487f7
])
rpm-build c487f7
AC_SUBST(WARN_CFLAGS)
rpm-build c487f7
rpm-build c487f7
AX_VALGRIND_CHECK
rpm-build c487f7
rpm-build c487f7
PKG_PROG_PKG_CONFIG([0.24])
rpm-build c487f7
rpm-build c487f7
AC_CHECK_FUNCS(fdwalk)
rpm-build c487f7
AC_CHECK_HEADER([sys/xattr.h], [], [AC_MSG_ERROR([You must have sys/xattr.h from glibc])])
rpm-build c487f7
AC_CHECK_HEADER([sys/capability.h], have_caps=yes, [AC_MSG_ERROR([sys/capability.h header not found])])
rpm-build c487f7
rpm-build c487f7
PKG_CHECK_MODULES(BASE, [glib-2.0 >= $GLIB_REQS gio-2.0 gio-unix-2.0 libsoup-2.4 ostree-1 >= $OSTREE_REQS json-glib-1.0 libxml-2.0 >= 2.4 libcurl])
rpm-build c487f7
rpm-build c487f7
dnl ************************
rpm-build c487f7
dnl *** check for libelf ***
rpm-build c487f7
dnl ************************
rpm-build c487f7
PKG_CHECK_MODULES([LIBELF], [libelf >= 0.8.12], [have_libelf=yes], [have_libelf=maybe])
rpm-build c487f7
AS_IF([ test $have_libelf = maybe ], [
rpm-build c487f7
  save_LIBS=$LIBS
rpm-build c487f7
  AC_CHECK_LIB([elf], [elf_begin], [:], [have_libelf=no])
rpm-build c487f7
  AC_CHECK_LIB([elf], [elf_getshdrstrndx], [:], [have_libelf=no])
rpm-build c487f7
  AC_CHECK_LIB([elf], [elf_getshdrnum], [:], [have_libelf=no])
rpm-build c487f7
  AC_CHECK_HEADER([libelf.h], [:], [have_libelf=no])
rpm-build c487f7
  LIBS=$save_LIBS
rpm-build c487f7
rpm-build c487f7
  if test $have_libelf != no; then
rpm-build c487f7
    LIBELF_LIBS=-lelf
rpm-build c487f7
    have_libelf=yes
rpm-build c487f7
  fi
rpm-build c487f7
])
rpm-build c487f7
rpm-build c487f7
if test x$have_libelf != xyes; then
rpm-build c487f7
  AC_MSG_ERROR([libelf not found])
rpm-build c487f7
fi
rpm-build c487f7
rpm-build c487f7
dnl This only checks for the header, not the library.
rpm-build c487f7
AC_ARG_WITH([dwarf-header],
rpm-build c487f7
            [AS_HELP_STRING([--with-dwarf-header],
rpm-build c487f7
                            [path containing dwarf.h])],
rpm-build c487f7
            [AS_IF([test "x$with_dwarf_header" = "xno"],
rpm-build c487f7
                   [AC_MSG_WARN([either a path containing dwarf.h must be
rpm-build c487f7
provided, or it will be searched for in includedir])])],
rpm-build c487f7
            [with_dwarf_header=yes])
rpm-build c487f7
rpm-build c487f7
# We need to check these exist, because otherwise -Werror=missing-include-dirs errors out
rpm-build c487f7
LIBDWARF_INCLUDES=
rpm-build c487f7
if test -d $(eval echo \"$includedir\")/libdwarf; then
rpm-build c487f7
   LIBDWARF_INCLUDES="$LIBDWARF_INCLUDES -I$(eval echo \"$includedir\")/libdwarf"
rpm-build c487f7
fi
rpm-build c487f7
if test -d /usr/include/libdwarf; then
rpm-build c487f7
   LIBDWARF_INCLUDES="$LIBDWARF_INCLUDES -I/usr/include/libdwarf"
rpm-build c487f7
fi
rpm-build c487f7
rpm-build c487f7
AS_IF([test "x$with_dwarf_header" = "xyes"],
rpm-build c487f7
      [CPPFLAGS="$CPPFLAGS $LIBDWARF_INCLUDES"
rpm-build c487f7
       AC_CHECK_HEADER([dwarf.h])
rpm-build c487f7
       AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
rpm-build c487f7
             [AC_MSG_ERROR([dwarf.h is required but was not found; locate it using --with-dwarf-header=/path/containing/header])])],
rpm-build c487f7
      [CPPFLAGS="$CPPFLAGS -I$with_dwarf_header"
rpm-build c487f7
       AC_CHECK_HEADER([dwarf.h])
rpm-build c487f7
       AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
rpm-build c487f7
             [AC_MSG_ERROR([dwarf.h is required but was not found])])])
rpm-build c487f7
rpm-build c487f7
AC_ARG_WITH([yaml],
rpm-build c487f7
  [AS_HELP_STRING([--without-yaml],
rpm-build c487f7
                  [Disable YAML support [default=auto]])])
rpm-build c487f7
AS_IF([test "x$with_yaml" != "xno"],[
rpm-build c487f7
  PKG_CHECK_MODULES(YAML, [yaml-0.1], [have_yaml=yes], [have_yaml=no])
rpm-build c487f7
], [have_yaml=no])
rpm-build c487f7
AS_IF([test "x$have_yaml" = "xno"],[
rpm-build c487f7
  AS_IF([test "x$with_yaml" = "xyes"],
rpm-build c487f7
        [AC_MSG_ERROR([yaml-0.1 was not found, which is needed for --with-yaml])])
rpm-build c487f7
], [AC_DEFINE([FLATPAK_BUILDER_ENABLE_YAML],[1],[Define if yaml supported])])
rpm-build c487f7
rpm-build c487f7
AC_ARG_ENABLE(documentation,
rpm-build c487f7
              AC_HELP_STRING([--enable-documentation], [Build documentation]),,
rpm-build c487f7
              enable_documentation=yes)
rpm-build c487f7
if test x$enable_documentation = xyes; then
rpm-build c487f7
   AC_PATH_PROG([XSLTPROC], [xsltproc])
rpm-build c487f7
   if test x$XSLTPROC = x; then
rpm-build c487f7
      AC_MSG_ERROR([xsltproc is required to build documentation])
rpm-build c487f7
   fi
rpm-build c487f7
rpm-build c487f7
  dnl check for DocBook DTD in the local catalog
rpm-build c487f7
  JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
rpm-build c487f7
     [DocBook XML DTD V4.1.2], [have_docbook_dtd=yes], [have_docbook_dtd=no])
rpm-build c487f7
  if test "$have_docbook_dtd" != yes; then
rpm-build c487f7
    AC_MSG_ERROR([DocBook DTD is required for --enable-documentation])
rpm-build c487f7
  fi
rpm-build c487f7
rpm-build c487f7
  dnl check for DocBook XSL stylesheets in the local catalog
rpm-build c487f7
  JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
rpm-build c487f7
     [DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no])
rpm-build c487f7
  if test "$have_docbook_style" != yes; then
rpm-build c487f7
    AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-documentation])
rpm-build c487f7
  fi
rpm-build c487f7
fi
rpm-build c487f7
AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes)
rpm-build c487f7
rpm-build c487f7
AC_ARG_ENABLE(docbook-docs,
rpm-build c487f7
        [AS_HELP_STRING([--enable-docbook-docs],[build documentation (requires xmlto)])],
rpm-build c487f7
        enable_docbook_docs=$enableval, enable_docbook_docs=auto)
rpm-build c487f7
AC_PATH_PROG(XMLTO, xmlto, no)
rpm-build c487f7
AC_MSG_CHECKING([whether to build DocBook documentation])
rpm-build c487f7
if test x$XMLTO = xno ; then
rpm-build c487f7
        have_docbook=no
rpm-build c487f7
else
rpm-build c487f7
        have_docbook=yes
rpm-build c487f7
fi
rpm-build c487f7
if test x$enable_docbook_docs = xauto ; then
rpm-build c487f7
        if test x$have_docbook = xno ; then
rpm-build c487f7
                enable_docbook_docs=no
rpm-build c487f7
        else
rpm-build c487f7
                enable_docbook_docs=yes
rpm-build c487f7
        fi
rpm-build c487f7
fi
rpm-build c487f7
if test x$enable_docbook_docs = xyes; then
rpm-build c487f7
        if test x$have_docbook = xno; then
rpm-build c487f7
                AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
rpm-build c487f7
        fi
rpm-build c487f7
        AC_MSG_RESULT(yes)
rpm-build c487f7
else
rpm-build c487f7
        AC_MSG_RESULT(no)
rpm-build c487f7
fi
rpm-build c487f7
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
rpm-build c487f7
AC_ARG_VAR([XMLTO],[Define/override the 'xmlto' location.])
rpm-build c487f7
AC_ARG_VAR([XMLTO_FLAGS],[Define/override 'xmlto' options, like '--skip-validation'.])
rpm-build c487f7
rpm-build c487f7
GLIB_TESTS
rpm-build c487f7
rpm-build c487f7
FLATPAK_BUILDER_VERSION=flatpak_builder_version
rpm-build c487f7
AC_SUBST(FLATPAK_BUILDER_VERSION)
rpm-build c487f7
rpm-build c487f7
AC_CONFIG_FILES([
rpm-build c487f7
Makefile
rpm-build c487f7
doc/Makefile
rpm-build c487f7
doc/flatpak-builder-docs.xml
rpm-build c487f7
])
rpm-build c487f7
AC_OUTPUT
rpm-build c487f7
rpm-build c487f7
echo ""
rpm-build c487f7
echo "          flatpak-builder $FLATPAK_BUILDER_VERSION"
rpm-build c487f7
echo "          ============================="
rpm-build c487f7
echo ""