Use datarootdir for placing XML files so that the are in a shared directory
[platform/upstream/at-spi2-core.git] / configure.ac
1 AC_INIT([at-spi2-core], [0.1.3], [accessibility-atspi@lists.linux-foundation.org])
2 AC_CONFIG_AUX_DIR(config)
3 AC_CONFIG_MACRO_DIR([m4])
4
5 AT_SPI_CORE_MAJOR_VERSION=0
6 AT_SPI_CORE_MINOR_VERSION=1
7 AT_SPI_CORE_MICRO_VERSION=3
8 AT_SPI_CORE_VERSION="$AT_SPI_CORE_MAJOR_VERSION.$AT_SPI_CORE_MINOR_VERSION"
9 AC_SUBST(AT_SPI_CORE_VERSION)
10
11 LT_RELEASE=$AT_SPI_CORE_VERSION
12 LT_CURRENT=0
13 LT_REVISION=1
14 LT_AGE=0
15 LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
16 AC_SUBST(LT_VERSION_INFO)
17 AC_SUBST(LT_RELEASE)
18 AC_SUBST(LT_CURRENT)
19 AC_SUBST(LT_REVISION)
20 AC_SUBST(LT_AGE)
21
22 AM_INIT_AUTOMAKE([-Wall foreign])
23
24 AC_PROG_CC
25 AM_DISABLE_STATIC
26 AM_PROG_LIBTOOL
27 PKG_PROG_PKG_CONFIG
28
29 AC_CONFIG_HEADERS([config.h])
30
31 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
32 AC_SUBST(DBUS_LIBS)
33 AC_SUBST(DBUS_CFLAGS)
34
35 PKG_CHECK_MODULES(GLIB, [glib-2.0])
36 AC_SUBST(GLIB_LIBS)
37 AC_SUBST(GLIB_CFLAGS)
38
39 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.7.0])
40 AC_SUBST(DBUS_GLIB_LIBS)
41 AC_SUBST(DBUS_GLIB_CFLAGS)
42
43 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
44 AC_SUBST(GOBJ_LIBS)
45 AC_SUBST(GOBJ_CFLAGS)
46
47 PKG_CHECK_MODULES(GDK, [gdk-2.0 >= 2.0.0])
48 AC_SUBST(GDK_LIBS)
49 AC_SUBST(GDK_CFLAGS)
50
51 AC_PATH_XTRA
52
53 if test x$no_x = xyes ; then
54         AC_MSG_ERROR([X development libraries not found])
55 else
56         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
57 fi
58 AC_SUBST(X_LIBS)
59
60 #LIBS="$LIBS $X_LIBS"
61 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
62         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
63         -lX11 -lXext)
64 AC_SUBST(XTST_LIBS)
65
66 have_xkb=
67 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe")
68 if test "x$have_xkb" = "xmaybe"; then 
69         AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
70 fi
71 if test "x$have_xkb" = "xyes"; then
72         AC_MSG_RESULT(yes)
73         AC_DEFINE([HAVE_XKB], [], Xkb is present)
74 fi
75
76 have_xinput=
77 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi,,-lXext)
78 if test "x$XINPUT_LIBS" = x; then
79         AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
80 fi                             
81 AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
82 AC_SUBST(XINPUT_LIBS)
83
84 AC_ARG_ENABLE(xevie, [--enable-xevie  Build with XEViE support [default=yes]], enable_xevie="$enableval", enable_xevie=yes)
85
86 if test x$enable_xevie = xyes ; then
87         have_xevie=
88         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes")
89
90         if test "x$have_xevie" = "xyes"; then
91                 XEVIE_LIBS="-lXext"
92                 AC_DEFINE([HAVE_XEVIE], [], Xevie is present)
93         else
94            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,-lXevie -lXext)
95            if test "x$have_xevie" = "xmaybe"; then
96               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [], [#include <X11/Xlib.h>])
97               if test "x$have_xevie" = "xyes"; then
98                       XEVIE_LIBS="-lXext -lXevie"              
99                       AC_DEFINE([HAVE_XEVIE], [], Xevie is present)
100               fi
101            fi   
102         fi
103         AC_SUBST(XEVIE_LIBS)
104 fi
105
106 AC_ARG_VAR([DEFAULT_ATSPI_INTROSPECTION_PATH],
107            [Set the default path for the install ofDBus introspection XML
108             relative to the pkgdatadir.])
109 if test -z "$DEFAULT_ATSPI_INTROSPECTION_PATH"; then
110           DEFAULT_ATSPI_INTROSPECTION_PATH=at-spi2/dbus
111 fi
112
113 AC_ARG_WITH(dbus-services,
114            [AC_HELP_STRING([--with-dbus-services=<dir>],
115            [where D-BUS services directory is])])
116 if ! test -z "$with_dbus_services" ; then
117            DBUS_SERVICES_DIR="$with_dbus_services"
118 else
119            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
120 fi
121 AC_SUBST(DBUS_SERVICES_DIR)
122
123 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
124
125 AC_CONFIG_FILES([Makefile
126                  xml/Makefile
127                  tools/Makefile
128                  bus/Makefile
129                  bus/at-spi-dbus-bus
130                  registryd/Makefile])
131
132 AC_OUTPUT