Fix a comment in configure.ac, this is libXdamage, not libXfixes
[platform/upstream/libXdamage.git] / configure.ac
1 dnl 
2 dnl  Copyright © 2003 Keith Packard, Noah Levitt
3 dnl 
4 dnl  Permission to use, copy, modify, distribute, and sell this software and its
5 dnl  documentation for any purpose is hereby granted without fee, provided that
6 dnl  the above copyright notice appear in all copies and that both that
7 dnl  copyright notice and this permission notice appear in supporting
8 dnl  documentation, and that the name of Keith Packard not be used in
9 dnl  advertising or publicity pertaining to distribution of the software without
10 dnl  specific, written prior permission.  Keith Packard makes no
11 dnl  representations about the suitability of this software for any purpose.  It
12 dnl  is provided "as is" without express or implied warranty.
13 dnl 
14 dnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 dnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 dnl  PERFORMANCE OF THIS SOFTWARE.
21 dnl
22 dnl Process this file with autoconf to create configure.
23
24 AC_PREREQ([2.57])
25
26 dnl
27 dnl Version should match the current XDamage version. XDamageQueryVersion
28 dnl returns the version from damagewire.h, NOT the version we set here. But we
29 dnl try to keep these the same.  Note that the library has an extra
30 dnl digit in the version number to track changes which don't affect the
31 dnl protocol, so Xdamage version l.n.m corresponds to protocol version l.n
32 dnl
33 AC_INIT(libXdamage, 1.1.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXdamage)
34 AM_INIT_AUTOMAKE([dist-bzip2])
35 AM_MAINTAINER_MODE
36
37 # Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
38 m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
39 XORG_MACROS_VERSION(1.2)
40 AM_CONFIG_HEADER(config.h)
41
42 # Check for progs
43 AC_PROG_CC
44 AC_PROG_LIBTOOL
45 XORG_CWARNFLAGS
46
47 # Check for X
48 PKG_CHECK_MODULES(X, x11, 
49                   [x_found_with_pkgconfig=yes],
50                   [x_found_with_pkgconfig=no])
51                   
52 if test "$x_found_with_pkgconfig" = "no"
53 then
54         AC_PATH_XTRA
55         X_LIBS="$X_LIBS -lX11"
56
57         if test "x$no_x" = "xyes"
58         then
59                 AC_MSG_ERROR([X is required, but it was either disabled or not found.])
60         fi
61
62         save_LIBS="$LIBS"
63         save_CFLAGS="$CFLAGS"
64         CFLAGS="$CFLAGS $X_CFLAGS"
65         LIBS="$LIBS $X_LIBS"
66
67         AC_MSG_CHECKING([for XTHREADS in Xlib])
68         AC_RUN_IFELSE(
69            [AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
70                             [[return XInitThreads() == 0 ? 0 : 1;]])],
71            [xthreads=no],
72            [xthreads=yes],
73            [xthreads=yes])
74            
75         AC_MSG_RESULT($xthreads)
76         
77         LIBS="$save_LIBS"
78         CFLAGS="$save_CFLAGS"
79         
80         if test "x$xthreads" = "xyes"
81         then
82                 X_CFLAGS="$X_CFLAGS -DXTHREADS"
83         fi
84 fi
85
86 # Check damageext configuration, strip extra digits from package version to
87 # find the required protocol version
88
89 DAMAGEEXT_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`]
90 AC_SUBST(DAMAGEEXT_VERSION)
91 PKG_CHECK_MODULES(XDAMAGE, [damageproto >= $DAMAGEEXT_VERSION] xfixes fixesproto xextproto)
92 XDAMAGE_CFLAGS="$CWARNFLAGS $XDAMAGE_CFLAGS"
93 AC_SUBST(XDAMAGE_CFLAGS)
94
95 XORG_RELEASE_VERSION
96 XORG_CHANGELOG
97
98 AC_OUTPUT([Makefile
99            src/Makefile
100            xdamage.pc])
101