Release v2.0.0
[platform/upstream/at-spi2-core.git] / configure.ac
1 AC_INIT([at-spi2-core], [2.0.0], [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(GIO, [gio-2.0 >= 2.26.0])
51 AC_SUBST(GIO_LIBS)
52 AC_SUBST(GIO_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 PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.28])
59 AC_SUBST(GIO_LIBS)
60 AC_SUBST(GIO_CFLAGS)
61
62 # --------------------------------------------------------------------
63 # Find DL functionality
64
65 AC_CHECK_LIB(c, dlopen, DL_LIBS="",
66         AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl",
67                 AC_MSG_ERROR([Could not find a library with the dlopen function])
68         )
69 )
70
71 AC_SUBST(DL_LIBS)
72
73 AC_PATH_XTRA
74
75 if test x$no_x = xyes ; then
76         AC_MSG_ERROR([X development libraries not found])
77 else
78         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
79 fi
80 AC_SUBST(X_LIBS)
81
82 save_LIBS="$LIBS"
83 LIBS=""
84 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
85 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
86         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
87         $X_LIBS)
88 AC_SUBST(XTST_LIBS)
89 LIBS="$LIBS $save_LIBS"
90
91 save_LIBS="$LIBS"
92 LIBS=""
93 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
94 if test "x$have_xkb" = "xmaybe"; then 
95         AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
96 fi
97 if test "x$have_xkb" = "xyes"; then
98         AC_DEFINE([HAVE_XKB], [], [Xkb is present])
99 fi
100 LIBS="$LIBS $save_LIBS"
101
102 save_LIBS="$LIBS"
103 LIBS=""
104 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
105 if test "x$have_xinput" = "xmaybe"; then
106         save_LIBS="$LIBS"
107         LIBS="$LIBS $X_LIBS"
108         AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
109         LIBS="$save_LIBS"
110 fi
111 if test "x$have_xinput" != "xyes"; then
112         AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
113 fi
114 XINPUT_LIBS="-lXi"
115 AC_SUBST(XINPUT_LIBS)
116 LIBS="$LIBS $save_LIBS"
117
118 save_LIBS="$LIBS"
119 LIBS=""
120 AC_ARG_ENABLE(xevie,
121         [AS_HELP_STRING([--enable-xevie],
122                 [Build with XEViE support [default=yes]])],
123         enable_xevie="$enableval", enable_xevie=yes)
124
125 if test x$enable_xevie = xyes ; then
126         have_xevie=
127         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes", have_xevie="no", $X_LIBS)
128
129         if test "x$have_xevie" = "xyes"; then
130                 XEVIE_LIBS="-lXext"
131                 AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
132         else
133            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,$X_LIBS)
134            if test "x$have_xevie" = "xmaybe"; then
135               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [],
136               [[#include <X11/Xlib.h>
137 ]])
138               if test "x$have_xevie" = "xyes"; then
139                       XEVIE_LIBS="-lXext -lXevie"              
140                       AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
141               fi
142            fi   
143         fi
144         AC_SUBST(XEVIE_LIBS)
145 fi
146 LIBS="$LIBS $save_LIBS"
147
148 AC_ARG_WITH([dbus_daemondir],
149         [AS_HELP_STRING([--with-dbus-daemondir=<directory>],
150                 [Directory where the DBUS daemon is installed])],
151     [DBUS_DAEMON="$with_dbus_daemondir/dbus-daemon"],
152     [AC_PATH_PROG([DBUS_DAEMON], [dbus-daemon], [XXXDBUSDAEMONNOTFOUND],
153                 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR]dnl
154 [/libexec$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR/usr/local/bin]dnl
155 [$PATH_SEPARATOR/usr/pkg/bin])]
156         )
157 if test "$DBUS_DAEMON" = "XXXDBUSDAEMONNOTFOUND"; then
158         DBUS_DAEMON = "$bindir/dbus-daemon"
159         AC_MSG_WARN([at-spi2 relies on dbus, and the dbus-daemon was not found])
160         AC_MSG_WARN([we assume that it will be installed in "$bindir"])
161 fi
162 AC_SUBST(DBUS_DAEMON)
163
164 AC_ARG_WITH(dbus-services,
165            [AS_HELP_STRING([--with-dbus-services=<directory>],
166            [where D-BUS services directory is])])
167 if ! test -z "$with_dbus_services" ; then
168            DBUS_SERVICES_DIR="$with_dbus_services"
169 else
170            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
171 fi
172 AC_SUBST(DBUS_SERVICES_DIR)
173
174 GOBJECT_INTROSPECTION_CHECK([0.9.6])
175
176 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
177
178 dnl find sizes & alignments
179 orig_CPPFLAGS=$CPPFLAGS
180 CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
181 DBIND_CHECK_ALIGNOF(char)
182 DBIND_CHECK_ALIGNOF(dbus_bool_t)
183 DBIND_CHECK_ALIGNOF(dbus_int16_t)
184 DBIND_CHECK_ALIGNOF(dbus_int32_t)
185 DBIND_CHECK_ALIGNOF(dbus_int64_t)
186 DBIND_CHECK_ALIGNOF(double)
187 DBIND_CHECK_ALIGNOF(dbind_pointer)
188 DBIND_CHECK_ALIGNOF(dbind_struct)
189
190 GTK_DOC_CHECK([1.09])
191
192 CPPFLAGS=$orig_CPPFLAGS 
193 AC_CONFIG_FILES([Makefile po/Makefile.in
194         xml/Makefile
195         dbind/Makefile
196 dbind/dbind-config.h
197         atspi/Makefile
198         registryd/Makefile
199         bus/Makefile
200 doc/Makefile
201 doc/libatspi/Makefile
202 atspi-2.pc
203 atspi-2-uninstalled.pc
204 ])
205
206 AC_OUTPUT