configure.ac 2.9 KB

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