1AC_PREREQ([2.64]) 2 3m4_define([wayland_major_version], [1]) 4m4_define([wayland_minor_version], [12]) 5m4_define([wayland_micro_version], [90]) 6m4_define([wayland_version], 7 [wayland_major_version.wayland_minor_version.wayland_micro_version]) 8 9AC_INIT([wayland], 10 [wayland_version], 11 [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=wayland&version=wayland_version], 12 [wayland], 13 [http://wayland.freedesktop.org/]) 14 15AC_SUBST([WAYLAND_VERSION_MAJOR], [wayland_major_version]) 16AC_SUBST([WAYLAND_VERSION_MINOR], [wayland_minor_version]) 17AC_SUBST([WAYLAND_VERSION_MICRO], [wayland_micro_version]) 18AC_SUBST([WAYLAND_VERSION], [wayland_version]) 19 20AC_CONFIG_HEADERS([config.h]) 21AC_CONFIG_MACRO_DIR([m4]) 22 23AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects]) 24 25AM_SILENT_RULES([yes]) 26 27# Check for programs 28AC_PROG_CC 29AC_PROG_CXX 30AC_PROG_GREP 31AM_PROG_AS 32 33# check if we have C++ compiler. This is hacky workaround, 34# for a reason why it is this way see 35# http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html 36have_cpp_compiler=yes 37 38if ! which "$CXX" &>/dev/null; then 39 have_cpp_compiler=no 40fi 41 42AM_CONDITIONAL(ENABLE_CPP_TEST, test "x$have_cpp_compiler" = "xyes") 43 44# Initialize libtool 45LT_PREREQ([2.2]) 46LT_INIT 47 48PKG_PROG_PKG_CONFIG() 49 50AC_ARG_ENABLE([fatal-warnings], 51 AC_HELP_STRING([--enable-fatal-warnings], 52 [Build with -Werror]), 53 [enable_fatal_warnings=$enableval], 54 [enable_fatal_warnings=no]) 55AS_IF([test x"$enable_fatal_warnings" != "xno"], [ 56 WERROR_CFLAGS="-Werror" 57]) 58 59if test "x$GCC" = "xyes"; then 60 GCC_CFLAGS="$WERROR_CFLAGS -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden" 61fi 62AC_SUBST(GCC_CFLAGS) 63 64AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate]) 65 66AC_ARG_ENABLE([libraries], 67 [AC_HELP_STRING([--disable-libraries], 68 [Disable compilation of wayland libraries])], 69 [], 70 [enable_libraries=yes]) 71 72AC_ARG_WITH([host-scanner], 73 [AC_HELP_STRING([--with-host-scanner], 74 [Use installed wayland-scanner from host PATH during build])], 75 [], 76 [with_host_scanner=no]) 77 78AC_ARG_ENABLE([documentation], 79 [AC_HELP_STRING([--disable-documentation], 80 [Disable building the documentation])], 81 [], 82 [enable_documentation=yes]) 83 84AC_ARG_ENABLE([dtd-validation], 85 [AC_HELP_STRING([--disable-dtd-validation], 86 [Disable DTD validation of the protocol])], 87 [], 88 [enable_dtd_validation=yes]) 89 90AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes) 91 92AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes) 93 94AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here], 95 [ ICONDIR=$withval], 96 [ ICONDIR=${datadir}/icons]) 97AC_SUBST([ICONDIR]) 98 99if test "x$enable_libraries" = "xyes"; then 100 PKG_CHECK_MODULES(FFI, [libffi]) 101 AC_CHECK_DECL(SFD_CLOEXEC,[], 102 [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland libraries")], 103 [[#include <sys/signalfd.h>]]) 104 AC_CHECK_DECL(TFD_CLOEXEC,[], 105 [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland libraries")], 106 [[#include <sys/timerfd.h>]]) 107 AC_CHECK_DECL(CLOCK_MONOTONIC,[], 108 [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")], 109 [[#include <time.h>]]) 110 AC_CHECK_HEADERS([execinfo.h]) 111fi 112 113PKG_CHECK_MODULES(EXPAT, [expat], [], 114 [AC_CHECK_HEADERS(expat.h, [], 115 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])]) 116 SAVE_LIBS="$LIBS" 117 AC_SEARCH_LIBS(XML_ParserCreate, expat, [], 118 [AC_MSG_ERROR([Can't find expat library. Please install expat.])]) 119 EXPAT_LIBS="$LIBS" 120 LIBS="$SAVE_LIBS" 121 AC_SUBST(EXPAT_LIBS) 122 ]) 123 124AM_CONDITIONAL([DTD_VALIDATION], [test "x$enable_dtd_validation" = "xyes"]) 125if test "x$enable_dtd_validation" = "xyes"; then 126 PKG_CHECK_MODULES(LIBXML, [libxml-2.0]) 127 AC_DEFINE(HAVE_LIBXML, 1, [libxml-2.0 is available]) 128 AC_CONFIG_LINKS([src/wayland.dtd.embed:protocol/wayland.dtd]) 129fi 130 131AC_PATH_PROG(XSLTPROC, xsltproc) 132AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"]) 133 134AC_MSG_CHECKING([for docbook manpages stylesheet]) 135MANPAGES_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl 136AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc], 137 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$MANPAGES_STYLESHEET" > /dev/null 2>&1`], 138 [HAVE_MANPAGES_STYLESHEET=yes])) 139if test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"; then 140 AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], true) 141 AC_SUBST(MANPAGES_STYLESHEET) 142 AC_MSG_RESULT([yes]) 143else 144 AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], false) 145 AC_MSG_RESULT([no]) 146fi 147 148AM_CONDITIONAL(BUILD_DOCS, [test x$enable_documentation = xyes]) 149if test "x$enable_documentation" = "xyes"; then 150 AC_PATH_PROG(DOXYGEN, doxygen) 151 152 if test "x$DOXYGEN" = "x"; then 153 AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation]) 154 fi 155 156 AC_MSG_CHECKING([for compatible doxygen version]) 157 doxygen_version=`$DOXYGEN --version` 158 AS_VERSION_COMPARE([$doxygen_version], [1.6.0], 159 [AC_MSG_RESULT([no]) 160 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])], 161 [AC_MSG_RESULT([yes])], 162 [AC_MSG_RESULT([yes])]) 163 164 AC_PATH_PROG(XMLTO, xmlto) 165 166 if test "x$XMLTO" = "x"; then 167 AC_MSG_ERROR([Documentation build requested but xmlto not found. Install xmlto or disable the documentation using --disable-documentation]) 168 fi 169 170 AC_PATH_PROG(DOT, dot) 171 if test "x$DOT" = "x"; then 172 AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation]) 173 fi 174 AC_MSG_CHECKING([for compatible dot version]) 175 dot_version=`$DOT -V 2>&1|$GREP -o ['[0-9]*\.[0-9]*\.[0-9]*']` 176 AS_VERSION_COMPARE([$dot_version], [2.26.0], 177 [AC_MSG_RESULT([no]) 178 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])], 179 [AC_MSG_RESULT([yes])], 180 [AC_MSG_RESULT([yes])]) 181 182 AC_CONFIG_FILES([ 183 doc/doxygen/wayland.doxygen 184 ]) 185 186fi 187AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"]) 188 189AC_CONFIG_FILES([Makefile 190 cursor/wayland-cursor.pc 191 cursor/wayland-cursor-uninstalled.pc 192 doc/Makefile 193 doc/publican/Makefile 194 doc/doxygen/Makefile 195 doc/man/Makefile 196 src/wayland-server-uninstalled.pc 197 src/wayland-client-uninstalled.pc 198 src/wayland-scanner-uninstalled.pc 199 src/wayland-server.pc 200 src/wayland-client.pc 201 src/wayland-scanner.pc 202 src/wayland-version.h]) 203AC_OUTPUT 204