2010-11-06 01:55:27 +01:00
AC_PREREQ([2.64])
2012-04-11 16:59:05 +01:00
2016-01-19 14:54:32 -08:00
m4_define([wayland_major_version], [1])
2021-01-27 17:48:01 +01:00
m4_define([wayland_minor_version], [19])
2021-01-27 18:45:57 +01:00
m4_define([wayland_micro_version], [90])
2012-04-11 16:59:05 +01:00
m4_define([wayland_version],
[wayland_major_version.wayland_minor_version.wayland_micro_version])
2010-11-06 01:55:27 +01:00
AC_INIT([wayland],
2012-04-11 16:59:05 +01:00
[wayland_version],
2018-06-09 00:49:33 +01:00
[https://gitlab.freedesktop.org/wayland/wayland/issues/],
2010-11-06 01:55:27 +01:00
[wayland],
2018-06-09 00:49:33 +01:00
[https://wayland.freedesktop.org/])
2010-11-06 01:55:27 +01:00
2012-04-11 16:59:05 +01:00
AC_SUBST([WAYLAND_VERSION_MAJOR], [wayland_major_version])
AC_SUBST([WAYLAND_VERSION_MINOR], [wayland_minor_version])
AC_SUBST([WAYLAND_VERSION_MICRO], [wayland_micro_version])
AC_SUBST([WAYLAND_VERSION], [wayland_version])
2010-10-25 11:40:03 -04:00
AC_CONFIG_HEADERS([config.h])
2010-11-06 01:55:27 +01:00
AC_CONFIG_MACRO_DIR([m4])
2014-03-06 23:15:02 -08:00
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
2010-11-06 01:55:27 +01:00
2010-10-12 17:24:20 -04:00
AM_SILENT_RULES([yes])
2008-12-04 22:48:50 -05:00
2010-11-06 01:55:27 +01:00
# Check for programs
AC_PROG_CC
2014-12-15 11:33:53 +01:00
AC_PROG_CXX
2015-01-28 17:24:04 -08:00
AC_PROG_GREP
2015-11-10 09:53:08 +10:00
AM_PROG_AS
2018-02-23 17:31:53 +00:00
AC_PROG_NM
2014-12-15 11:33:53 +01:00
# check if we have C++ compiler. This is hacky workaround,
# for a reason why it is this way see
# http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
have_cpp_compiler=yes
if ! which "$CXX" &>/dev/null; then
have_cpp_compiler=no
fi
AM_CONDITIONAL(ENABLE_CPP_TEST, test "x$have_cpp_compiler" = "xyes")
2010-11-06 01:55:27 +01:00
# Initialize libtool
LT_PREREQ([2.2])
2018-03-13 13:43:37 +00:00
LT_INIT([disable-static])
2010-11-06 01:55:27 +01:00
2008-12-04 22:48:50 -05:00
PKG_PROG_PKG_CONFIG()
2016-01-15 13:33:52 -06:00
AC_ARG_ENABLE([fatal-warnings],
AC_HELP_STRING([--enable-fatal-warnings],
[Build with -Werror]),
[enable_fatal_warnings=$enableval],
[enable_fatal_warnings=no])
AS_IF([test x"$enable_fatal_warnings" != "xno"], [
WERROR_CFLAGS="-Werror"
])
2011-01-28 13:47:21 +00:00
if test "x$GCC" = "xyes"; then
2016-01-15 13:33:52 -06:00
GCC_CFLAGS="$WERROR_CFLAGS -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
2008-12-04 22:48:50 -05:00
fi
AC_SUBST(GCC_CFLAGS)
2018-02-14 14:22:23 +02:00
AC_CHECK_HEADERS([sys/prctl.h])
2019-10-25 21:03:23 -05:00
AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl memfd_create strndup])
2012-03-22 14:16:10 +02:00
2019-02-25 19:38:02 +02:00
# *BSD don't have libdl, but they have its functions in libc
WESTON_SEARCH_LIBS([DL], [dl], [dlsym])
# OpenBSD doesn't have librt, but it has its functions in libc
WESTON_SEARCH_LIBS([RT], [rt], [clock_gettime])
2015-06-17 15:13:50 -05:00
AC_ARG_ENABLE([libraries],
[AC_HELP_STRING([--disable-libraries],
[Disable compilation of wayland libraries])],
[],
[enable_libraries=yes])
2013-06-04 13:27:49 +01:00
2015-07-01 22:51:01 +01:00
AC_ARG_WITH([host-scanner],
[AC_HELP_STRING([--with-host-scanner],
[Use installed wayland-scanner from host PATH during build])],
2011-05-06 06:13:36 +00:00
[],
2015-07-01 22:51:01 +01:00
[with_host_scanner=no])
2011-05-06 06:13:36 +00:00
2012-03-17 19:09:39 +02:00
AC_ARG_ENABLE([documentation],
[AC_HELP_STRING([--disable-documentation],
[Disable building the documentation])],
[],
[enable_documentation=yes])
2015-11-10 09:53:08 +10:00
AC_ARG_ENABLE([dtd-validation],
[AC_HELP_STRING([--disable-dtd-validation],
[Disable DTD validation of the protocol])],
[],
2016-02-29 14:59:51 +02:00
[enable_dtd_validation=yes])
2015-11-10 09:53:08 +10:00
2015-07-01 22:51:01 +01:00
AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
2011-05-06 06:13:36 +00:00
2015-06-17 15:13:50 -05:00
AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
2012-06-08 11:58:02 +03:00
AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
[ ICONDIR=$withval],
[ ICONDIR=${datadir}/icons])
AC_SUBST([ICONDIR])
2015-06-17 15:13:50 -05:00
if test "x$enable_libraries" = "xyes"; then
2015-06-17 15:13:52 -05:00
PKG_CHECK_MODULES(FFI, [libffi])
2015-06-17 15:13:50 -05:00
AC_CHECK_DECL(SFD_CLOEXEC,[],
[AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland libraries")],
[[#include <sys/signalfd.h>]])
AC_CHECK_DECL(TFD_CLOEXEC,[],
[AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland libraries")],
[[#include <sys/timerfd.h>]])
AC_CHECK_DECL(CLOCK_MONOTONIC,[],
[AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")],
[[#include <time.h>]])
fi
2018-07-21 12:04:13 +01:00
PKG_CHECK_MODULES(EXPAT, [expat])
2010-08-03 09:26:44 -04:00
2016-02-29 14:59:51 +02:00
AM_CONDITIONAL([DTD_VALIDATION], [test "x$enable_dtd_validation" = "xyes"])
if test "x$enable_dtd_validation" = "xyes"; then
2015-11-10 09:53:08 +10:00
PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
AC_DEFINE(HAVE_LIBXML, 1, [libxml-2.0 is available])
AC_CONFIG_LINKS([src/wayland.dtd.embed:protocol/wayland.dtd])
fi
2012-02-23 15:58:37 +10:00
AC_PATH_PROG(XSLTPROC, xsltproc)
2012-02-29 12:49:25 -05:00
AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
2012-02-23 15:58:37 +10:00
2012-12-01 17:33:23 +01:00
2012-10-12 20:54:45 +03:00
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_documentation = xyes])
2012-03-17 19:09:39 +02:00
if test "x$enable_documentation" = "xyes"; then
2012-10-12 20:54:45 +03:00
AC_PATH_PROG(DOXYGEN, doxygen)
if test "x$DOXYGEN" = "x"; then
AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation])
fi
2014-12-03 18:26:26 -08:00
AC_MSG_CHECKING([for compatible doxygen version])
doxygen_version=`$DOXYGEN --version`
AS_VERSION_COMPARE([$doxygen_version], [1.6.0],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Doxygen $doxygen_version too old. Doxygen 1.6+ required for documentation build. Install required doxygen version or disable the documentation using --disable-documentation])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([yes])])
2014-09-04 17:32:10 +10:00
AC_PATH_PROG(XMLTO, xmlto)
2012-10-11 17:42:09 +03:00
2014-09-04 17:32:10 +10:00
if test "x$XMLTO" = "x"; then
AC_MSG_ERROR([Documentation build requested but xmlto not found. Install xmlto or disable the documentation using --disable-documentation])
2012-10-19 18:29:54 +03:00
fi
2015-01-28 17:24:04 -08:00
AC_PATH_PROG(DOT, dot)
if test "x$DOT" = "x"; then
AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation])
fi
AC_MSG_CHECKING([for compatible dot version])
2015-04-02 19:20:00 -07:00
dot_version=`$DOT -V 2>&1|$GREP -o ['[0-9]*\.[0-9]*\.[0-9]*']`
2015-01-28 17:24:04 -08:00
AS_VERSION_COMPARE([$dot_version], [2.26.0],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([yes])])
2019-04-19 19:31:08 +05:30
AC_MSG_CHECKING([for docbook stylesheets])
DOCS_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$DOCS_STYLESHEET" > /dev/null 2>&1`],
[HAVE_DOCS_STYLESHEET=yes]))
if test "x$HAVE_DOCS_STYLESHEET" != "xyes"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Documentation build requested but docbook-xsl stylesheets are not found. Install the docbook-xsl package or disable the documentation using --disable-documentation])
fi
AC_MSG_RESULT([yes])
AC_SUBST(DOCS_STYLESHEET)
2012-10-11 17:42:09 +03:00
AC_CONFIG_FILES([
doc/doxygen/wayland.doxygen
])
2012-03-17 19:09:39 +02:00
fi
2014-09-04 17:32:10 +10:00
AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
2012-02-24 09:42:05 +10:00
2011-02-14 22:17:41 -05:00
AC_CONFIG_FILES([Makefile
2012-05-22 15:39:41 +03:00
cursor/wayland-cursor.pc
2012-05-29 16:53:20 +03:00
cursor/wayland-cursor-uninstalled.pc
2012-02-24 09:42:05 +10:00
doc/Makefile
2013-04-03 15:43:34 -04:00
doc/publican/Makefile
2012-10-11 17:42:09 +03:00
doc/doxygen/Makefile
2017-10-10 14:43:48 +01:00
egl/wayland-egl.pc
egl/wayland-egl-backend.pc
2012-05-29 16:53:20 +03:00
src/wayland-server-uninstalled.pc
src/wayland-client-uninstalled.pc
2013-07-02 18:38:15 +09:00
src/wayland-scanner-uninstalled.pc
2011-08-12 15:09:00 -04:00
src/wayland-server.pc
2012-02-23 15:58:37 +10:00
src/wayland-client.pc
2013-07-02 18:38:15 +09:00
src/wayland-scanner.pc
2014-03-07 00:00:18 -08:00
src/wayland-version.h])
2008-12-10 13:44:23 -05:00
AC_OUTPUT