"Fossies" - the Fresh Open Source Software Archive

Member "flatpak-1.12.2/configure.ac" (12 Oct 2021, 23591 Bytes) of package /linux/misc/flatpak-1.12.2.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.12.1_vs_1.12.2.

    1 AC_PREREQ([2.63])
    2 
    3 # Making releases:
    4 #   FLATPAK_MICRO_VERSION += 1;
    5 #   FLATPAK_INTERFACE_AGE += 1;
    6 #   FLATPAK_BINARY_AGE += 1;
    7 # if any functions have been added, set FLATPAK_INTERFACE_AGE to 0.
    8 # if backwards compatibility has been broken,
    9 # set FLATPAK_BINARY_AGE and FLATPAK_INTERFACE_AGE to 0.
   10 #
   11 # in easier to understand terms:
   12 #
   13 # on the stable branch, interface age == micro
   14 # on the unstable (ie master), interface age = 0
   15 
   16 m4_define([flatpak_major_version], [1])
   17 m4_define([flatpak_minor_version], [12])
   18 m4_define([flatpak_micro_version], [2])
   19 m4_define([flatpak_extra_version], [])
   20 m4_define([flatpak_interface_age], [0])
   21 m4_define([flatpak_binary_age],
   22           [m4_eval(10000 * flatpak_major_version + 100 * flatpak_minor_version + flatpak_micro_version)])
   23 m4_define([flatpak_version],
   24           [flatpak_major_version.flatpak_minor_version.flatpak_micro_version()flatpak_extra_version])
   25 
   26 AC_INIT([Flatpak],
   27         [flatpak_version],
   28         [https://github.com/flatpak/flatpak/issues],
   29         [flatpak],
   30         [http://flatpak.org/])
   31 
   32 GLIB_REQS=2.44
   33 SYSTEM_BWRAP_REQS=0.4.0
   34 SYSTEM_DBUS_PROXY_REQS=0.1.0
   35 OSTREE_REQS=2020.8
   36 
   37 AC_USE_SYSTEM_EXTENSIONS
   38 AC_SYS_LARGEFILE
   39 
   40 AC_PROG_CC
   41 AM_PROG_CC_C_O
   42 AC_DISABLE_STATIC
   43 AC_PROG_CC_STDC
   44 
   45 LT_PREREQ([2.2.6])
   46 LT_INIT([disable-static])
   47 
   48 AC_CONFIG_SRCDIR([common/flatpak-dir.c])
   49 AC_CONFIG_HEADERS([config.h])
   50 AC_CONFIG_MACRO_DIR([m4])
   51 AM_INIT_AUTOMAKE([1.13.4 no-define no-dist-gzip dist-xz tar-ustar foreign subdir-objects])
   52 AC_PROG_SED
   53 AC_PROG_BISON
   54 
   55 AM_GNU_GETTEXT([external])
   56 AM_GNU_GETTEXT_VERSION([0.18.2])
   57 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$PACKAGE", [gettext domain])
   58 
   59 # Enable silent rules is available
   60 AM_SILENT_RULES([yes])
   61 AM_MAINTAINER_MODE([enable])
   62 
   63 dnl This list is shared with https://github.com/ostreedev/ostree
   64 CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
   65 -pipe \
   66 -Wall \
   67 -Werror=shadow \
   68 -Werror=empty-body \
   69 -Werror=strict-prototypes \
   70 -Werror=missing-prototypes \
   71 -Werror=implicit-function-declaration \
   72 "-Werror=format=2 -Werror=format-security -Werror=format-nonliteral" \
   73 -Werror=pointer-arith -Werror=init-self \
   74 -Werror=missing-declarations \
   75 -Werror=return-type \
   76 -Werror=overflow \
   77 -Werror=int-conversion \
   78 -Werror=parenthesis \
   79 -Werror=incompatible-pointer-types \
   80 -Werror=misleading-indentation \
   81 -Werror=missing-include-dirs \
   82 ])
   83 AC_SUBST(WARN_CFLAGS)
   84 
   85 AX_VALGRIND_CHECK
   86 
   87 PKG_PROG_PKG_CONFIG([0.24])
   88 
   89 AC_ARG_WITH(privileged_group,
   90 		AS_HELP_STRING([--with-privileged-group=GROUP],[Name of privileged group, [default=wheel]]),
   91             with_privileged_group="$withval", with_privileged_group=wheel)
   92 PRIVILEGED_GROUP=$with_privileged_group
   93 AC_SUBST(PRIVILEGED_GROUP)
   94 
   95 AC_ARG_WITH(dbus_service_dir,
   96 		AS_HELP_STRING([--with-dbus-service-dir=PATH],[choose directory for dbus service files, [default=PREFIX/share/dbus-1/services]]),
   97             with_dbus_service_dir="$withval", with_dbus_service_dir=$datadir/dbus-1/services)
   98 DBUS_SERVICE_DIR=$with_dbus_service_dir
   99 AC_SUBST(DBUS_SERVICE_DIR)
  100 
  101 AC_ARG_WITH(dbus_config_dir,
  102 		AS_HELP_STRING([--with-dbus-config-dir=PATH],[choose directory for dbus config files, [default=SYSCONFDIR/dbus-1/system.d]]),
  103             with_dbus_config_dir="$withval", with_dbus_config_dir=${sysconfdir}/dbus-1/system.d)
  104 DBUS_CONFIG_DIR=$with_dbus_config_dir
  105 AC_SUBST(DBUS_CONFIG_DIR)
  106 
  107 AC_ARG_WITH([systemduserunitdir],
  108             [AS_HELP_STRING([--with-systemduserunitdir=DIR],
  109                             [Directory for systemd user service files (default=PREFIX/lib/systemd/user)])],
  110     [],
  111     dnl This is deliberately not ${libdir}: systemd units always go in
  112     dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu
  113     [with_systemduserunitdir='${prefix}/lib/systemd/user'])
  114 AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
  115 
  116 AC_ARG_WITH([systemdsystemunitdir],
  117             [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
  118                             [Directory for systemd system service files (default=PREFIX/lib/systemd/system)])],
  119     [],
  120     dnl This is deliberately not ${libdir}: systemd units always go in
  121     dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu
  122     [with_systemdsystemunitdir='${prefix}/lib/systemd/system'])
  123 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
  124 
  125 AC_ARG_WITH([systemdsystemenvgendir],
  126             [AS_HELP_STRING([--with-systemdsystemenvgendir=DIR],
  127                             [Directory for systemd system environment generators (default=PREFIX/lib/systemd/system-environment-generators)])],
  128     [],
  129     dnl This is deliberately not ${libdir}: systemd units always go in
  130     dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu
  131     [with_systemdsystemenvgendir='${prefix}/lib/systemd/system-environment-generators'])
  132 AC_SUBST([systemdsystemenvgendir], [$with_systemdsystemenvgendir])
  133 
  134 AC_ARG_WITH([systemduserenvgendir],
  135             [AS_HELP_STRING([--with-systemduserenvgendir=DIR],
  136                             [Directory for systemd user environment generators (default=PREFIX/lib/systemd/user-environment-generators)])],
  137     [],
  138     dnl This is deliberately not ${libdir}: systemd units always go in
  139     dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu
  140     [with_systemduserenvgendir='${prefix}/lib/systemd/user-environment-generators'])
  141 AC_SUBST([systemduserenvgendir], [$with_systemduserenvgendir])
  142 
  143 AC_ARG_WITH(system_fonts_dir,
  144 		AS_HELP_STRING([--with-system-fonts-dir=PATH],[Directory where system fonts are, [default=/usr/share/fonts]]),
  145             with_system_fonts_dir="$withval", with_system_fonts_dir=/usr/share/fonts)
  146 SYSTEM_FONTS_DIR=$with_system_fonts_dir
  147 AC_SUBST(SYSTEM_FONTS_DIR)
  148 
  149 AC_ARG_WITH(system_font_cache_dirs,
  150 		AS_HELP_STRING([--with-system-font-cache-dirs=PATHS],[Directory where the system font cache is, [default=/var/cache/fontconfig:/usr/lib/fontconfig/cache]]),
  151             with_system_font_cache_dirs="$withval", with_system_font_cache_dirs=/var/cache/fontconfig:/usr/lib/fontconfig/cache)
  152 SYSTEM_FONT_CACHE_DIRS=$with_system_font_cache_dirs
  153 AC_SUBST(SYSTEM_FONT_CACHE_DIRS)
  154 
  155 AC_ARG_WITH(profile_dir,
  156 		AS_HELP_STRING([--with-profile-dir=PATH],[choose directory for profile.d files, [default=SYSCONFDIR/profile.d]]),
  157             with_profile_dir="$withval", with_profile_dir=${sysconfdir}/profile.d)
  158 PROFILE_DIR=$with_profile_dir
  159 AC_SUBST(PROFILE_DIR)
  160 
  161 AC_ARG_VAR([BWRAP], [Bubblewrap executable])
  162 AC_ARG_WITH([system-bubblewrap],
  163             [AS_HELP_STRING([--with-system-bubblewrap], [Use system bwrap executable [default=check $BWRAP]])],
  164             [BWRAP="$withval"],
  165             [BWRAP="${BWRAP:-false}"])
  166 CAP_LIB=
  167 AS_CASE([$BWRAP],
  168         [yes],
  169             [BWRAP=bwrap],
  170         [no],
  171             [BWRAP=false],
  172         [auto],
  173             [AC_CHECK_PROG([BWRAP], [bwrap], [bwrap], [false])])
  174 if test "x$BWRAP" != xfalse; then
  175    BWRAP_VERSION=`$BWRAP --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
  176    AX_COMPARE_VERSION([$SYSTEM_BWRAP_REQS],[gt],[$BWRAP_VERSION],
  177                       [AC_MSG_ERROR([You need at least version $SYSTEM_BWRAP_REQS of bubblewrap to use the system installed version])])
  178    AM_CONDITIONAL([WITH_SYSTEM_BWRAP], [true])
  179 else
  180    AC_CHECK_LIB(cap, cap_from_text, CAP_LIB=-lcap)
  181    if test "$ac_cv_lib_cap_cap_from_text" != "yes"; then
  182       AC_MSG_ERROR([*** libcap needed by bubblewrap but not found])
  183    fi
  184 
  185    AM_CONDITIONAL([WITH_SYSTEM_BWRAP], [false])
  186 fi
  187 AC_SUBST([CAP_LIB])
  188 
  189 AC_ARG_VAR([DBUS_PROXY], [dbus-proxy executable])
  190 AC_ARG_WITH([system-dbus-proxy],
  191             [AS_HELP_STRING([--with-system-dbus-proxy], [Use system xdg-dbus-proxy executable [default=check $DBUS_PROXY]])],
  192             [DBUS_PROXY="$withval"],
  193             [DBUS_PROXY="${DBUS_PROXY:-false}"])
  194 AS_CASE([$DBUS_PROXY],
  195         [yes],
  196             [DBUS_PROXY=xdg-dbus-proxy],
  197         [no],
  198             [DBUS_PROXY=false],
  199         [auto],
  200             [AC_CHECK_PROG([DBUS_PROXY], [xdg-dbus-proxy], [xdg-dbus-proxy], [false])])
  201 if test "x$DBUS_PROXY" != xfalse; then
  202    DBUS_PROXY_VERSION=[$( $DBUS_PROXY --version  | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,')]
  203    AX_COMPARE_VERSION([$SYSTEM_DBUS_PROXY_REQS],[gt],[$DBUS_PROXY_VERSION],
  204                       [AC_MSG_ERROR([You need at least version $SYSTEM_DBUS_PROXY_REQS of xdg-dbus-proxy to use the system installed version (have $DBUS_PROXY_VERSION)])])
  205    AM_CONDITIONAL([WITH_SYSTEM_DBUS_PROXY], [true])
  206 else
  207    AM_CONDITIONAL([WITH_SYSTEM_DBUS_PROXY], [false])
  208 fi
  209 
  210 
  211 AC_CHECK_FUNCS(fdwalk)
  212 LIBGLNX_CONFIGURE
  213 
  214 AC_CHECK_HEADER([sys/xattr.h], [], [AC_MSG_ERROR([You must have sys/xattr.h from glibc])])
  215 AC_CHECK_HEADER([sys/capability.h], have_caps=yes, [AC_MSG_ERROR([sys/capability.h header not found])])
  216 
  217 AC_SUBST([GLIB_MKENUMS], [`$PKG_CONFIG --variable glib_mkenums glib-2.0`])
  218 AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`])
  219 AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
  220 
  221 POLKIT_GOBJECT_REQUIRED=0.98
  222 
  223 PKG_CHECK_MODULES(ARCHIVE, [libarchive >= 2.8.0])
  224 PKG_CHECK_MODULES(BASE, [glib-2.0 >= $GLIB_REQS gio-2.0 gio-unix-2.0])
  225 PKG_CHECK_MODULES(SOUP, [libsoup-2.4])
  226 PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.4])
  227 PKG_CHECK_MODULES(ZSTD, [libzstd >= 0.8.1], [have_zstd=yes], [have_zstd=no])
  228 if test $have_zstd = yes; then
  229   AC_DEFINE(HAVE_ZSTD, 1, [Define if libzstd is available])
  230 fi
  231 PKG_CHECK_MODULES(DCONF, [dconf >= 0.26], [have_dconf=yes], [have_dconf=no])
  232 if test $have_dconf = yes; then
  233   AC_DEFINE(HAVE_DCONF, 1, [Define if dconf is available])
  234 fi
  235 AC_ARG_WITH([systemd], AS_HELP_STRING([--with-systemd],
  236     [Build with systemd support [default=auto]]), [], [with_systemd=auto],)
  237 if test "x$with_systemd" != "xno"; then
  238   PKG_CHECK_MODULES(SYSTEMD, [libsystemd], [have_libsystemd=yes], [have_libsystemd=no])
  239   if test $have_libsystemd = yes; then
  240     AC_DEFINE(HAVE_LIBSYSTEMD, 1, [Define if libsystemd is available])
  241   elif test "x$with_systemd" == "xyes"; then
  242     AC_MSG_ERROR([systemd was requested but it could not be found])
  243   fi
  244 else
  245   have_libsystemd=no
  246 fi
  247 PKG_CHECK_MODULES([MALCONTENT], [malcontent-0 >= 0.4.0], [have_libmalcontent=yes], [have_libmalcontent=no])
  248 AS_IF([test "$have_libmalcontent" = "yes"],[
  249   AC_DEFINE([HAVE_LIBMALCONTENT], [1], [Define if libmalcontent is available])
  250 ])
  251 AM_CONDITIONAL([HAVE_LIBMALCONTENT],[test "$have_libmalcontent" = "yes"])
  252 
  253 PKG_CHECK_MODULES(GLIB260, glib-2.0 >= 2.60,
  254                   [AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_60, [Ignore massive GTimeVal deprecation warnings in 2.62])],
  255                   [true])
  256 
  257 save_LIBS=$LIBS
  258 LIBS=$ARCHIVE_LIBS
  259 AC_CHECK_FUNCS(archive_read_support_filter_all)
  260 LIBS=$save_LIBS
  261 
  262 LIBGPGME_DEPENDENCY="1.1.8"
  263 PKG_CHECK_MODULES(DEP_GPGME, gpgme-pthread >= $LIBGPGME_DEPENDENCY, have_gpgme=yes, [
  264     m4_ifdef([AM_PATH_GPGME_PTHREAD], [
  265        AM_PATH_GPGME_PTHREAD($LIBGPGME_DEPENDENCY, have_gpgme=yes, have_gpgme=no)
  266     ],[ have_gpgme=no ])
  267 ])
  268 AS_IF([ test x$have_gpgme = xno ], [
  269    AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later])
  270 ])
  271 
  272 AC_ARG_ENABLE(selinux-module,
  273         [AS_HELP_STRING([--enable-selinux-module],[Enable selinux module for system-helper])],
  274         enable_selinux_module=$enableval, enable_selinux_module=auto)
  275 if test x$enable_selinux_module = xauto ; then
  276    AC_CHECK_FILE([/usr/share/selinux/devel/Makefile], [enable_selinux_module=yes],  [enable_selinux_module=no])
  277 fi
  278 if test x$enable_selinux_module = xyes ; then
  279    AC_CHECK_FILE([/usr/share/selinux/devel/Makefile], [],  [AC_MSG_ERROR([selinux-policy-devel needed to build selinux module])])
  280 fi
  281 AM_CONDITIONAL(BUILD_SELINUX_MODULE, test x$enable_selinux_module = xyes)
  282 
  283 AC_ARG_ENABLE([system-helper],
  284               AC_HELP_STRING([--disable-system-helper],
  285                              [Disable system helper]),
  286               [],
  287               [enable_system_helper=yes])
  288 if test "x$enable_system_helper" = "xyes"; then
  289   PKG_CHECK_MODULES(POLKIT, \
  290 		    polkit-agent-1 >= $POLKIT_GOBJECT_REQUIRED)
  291   AC_DEFINE([USE_SYSTEM_HELPER], [1], [Define if using system-helper])
  292 fi
  293 AM_CONDITIONAL(BUILD_SYSTEM_HELPER, test x$enable_system_helper = xyes)
  294 
  295 AC_ARG_ENABLE([auto-sideloading],
  296               AC_HELP_STRING([--enable-auto-sideloading],
  297                              [Enable systemd units which make Flatpak sideload from inserted USB drives]),
  298               [],
  299               [enable_auto_sideloading=no])
  300 AM_CONDITIONAL(BUILD_AUTO_SIDELOADING, test x$enable_auto_sideloading = xyes)
  301 
  302 PKG_CHECK_MODULES(FUSE, fuse >= 2.9.2)
  303 
  304 AC_ARG_ENABLE([xauth],
  305               AC_HELP_STRING([--disable-xauth],
  306                              [Disable Xauth use]),
  307               [],
  308               [enable_xauth=yes])
  309 if test "x$enable_xauth" = "xyes"; then
  310    PKG_CHECK_MODULES(XAUTH, [xau])
  311    AC_DEFINE([ENABLE_XAUTH], [1],
  312       [Define if using xauth])
  313 fi
  314 
  315 AC_ARG_ENABLE([gdm-env-file],
  316               [AC_HELP_STRING([--enable-gdm-env-file], [Install gdm env.d file (not needed if systemd generators work)])],
  317               install_gdm_env_file=$enableval, install_gdm_env_file=no)
  318 AM_CONDITIONAL(INSTALL_GDM_ENV_FILE, test x$install_gdm_env_file = xyes)
  319 
  320 AC_ARG_ENABLE([sandboxed-triggers],
  321               AC_HELP_STRING([--disable-sandboxed-triggers],
  322                              [Disable sandboxed triggers]),
  323               [],
  324               [enable_sandboxed_triggers=yes])
  325 if test "x$enable_sandboxed_triggers" = "xno"; then
  326    AC_DEFINE([DISABLE_SANDBOXED_TRIGGERS], [1],
  327       [Define if sandboxed triggers are disabled])
  328 fi
  329 
  330 PKG_CHECK_MODULES(OSTREE, [ostree-1 >= $OSTREE_REQS])
  331 
  332 PKG_CHECK_MODULES(JSON, [json-glib-1.0])
  333 
  334 PKG_CHECK_MODULES(APPSTREAM_GLIB, [appstream-glib >= 0.5.10])
  335 
  336 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0])
  337 
  338 AC_ARG_ENABLE([seccomp],
  339               AC_HELP_STRING([--disable-seccomp],
  340                              [Disable seccomp]),
  341               [],
  342               [enable_seccomp=yes])
  343 
  344 if test "x$enable_seccomp" = "xyes"; then
  345    PKG_CHECK_MODULES(LIBSECCOMP, [libseccomp])
  346    AC_DEFINE([ENABLE_SECCOMP], [1],
  347       [Define if using seccomp])
  348 fi
  349 
  350 AC_ARG_WITH(priv-mode,
  351             AS_HELP_STRING([--with-priv-mode=setuid/none],
  352                            [How to set privilege-raising during install (only needed if userns not working)]),
  353             [],
  354             [with_priv_mode="none"])
  355 
  356 AM_CONDITIONAL(PRIV_MODE_SETUID, test "x$with_priv_mode" = "xsetuid")
  357 
  358 AC_ARG_ENABLE(sudo,
  359               AS_HELP_STRING([--enable-sudo],[Use sudo to set setuid flags on binaries during install (only needed if userns disabled)]),
  360               [SUDO_BIN="sudo"], [SUDO_BIN=""])
  361 AC_SUBST([SUDO_BIN])
  362 
  363 AC_ARG_ENABLE(asan,
  364               [AS_HELP_STRING([--enable-asan],
  365                               [Use build with address sanitazion])],
  366               [],
  367               [enable_asan=no])
  368 AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = xyes])
  369 
  370 AC_ARG_WITH(system-install-dir,
  371            [AS_HELP_STRING([--with-system-install-dir=DIR],
  372                            [Location of system installation [LOCALSTATEDIR/lib/flatpak]])],
  373            [],
  374            [with_system_install_dir='$(localstatedir)/lib/flatpak'])
  375 SYSTEM_INSTALL_DIR=$with_system_install_dir
  376 AC_SUBST(SYSTEM_INSTALL_DIR)
  377 
  378 AC_ARG_WITH(run-media-dir,
  379            [AS_HELP_STRING([--with-run-media-dir=DIR],
  380                            [Location of auto-mounted USB drives [/run/media]])],
  381            [],
  382            [with_run_media_dir='/run/media'])
  383 RUN_MEDIA_DIR=$with_run_media_dir
  384 AC_SUBST(RUN_MEDIA_DIR)
  385 
  386 AC_ARG_WITH([sysusersdir],
  387             [AS_HELP_STRING([--with-sysusersdir=DIR],
  388                             [Directory for systemd sysusers.d configuration files (default=PREFIX/lib/sysusers.d)])],
  389     [],
  390     dnl This is deliberately not ${libdir}: systemd units always go in
  391     dnl .../lib, never .../lib64 or .../lib/x86_64-linux-gnu
  392     [with_sysusersdir='${prefix}/lib/sysusers.d'])
  393 AC_SUBST([sysusersdir], [$with_sysusersdir])
  394 
  395 AC_ARG_WITH(system-helper-user,
  396            [AS_HELP_STRING([--with-system-helper-user=USERNAME],
  397                            [Name of the system helper user])],
  398            with_system_helper_user="$withval", with_system_helper_user=flatpak)
  399 SYSTEM_HELPER_USER=$with_system_helper_user
  400 AC_SUBST(SYSTEM_HELPER_USER)
  401 
  402 AC_ARG_ENABLE(documentation,
  403               AC_HELP_STRING([--enable-documentation], [Build documentation]),,
  404               enable_documentation=yes)
  405 if test x$enable_documentation = xyes; then
  406    AC_PATH_PROG([XSLTPROC], [xsltproc])
  407    if test x$XSLTPROC = x; then
  408       AC_MSG_ERROR([xsltproc is required to build documentation])
  409    fi
  410 
  411   dnl check for DocBook DTD in the local catalog
  412   JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.5//EN],
  413      [DocBook XML DTD V4.5], [have_docbook_dtd=yes], [have_docbook_dtd=no])
  414   if test "$have_docbook_dtd" != yes; then
  415     AC_MSG_ERROR([DocBook DTD is required for --enable-documentation])
  416   fi
  417 
  418   dnl check for DocBook XSL stylesheets in the local catalog
  419   JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
  420      [DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no])
  421   if test "$have_docbook_style" != yes; then
  422     AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-documentation])
  423   fi
  424 fi
  425 AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes)
  426 
  427 GOBJECT_INTROSPECTION_CHECK([1.40.0])
  428 
  429 # gtkdocize greps for ^GTK_DOC_CHECK, so we need to put it on its own line
  430 m4_ifdef([GTK_DOC_CHECK], [
  431 GTK_DOC_CHECK([1.20], [--flavour no-tmpl])
  432 
  433 AC_ARG_ENABLE([gtk-doc-check],
  434               [AS_HELP_STRING([--enable-gtk-doc-check],
  435                               [Check completeness of documentation in 'make check'])],
  436     [],
  437     [enable_gtk_doc_check=no])
  438 ],[
  439 enable_gtk_doc="disabled (no gtk-doc)"
  440 enable_gtk_doc_check="disabled (no gtk-doc)"
  441 AM_CONDITIONAL([ENABLE_GTK_DOC], [false])
  442 ])
  443 AM_CONDITIONAL([ENABLE_GTK_DOC_CHECK], [test "x$enable_gtk_doc_check" = xyes])
  444 
  445 
  446 AC_ARG_ENABLE(docbook-docs,
  447         [AS_HELP_STRING([--enable-docbook-docs],[build documentation (requires xmlto)])],
  448         enable_docbook_docs=$enableval, enable_docbook_docs=auto)
  449 AC_PATH_PROG(XMLTO, xmlto, no)
  450 AC_MSG_CHECKING([whether to build DocBook documentation])
  451 if test x$XMLTO = xno ; then
  452         have_docbook=no
  453 else
  454         have_docbook=yes
  455 fi
  456 if test x$enable_docbook_docs = xauto ; then
  457         if test x$have_docbook = xno ; then
  458                 enable_docbook_docs=no
  459         else
  460                 enable_docbook_docs=yes
  461         fi
  462 fi
  463 if test x$enable_docbook_docs = xyes; then
  464         if test x$have_docbook = xno; then
  465                 AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
  466         fi
  467         AC_MSG_RESULT(yes)
  468 else
  469         AC_MSG_RESULT(no)
  470 fi
  471 AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
  472 AC_ARG_VAR([XMLTO],[Define/override the 'xmlto' location.])
  473 AC_ARG_VAR([XMLTO_FLAGS],[Define/override 'xmlto' options, like '--skip-validation'.])
  474 
  475 
  476 ##################################################
  477 # Visibility handling
  478 ##################################################
  479 
  480 HIDDEN_VISIBILITY_CFLAGS=""
  481 case "$host" in
  482   *)
  483     dnl on other compilers, check if we can do -fvisibility=hidden
  484     SAVED_CFLAGS="${CFLAGS}"
  485     CFLAGS="-fvisibility=hidden"
  486     AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
  487     AC_TRY_COMPILE([], [int main (void) { return 0; }],
  488                    AC_MSG_RESULT(yes)
  489                    enable_fvisibility_hidden=yes,
  490                    AC_MSG_RESULT(no)
  491                    enable_fvisibility_hidden=no)
  492     CFLAGS="${SAVED_CFLAGS}"
  493 
  494     AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
  495       AC_DEFINE([FLATPAK_EXTERN], [__attribute__((visibility("default"))) extern],
  496                 [defines how to decorate public symbols while building])
  497       HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
  498     ], [
  499       AC_DEFINE([FLATPAK_EXTERN], [extern],
  500                 [defines how to decorate public symbols while building])
  501     ])
  502     ;;
  503 esac
  504 AC_SUBST(HIDDEN_VISIBILITY_CFLAGS)
  505 
  506 ##########################################
  507 # Coverage testing
  508 ##########################################
  509 AC_ARG_ENABLE(coverage,
  510   AS_HELP_STRING([--enable-coverage],
  511                  [enable coverage testing with gcov]),
  512   [use_lcov=$enableval], [use_lcov=no])
  513 
  514 if test x$use_lcov = xyes; then
  515   AC_PATH_PROG(LCOV, lcov)
  516   AC_PATH_PROG(GENHTML, genhtml)
  517 
  518   # remove all optimization from CFLAGS
  519   changequote({,})
  520   CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
  521   changequote([,])
  522 
  523   CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
  524   LDFLAGS="$LDFLAGS -lgcov"
  525 fi
  526 
  527 AC_ARG_ENABLE(internal-checks,
  528   AS_HELP_STRING([--enable-internal-checks],
  529                  [enable internal checking]),
  530   [use_internal_checks=$enableval], [use_internal_checks=no])
  531 
  532 if test x$use_internal_checks = xyes; then
  533    AM_CONDITIONAL([ENABLE_INTERNAL_CHECKS], [true])
  534 else
  535    AM_CONDITIONAL([ENABLE_INTERNAL_CHECKS], [false])
  536 fi
  537 
  538 GLIB_TESTS
  539 
  540 FLATPAK_MAJOR_VERSION=flatpak_major_version
  541 FLATPAK_MINOR_VERSION=flatpak_minor_version
  542 FLATPAK_MICRO_VERSION=flatpak_micro_version
  543 FLATPAK_EXTRA_VERSION=flatpak_extra_version
  544 FLATPAK_INTERFACE_AGE=flatpak_interface_age
  545 FLATPAK_VERSION=flatpak_version
  546 AC_SUBST(FLATPAK_MAJOR_VERSION)
  547 AC_SUBST(FLATPAK_MINOR_VERSION)
  548 AC_SUBST(FLATPAK_MICRO_VERSION)
  549 AC_SUBST(FLATPAK_INTERFACE_AGE)
  550 AC_SUBST(FLATPAK_VERSION)
  551 AC_DEFINE_UNQUOTED([PACKAGE_MAJOR_VERSION], $FLATPAK_MAJOR_VERSION, [Major version])
  552 AC_DEFINE_UNQUOTED([PACKAGE_MINOR_VERSION], $FLATPAK_MINOR_VERSION, [Minor version])
  553 AC_DEFINE_UNQUOTED([PACKAGE_MICRO_VERSION], $FLATPAK_MICRO_VERSION, [Micro version])
  554 AC_DEFINE_UNQUOTED([PACKAGE_EXTRA_VERSION], $FLATPAK_EXTRA_VERSION, [Extra version])
  555 
  556 # libtool versioning
  557 #LT_RELEASE=$FLATPAK_MAJOR_VERSION.$FLATPAK_MINOR_VERSION
  558 #LT_CURRENT=`expr $FLATPAK_MICRO_VERSION - $FLATPAK_INTERFACE_AGE`
  559 #LT_REVISION=$FLATPAK_INTERFACE_AGE
  560 #LT_AGE=`expr $FLATPAK_BINARY_AGE - $FLATPAK_INTERFACE_AGE`
  561 #LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
  562 
  563 m4_define([lt_current], [m4_eval(10000 * flatpak_major_version +  100 * flatpak_minor_version + flatpak_micro_version - flatpak_interface_age)])
  564 m4_define([lt_revision], [flatpak_interface_age])
  565 m4_define([lt_age], [m4_eval(flatpak_binary_age - flatpak_interface_age)])
  566 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
  567 LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
  568 AC_SUBST(LT_VERSION_INFO)
  569 AC_SUBST(LT_CURRENT_MINUS_AGE)
  570 
  571 AC_CONFIG_FILES([
  572 Makefile
  573 doc/Makefile
  574 doc/reference/Makefile
  575 flatpak.pc
  576 common/flatpak-version-macros.h
  577 doc/reference/version.xml
  578 doc/flatpak-docs.xml
  579 po/Makefile.in
  580 ])
  581 AC_OUTPUT
  582 
  583 if test x$BWRAP = xfalse ; then
  584   build_bwrap="yes"
  585 else
  586   build_bwrap="no"
  587 fi
  588 
  589 if test x$DBUS_PROXY = xfalse ; then
  590   build_dbus_proxy="yes"
  591 else
  592   build_dbus_proxy="no"
  593 fi
  594 
  595 echo ""
  596 echo "          Flatpak $FLATPAK_VERSION"
  597 echo "          =============="
  598 echo ""
  599 echo "          Build system helper:    $enable_system_helper"
  600 echo "          Build selinux module:   $enable_selinux_module"
  601 echo "          Build bubblewrap:       $build_bwrap"
  602 echo "          Build dbus-proxy:       $build_dbus_proxy"
  603 echo "          Use sandboxed triggers: $enable_sandboxed_triggers"
  604 echo "          Use seccomp:            $enable_seccomp"
  605 echo "          Privileged group:       $PRIVILEGED_GROUP"
  606 echo "          Privilege mode:         $with_priv_mode"
  607 echo "          Use dconf:              $have_dconf"
  608 echo "          Use libsystemd:         $have_libsystemd"
  609 echo "          Use libmalcontent:      $have_libmalcontent"
  610 echo "          Use libzstd:            $have_zstd"
  611 echo "          Use auto sideloading:   $enable_auto_sideloading"
  612 echo ""