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