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