2008-05-16 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/upstream/at-spi2-core.git] / configure.ac
1
2 AC_INIT([at-spi], [1.9.0], [accessibility-atspi@lists.linux-foundation.org])
3 AM_INIT_AUTOMAKE([-Wall foreign])
4
5 AC_PROG_CC
6 AM_PATH_PYTHON(2.4)
7 AM_DISABLE_STATIC
8 AM_PROG_LIBTOOL
9 PKG_PROG_PKG_CONFIG
10
11 AC_CONFIG_HEADERS([config.h])
12
13 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.7.0])
14 AC_SUBST(DBUS_GLIB_LIBS)
15 AC_SUBST(DBUS_GLIB_CFLAGS)
16
17 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
18 AC_SUBST(GOBJ_LIBS)
19 AC_SUBST(GOBJ_CFLAGS)
20
21 PKG_CHECK_MODULES(ATK, [atk >= 1.17.0])
22 AC_SUBST(ATK_LIBS)
23 AC_SUBST(ATK_CFLAGS)
24
25 PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0])
26 AC_SUBST(GTK_LIBS)
27 AC_SUBST(GTK_CFLAGS)
28
29 PKG_CHECK_MODULES(GDK, [gdk-2.0 >= 2.0.0])
30 AC_SUBST(GDK_LIBS)
31 AC_SUBST(GDK_CFLAGS)
32
33 PKG_CHECK_MODULES(GAIL, [gail >= 1.9.0])        
34 AC_SUBST(GAIL_LIBS)
35 AC_SUBST(GAIL_CFLAGS)
36
37 AC_PATH_XTRA
38
39 if test x$no_x = xyes ; then
40         AC_MSG_ERROR([X development libraries not found])
41 else
42         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
43 fi
44 AC_SUBST(X_LIBS)
45
46 #LIBS="$LIBS $X_LIBS"
47 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
48         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
49         -lX11 -lXext)
50 AC_SUBST(XTST_LIBS)
51
52 have_xkb=
53 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe")
54 if test "x$have_xkb" = "xmaybe"; then 
55         AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
56 fi
57 if test "x$have_xkb" = "xyes"; then
58         AC_MSG_RESULT(yes)
59         AC_DEFINE([HAVE_XKB], [], Xkb is present)
60 fi
61
62 have_xinput=
63 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi,,-lXext)
64 if test "x$XINPUT_LIBS" = x; then
65         AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
66 fi                             
67 AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
68 AC_SUBST(XINPUT_LIBS)
69
70 AC_ARG_ENABLE(xevie, [--enable-xevie  Build with XEViE support [default=yes]], enable_xevie="$enableval", enable_xevie=yes)
71
72 if test x$enable_xevie = xyes ; then
73         have_xevie=
74         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes")
75
76         if test "x$have_xevie" = "xyes"; then
77                 XEVIE_LIBS="-lXext"
78                 AC_DEFINE([HAVE_XEVIE], [], Xevie is present)
79         else
80            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,-lXevie -lXext)
81            if test "x$have_xevie" = "xmaybe"; then
82               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [], [#include <X11/Xlib.h>])
83               if test "x$have_xevie" = "xyes"; then
84                       XEVIE_LIBS="-lXext -lXevie"              
85                       AC_DEFINE([HAVE_XEVIE], [], Xevie is present)
86               fi
87            fi   
88         fi
89         AC_SUBST(XEVIE_LIBS)
90 fi
91
92 AC_ARG_VAR([DEFAULT_ATSPI_INTROSPECTION_PATH],
93            [Set the default path for the DBus introspection XML])
94 if test -z "$DEFAULT_ATSPI_INTROSPECTION_PATH"; then
95           DEFAULT_ATSPI_INTROSPECTION_PATH=atspi/dbus
96 fi
97
98 AC_ARG_VAR([GTK_MODULE_DIR],
99            [Where to place the atk-adaptor gtk module])
100 if test -z "$GTK_MODULE_DIR"; then
101           GTK_MODULE_DIR=gtk-2.0/modules
102 fi
103
104 AC_CONFIG_FILES([Makefile
105                  xml/Makefile
106                  idl/Makefile
107                  tests/Makefile
108                  tools/Makefile
109                  droute/Makefile
110                  spi-common/Makefile
111                  registryd/Makefile
112                  atk-adaptor/Makefile])
113
114 AC_OUTPUT