configure.ac revision 863f95b1
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
24AC_PREREQ([2.60])
25AC_INIT([xwininfo], [1.1.1],
26	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xwininfo])
27AM_INIT_AUTOMAKE([foreign dist-bzip2])
28AM_MAINTAINER_MODE
29
30# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
31m4_ifndef([XORG_MACROS_VERSION],
32	  [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
33XORG_MACROS_VERSION(1.8)
34
35AM_CONFIG_HEADER(config.h)
36
37AC_USE_SYSTEM_EXTENSIONS
38
39XORG_DEFAULT_OPTIONS
40
41AC_CHECK_FUNCS([strlcat])
42
43AC_FUNC_STRNLEN
44if test "x$ac_cv_func_strnlen_working" = xyes; then
45  AC_DEFINE(HAVE_STRNLEN, 1, [Define to 1 if you have a working strnlen function.])
46fi
47
48# Check for iconv in libc, then libiconv
49AC_SEARCH_LIBS([iconv], [iconv], [AC_DEFINE([HAVE_ICONV], 1,
50	[Define to 1 if you have the iconv() function])])
51
52# Allow using xcb-icccm, but don't make it the default while the API is
53# still being changed.
54AC_MSG_CHECKING([whether to use xcb-icccm library])
55AC_ARG_WITH([xcb-icccm],
56	    [AS_HELP_STRING([--with-xcb-icccm],
57			    [use xcb-icccm (default: no)])],
58            [], [with_xcb_icccm=no])
59AC_MSG_RESULT([$with_xcb_icccm])
60if test "x$with_xcb_icccm" != xno ; then
61	AC_DEFINE([USE_XCB_ICCCM], 1,
62		  [Define to 1 to call xcb-icccm library functions instead of local replacements])
63	xcb_icccm_pc="xcb-icccm"
64fi
65
66# Checks for pkg-config packages
67PKG_CHECK_MODULES(XWININFO, [xcb >= 1.6] xcb-shape ${xcb_icccm_pc})
68
69# Even when using xcb, xproto is still required for Xfuncproto.h
70# and libX11 headers for cursorfont.h
71PKG_CHECK_MODULES(XLIB, x11 [xproto >= 7.0.17])
72XWININFO_CFLAGS="${XWININFO_CFLAGS} ${XLIB_CFLAGS}"
73
74AC_OUTPUT([Makefile])
75