Release v1.91.5
[platform/upstream/at-spi2-core.git] / configure.ac
1 AC_INIT([at-spi2-core], [1.91.5], [accessibility-atspi@lists.linux-foundation.org])
2 AC_PREREQ([2.59])
3 AC_CONFIG_AUX_DIR(config)
4 AC_CONFIG_MACRO_DIR([m4])
5
6 AT_SPI_CORE_MAJOR_VERSION=0
7 AT_SPI_CORE_MINOR_VERSION=1
8 AT_SPI_CORE_MICRO_VERSION=3
9 AT_SPI_CORE_VERSION="$AT_SPI_CORE_MAJOR_VERSION.$AT_SPI_CORE_MINOR_VERSION"
10 AC_SUBST(AT_SPI_CORE_VERSION)
11
12 LT_RELEASE=$AT_SPI_CORE_VERSION
13 LT_CURRENT=0
14 LT_REVISION=1
15 LT_AGE=0
16 LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
17 AC_SUBST(LT_VERSION_INFO)
18 AC_SUBST(LT_RELEASE)
19 AC_SUBST(LT_CURRENT)
20 AC_SUBST(LT_REVISION)
21 AC_SUBST(LT_AGE)
22
23 AM_INIT_AUTOMAKE([1.9 -Wall foreign])
24
25 AC_PROG_CC
26 LT_INIT([disable-static])
27 PKG_PROG_PKG_CONFIG
28
29 AC_CONFIG_HEADERS([config.h])
30
31 dnl translation of at-spi strings
32 IT_PROG_INTLTOOL([0.40.0])
33
34
35 GETTEXT_PACKAGE="${PACKAGE}"
36 AC_SUBST(GETTEXT_PACKAGE)
37
38 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
39 AC_SUBST(DBUS_LIBS)
40 AC_SUBST(DBUS_CFLAGS)
41
42 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.26.0])
43 AC_SUBST(GLIB_LIBS)
44 AC_SUBST(GLIB_CFLAGS)
45 AC_CHECK_LIB([glib-2.0], [g_ptr_array_new_with_free_func], [],
46         [AC_MSG_ERROR([The version of glib-2.0 found does not define ]
47                 [g_ptr_array_new_with_free_func. Please upgrade glib.])],
48         [$GLIB_LIBS])
49
50 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.7.0])
51 AC_SUBST(DBUS_GLIB_LIBS)
52 AC_SUBST(DBUS_GLIB_CFLAGS)
53
54 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
55 AC_SUBST(GOBJ_LIBS)
56 AC_SUBST(GOBJ_CFLAGS)
57
58 # --------------------------------------------------------------------
59 # Find DL functionality
60
61 AC_CHECK_LIB(c, dlopen, DL_LIBS="",
62         AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl",
63                 AC_MSG_ERROR([Could not find a library with the dlopen function])
64         )
65 )
66
67 AC_SUBST(DL_LIBS)
68
69 AC_PATH_XTRA
70
71 if test x$no_x = xyes ; then
72         AC_MSG_ERROR([X development libraries not found])
73 else
74         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
75 fi
76 AC_SUBST(X_LIBS)
77
78 save_LIBS="$LIBS"
79 LIBS=""
80 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
81 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
82         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
83         $X_LIBS)
84 AC_SUBST(XTST_LIBS)
85 LIBS="$LIBS $save_LIBS"
86
87 save_LIBS="$LIBS"
88 LIBS=""
89 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
90 if test "x$have_xkb" = "xmaybe"; then 
91         AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
92 fi
93 if test "x$have_xkb" = "xyes"; then
94         AC_DEFINE([HAVE_XKB], [], [Xkb is present])
95 fi
96 LIBS="$LIBS $save_LIBS"
97
98 save_LIBS="$LIBS"
99 LIBS=""
100 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
101 if test "x$have_xinput" = "xmaybe"; then
102         save_LIBS="$LIBS"
103         LIBS="$LIBS $X_LIBS"
104         AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
105         LIBS="$save_LIBS"
106 fi
107 if test "x$have_xinput" != "xyes"; then
108         AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
109 fi
110 XINPUT_LIBS="-lXi"
111 AC_SUBST(XINPUT_LIBS)
112 LIBS="$LIBS $save_LIBS"
113
114 save_LIBS="$LIBS"
115 LIBS=""
116 AC_ARG_ENABLE(xevie,
117         [AS_HELP_STRING([--enable-xevie],
118                 [Build with XEViE support [default=yes]])],
119         enable_xevie="$enableval", enable_xevie=yes)
120
121 if test x$enable_xevie = xyes ; then
122         have_xevie=
123         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes", have_xevie="no", $X_LIBS)
124
125         if test "x$have_xevie" = "xyes"; then
126                 XEVIE_LIBS="-lXext"
127                 AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
128         else
129            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,$X_LIBS)
130            if test "x$have_xevie" = "xmaybe"; then
131               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [],
132               [[#include <X11/Xlib.h>
133 ]])
134               if test "x$have_xevie" = "xyes"; then
135                       XEVIE_LIBS="-lXext -lXevie"              
136                       AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
137               fi
138            fi   
139         fi
140         AC_SUBST(XEVIE_LIBS)
141 fi
142 LIBS="$LIBS $save_LIBS"
143
144 AC_ARG_WITH([dbus_daemondir],
145         [AS_HELP_STRING([--with-dbus-daemondir=<directory>],
146                 [Directory where the DBUS daemon is installed])],
147     [DBUS_DAEMON="$with_dbus_daemondir/dbus-daemon"],
148     [AC_PATH_PROG([DBUS_DAEMON], [dbus-daemon], [XXXDBUSDAEMONNOTFOUND],
149                 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR]dnl
150 [/libexec$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR/usr/local/bin]dnl
151 [$PATH_SEPARATOR/usr/pkg/bin])]
152         )
153 if test "$DBUS_DAEMON" = "XXXDBUSDAEMONNOTFOUND"; then
154         DBUS_DAEMON = "$bindir/dbus-daemon"
155         AC_MSG_WARN([at-spi2 relies on dbus, and the dbus-daemon was not found])
156         AC_MSG_WARN([we assume that it will be installed in "$bindir"])
157 fi
158 AC_SUBST(DBUS_DAEMON)
159
160 AC_ARG_WITH(dbus-services,
161            [AS_HELP_STRING([--with-dbus-services=<directory>],
162            [where D-BUS services directory is])])
163 if ! test -z "$with_dbus_services" ; then
164            DBUS_SERVICES_DIR="$with_dbus_services"
165 else
166            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
167 fi
168 AC_SUBST(DBUS_SERVICES_DIR)
169
170 GOBJECT_INTROSPECTION_CHECK([0.9.6])
171
172 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
173
174 AC_ARG_ENABLE([relocate],
175         [AS_HELP_STRING([--enable-relocate],
176                 [Relocate to coexist with CORBA @<:@default=no@:>@])],
177         [enable_relocate="$enableval"],
178         [enable_relocate=no])
179 if test x$enable_relocate = xyes ; then
180         AC_DEFINE(RELOCATE, , [Relocate to coexist with CORBA])
181 fi
182 AM_CONDITIONAL(RELOCATE, test x$enable_relocate = xyes)
183 AC_SUBST(enable_relocate)
184
185 dnl find sizes & alignments
186 orig_CPPFLAGS=$CPPFLAGS
187 CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
188 DBIND_CHECK_ALIGNOF(char)
189 DBIND_CHECK_ALIGNOF(dbus_bool_t)
190 DBIND_CHECK_ALIGNOF(dbus_int16_t)
191 DBIND_CHECK_ALIGNOF(dbus_int32_t)
192 DBIND_CHECK_ALIGNOF(dbus_int64_t)
193 DBIND_CHECK_ALIGNOF(double)
194 DBIND_CHECK_ALIGNOF(dbind_pointer)
195 DBIND_CHECK_ALIGNOF(dbind_struct)
196
197 GTK_DOC_CHECK([1.09])
198
199 CPPFLAGS=$orig_CPPFLAGS 
200 AC_CONFIG_FILES([Makefile po/Makefile.in
201         xml/Makefile
202         dbind/Makefile
203 dbind/dbind-config.h
204         atspi/Makefile
205         registryd/Makefile
206         bus/at-spi-dbus-bus
207         bus/Makefile
208 doc/Makefile
209 doc/libatspi/Makefile
210 ])
211
212 AC_OUTPUT