dnl Process this file with autoconf to create configure.
# Initialize Autoconf
-AC_PREREQ([2.62])
-AC_INIT([libxkbcommon], [0.6.0],
+AC_PREREQ([2.63])
+AC_INIT([libxkbcommon], [0.8.2],
[https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
- [libxkbcommon], [http://xkbcommon.org])
+ [libxkbcommon], [https://xkbcommon.org])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
])
# Checks for library functions.
-AC_CHECK_FUNCS([strcasecmp strncasecmp])
-AS_IF([test "x$ac_cv_func_strcasecmp" = xno -o \
- "x$ac_cv_func_strncasecmp" = xno], [
- AC_MSG_ERROR([C library does not support strcasecmp/strncasecmp])
-])
-
-AC_CHECK_FUNCS([eaccess euidaccess mmap])
+AC_CHECK_FUNCS([eaccess euidaccess mmap mkostemp posix_fallocate])
AC_CHECK_FUNCS([secure_getenv __secure_getenv])
AS_IF([test "x$ac_cv_func_secure_getenv" = xno -a \
])
AX_GCC_BUILTIN(__builtin_expect)
+AX_GCC_BUILTIN(__builtin_popcount)
# Some tests use Linux-specific headers
AC_CHECK_HEADER([linux/input.h])
AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
-XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
+XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden -fno-strict-aliasing -fsanitize-undefined-trap-on-error])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wextra -Wno-unused-parameter -Wno-missing-field-initializers])
-XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdocumentation])
+XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdocumentation -Wno-documentation-deprecated-sync])
# OpenBSD does not have DT_NEEDED entries for libc by design
# so when these flags are passed to ld via libtool the checks will fail
XORG_CHECK_LINKER_FLAGS([-Wl,--version-script="$srcdir/xkbcommon.map"], [have_version_script=yes])
AM_CONDITIONAL([HAVE_VERSION_SCRIPT], [test "x$have_version_script" = xyes])
-AC_CHECK_LIB(rt, clock_gettime,
- [AC_SUBST(RT_LIBS, "-lrt")],
- [AC_SUBST(RT_LIBS, "")],
- [-lrt])
-AC_CHECK_FUNCS([clock_gettime])
-
# Define a configuration option for the XKB config root
xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
AS_IF([test "x$xkb_base" = x], [
], [enable_x11=no])
AM_CONDITIONAL([ENABLE_X11], [test "x$enable_x11" = xyes])
+WAYLAND_PKGS="wayland-client >= 1.2.0 wayland-protocols >= 1.7 wayland-scanner"
+AC_ARG_ENABLE([wayland],
+ [AS_HELP_STRING([--disable-wayland],
+ [Disable support for Wayland utility programs (default: auto)])],
+ [], [enable_wayland=auto])
+AS_IF([test "x$enable_wayland" = xauto], [
+ PKG_CHECK_EXISTS($WAYLAND_PKGS, [enable_wayland=yes], [enable_wayland=no])],
+ [])
+AS_IF([test "x$enable_wayland" = xyes], [
+ PKG_CHECK_MODULES([WAYLAND], $WAYLAND_PKGS, [],
+ [AC_MSG_ERROR([Wayland utilities require libwayland-client >= 1.2 which was not found. \
+You can disable Wayland support with --disable-wayland.])])
+ AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+ wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+ ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
+ AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+], [enable_wayland=no])
+AM_CONDITIONAL([ENABLE_WAYLAND], [test "x$enable_wayland" = xyes])
+
AC_CONFIG_FILES([
Makefile
- xkbcommon-uninstalled.pc
xkbcommon.pc
xkbcommon-x11.pc
- xkbcommon-x11-uninstalled.pc
doc/Doxyfile
])
AC_OUTPUT
libxkbcommon: yes
libxkbcommon-x11: ${enable_x11}
+ Wayland utilities: ${enable_wayland}
documentation: ${build_docs}
default XKB rules: ${DEFAULT_XKB_RULES}