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