2.23.4
[platform/upstream/at-spi2-core.git] / configure.ac
1 AC_INIT([at-spi2-core], [2.23.4], [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 no-dist-gzip dist-xz])
24
25 # Support silent build rules. Disable
26 # by either passing --disable-silent-rules to configure or passing V=1
27 # to make
28 AM_SILENT_RULES([yes])
29
30 AC_PROG_CC
31 AM_PROG_AR
32 LT_INIT([disable-static])
33 PKG_PROG_PKG_CONFIG
34
35 AC_CONFIG_HEADERS([config.h])
36
37 dnl translation of at-spi strings
38 IT_PROG_INTLTOOL([0.40.0])
39
40
41 GETTEXT_PACKAGE="${PACKAGE}"
42 AC_SUBST(GETTEXT_PACKAGE)
43
44 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
45 AC_SUBST(DBUS_LIBS)
46 AC_SUBST(DBUS_CFLAGS)
47
48 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36.0])
49 AC_SUBST(GLIB_LIBS)
50 AC_SUBST(GLIB_CFLAGS)
51
52 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
53 AC_SUBST(GOBJ_LIBS)
54 AC_SUBST(GOBJ_CFLAGS)
55
56 PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.28])
57 AC_SUBST(GIO_LIBS)
58 AC_SUBST(GIO_CFLAGS)
59
60 # --------------------------------------------------------------------
61 # Find DL functionality
62
63 AC_CHECK_LIB(c, dlopen, DL_LIBS="",
64         AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl",
65                 AC_MSG_ERROR([Could not find a library with the dlopen function])
66         )
67 )
68
69 AC_SUBST(DL_LIBS)
70
71 AC_PATH_XTRA
72
73 AC_ARG_ENABLE(x11,
74               [AS_HELP_STRING([--disable-x11],
75                               [disable the X11 backend])],,
76                               [enable_x11=auto])
77
78 if test x$enable_x11 = xno; then
79         AM_CONDITIONAL(USE_X11, false)
80 elif test x$no_x = xyes ; then
81         AC_MSG_ERROR([X development libraries not found])
82 else
83         AM_CONDITIONAL(USE_X11, true)
84         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
85         AC_SUBST(X_LIBS)
86         AC_DEFINE(HAVE_X11, 1, [Define to use X11])
87         AC_SUBST(HAVE_X11)
88
89         dnl Check for Xtst
90         save_LIBS="$LIBS"
91         LIBS=""
92         CPPFLAGS="$CPPFLAGS $X_CFLAGS"
93         AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
94                 AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
95                 $X_LIBS)
96         AC_SUBST(XTST_LIBS)
97         LIBS="$LIBS $save_LIBS"
98
99         dnl Check for XkbQueryExtension
100         save_LIBS="$LIBS"
101         LIBS=""
102         AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
103         if test "x$have_xkb" = "xmaybe"; then 
104                 AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
105         fi
106         if test "x$have_xkb" = "xyes"; then
107                 AC_DEFINE([HAVE_XKB], [], [Xkb is present])
108         fi
109         LIBS="$LIBS $save_LIBS"
110
111         dnl Check for Xi
112         save_LIBS="$LIBS"
113         LIBS=""
114         AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
115         if test "x$have_xinput" = "xmaybe"; then
116                 save_LIBS="$LIBS"
117                 LIBS="$LIBS $X_LIBS"
118                 AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
119                 LIBS="$save_LIBS"
120         fi
121         if test "x$have_xinput" != "xyes"; then
122                 AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
123         fi
124         XINPUT_LIBS="-lXi"
125         AC_SUBST(XINPUT_LIBS)
126         LIBS="$LIBS $save_LIBS"
127 fi
128
129 save_LIBS="$LIBS"
130 LIBS=""
131 AC_ARG_ENABLE(xevie,
132         [AS_HELP_STRING([--enable-xevie],
133                 [Build with XEViE support [default=no]])],
134         enable_xevie="$enableval", enable_xevie=no)
135
136 if test -z "$backend_set"; then
137   enable_x11_backend=yes
138 fi
139
140 if test x$enable_xevie = xyes ; then
141         have_xevie=
142         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes", have_xevie="no", $X_LIBS)
143
144         if test "x$have_xevie" = "xyes"; then
145                 XEVIE_LIBS="-lXext"
146                 AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
147         else
148            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,$X_LIBS)
149            if test "x$have_xevie" = "xmaybe"; then
150               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [],
151               [[#include <X11/Xlib.h>
152 ]])
153               if test "x$have_xevie" = "xyes"; then
154                       XEVIE_LIBS="-lXext -lXevie"              
155                       AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
156               fi
157            fi   
158         fi
159         AC_SUBST(XEVIE_LIBS)
160 fi
161 LIBS="$LIBS $save_LIBS"
162
163 AC_ARG_WITH([dbus_daemondir],
164         [AS_HELP_STRING([--with-dbus-daemondir=<directory>],
165                 [Directory where the DBUS daemon is installed])],
166     [DBUS_DAEMON="$with_dbus_daemondir/dbus-daemon"],
167     [AC_PATH_PROG([DBUS_DAEMON], [dbus-daemon], [XXXDBUSDAEMONNOTFOUND],
168                 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR]dnl
169 [/libexec$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR/usr/local/bin]dnl
170 [$PATH_SEPARATOR/usr/pkg/bin])]
171         )
172 if test "$DBUS_DAEMON" = "XXXDBUSDAEMONNOTFOUND"; then
173         DBUS_DAEMON = "$bindir/dbus-daemon"
174         AC_MSG_WARN([at-spi2 relies on dbus, and the dbus-daemon was not found])
175         AC_MSG_WARN([we assume that it will be installed in "$bindir"])
176 fi
177 AC_SUBST(DBUS_DAEMON)
178
179 AC_ARG_WITH(dbus-services,
180            [AS_HELP_STRING([--with-dbus-services=<directory>],
181            [where D-BUS services directory is])])
182 if ! test -z "$with_dbus_services" ; then
183            DBUS_SERVICES_DIR="$with_dbus_services"
184 else
185            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
186 fi
187 AC_SUBST(DBUS_SERVICES_DIR)
188
189 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
190
191 GOBJECT_INTROSPECTION_CHECK([0.9.6])
192
193 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
194
195 dnl find sizes & alignments
196 orig_CPPFLAGS=$CPPFLAGS
197 CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
198 AC_CHECK_ALIGNOF(char)
199 AC_CHECK_ALIGNOF(dbus_bool_t, [#include <dbus/dbus.h>])
200 AC_CHECK_ALIGNOF(dbus_int16_t, [#include <dbus/dbus.h>])
201 AC_CHECK_ALIGNOF(dbus_int32_t, [#include <dbus/dbus.h>])
202 AC_CHECK_ALIGNOF(dbus_int64_t, [#include <dbus/dbus.h>])
203 AC_CHECK_ALIGNOF(double, [#include <dbus/dbus.h>])
204 AC_CHECK_ALIGNOF(dbind_pointer, [AC_INCLUDES_DEFAULT
205 typedef void *dbind_pointer;])
206 AC_CHECK_ALIGNOF(dbind_struct, [AC_INCLUDES_DEFAULT
207 typedef struct {char s1;} dbind_struct;])
208
209 GTK_DOC_CHECK([1.09])
210
211 if test "x$GCC" = xyes; then
212         CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
213 fi
214 CPPFLAGS=$orig_CPPFLAGS 
215 AC_CONFIG_FILES([Makefile po/Makefile.in
216         xml/Makefile
217         dbind/Makefile
218         atspi/Makefile
219         registryd/Makefile
220         bus/Makefile
221 doc/Makefile
222 doc/libatspi/Makefile
223 doc/libatspi/version.xml
224 test/Makefile
225 atspi-2.pc
226 atspi-2-uninstalled.pc
227 ])
228
229 AC_OUTPUT