1 2dnl Copyright 2005 Red Hat, Inc. 3dnl 4dnl Permission to use, copy, modify, distribute, and sell this software and its 5dnl documentation for any purpose is hereby granted without fee, provided that 6dnl the above copyright notice appear in all copies and that both that 7dnl copyright notice and this permission notice appear in supporting 8dnl documentation, and that the name of Red Hat not be used in 9dnl advertising or publicity pertaining to distribution of the software without 10dnl specific, written prior permission. Red Hat makes no 11dnl representations about the suitability of this software for any purpose. It 12dnl is provided "as is" without express or implied warranty. 13dnl 14dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 15dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 16dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR 17dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 18dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20dnl PERFORMANCE OF THIS SOFTWARE. 21dnl 22dnl Process this file with autoconf to create configure. 23 24# Initialize Autoconf 25AC_PREREQ([2.60]) 26AC_INIT([xwininfo], [1.1.6], 27 [https://gitlab.freedesktop.org/xorg/app/xwininfo/-/issues], [xwininfo]) 28AC_CONFIG_SRCDIR([Makefile.am]) 29AC_CONFIG_HEADERS([config.h]) 30AC_USE_SYSTEM_EXTENSIONS 31 32# Initialize Automake 33AM_INIT_AUTOMAKE([foreign dist-xz]) 34AM_ICONV 35 36# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS 37m4_ifndef([XORG_MACROS_VERSION], 38 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 39XORG_MACROS_VERSION(1.8) 40XORG_DEFAULT_OPTIONS 41 42# Checks for library functions 43AC_CHECK_FUNCS([strlcat]) 44 45# Use POSIX strnlen or the implementation supplied in this module 46AC_FUNC_STRNLEN 47if test "x$ac_cv_func_strnlen_working" = xyes; then 48 AC_DEFINE(HAVE_STRNLEN, 1, [Define to 1 if you have a working strnlen function.]) 49fi 50 51# Define a configure option for using the XCB ICCCM helper functions 52AC_MSG_CHECKING([whether to use xcb-icccm library]) 53AC_ARG_WITH([xcb-icccm], 54 [AS_HELP_STRING([--with-xcb-icccm], 55 [use xcb-icccm (default: no)])], 56 [], [with_xcb_icccm=no]) 57AC_MSG_RESULT([$with_xcb_icccm]) 58if test "x$with_xcb_icccm" != xno ; then 59 AC_DEFINE([USE_XCB_ICCCM], 1, 60 [Define to 1 to call xcb-icccm library functions instead of local replacements]) 61 xcb_icccm_pc='xcb-icccm >= 0.3.8' 62fi 63 64# Define a configure option for using the XCB Error helper functions 65AC_MSG_CHECKING([whether to use xcb-errors library]) 66AC_ARG_WITH([xcb-errors], 67 [AS_HELP_STRING([--with-xcb-errors], 68 [use xcb-errors (default: no)])], 69 [], [with_xcb_errors=no]) 70AC_MSG_RESULT([$with_xcb_errors]) 71if test "x$with_xcb_errors" != xno ; then 72 AC_DEFINE([USE_XCB_ERRORS], 1, 73 [Define to 1 to call xcb-errors library functions instead of local replacements]) 74 xcb_errors_pc='xcb-errors >= 1.0' 75fi 76 77# Obtain compiler/linker options for xwininfo dependencies 78PKG_CHECK_MODULES(XWININFO, [xcb >= 1.6 xcb-shape ${xcb_icccm_pc} ${xcb_errors_pc}]) 79 80# Even when using xcb, xproto is still required for Xfuncproto.h 81# and libX11 headers for cursorfont.h 82PKG_CHECK_MODULES(XLIB, x11 [xproto >= 7.0.25]) 83XWININFO_CFLAGS="${XWININFO_CFLAGS} ${XLIB_CFLAGS}" 84XWININFO_LIBS="${XWININFO_LIBS} ${LIBICONV}" 85 86AC_CONFIG_FILES([ 87 Makefile 88 man/Makefile]) 89AC_OUTPUT 90