Merge branch 'master' into gi
[platform/upstream/at-spi2-core.git] / configure.ac
1 AC_INIT([at-spi2-core], [1.91.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 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
32 AC_SUBST(DBUS_LIBS)
33 AC_SUBST(DBUS_CFLAGS)
34
35 PKG_CHECK_MODULES(GLIB, [glib-2.0])
36 AC_SUBST(GLIB_LIBS)
37 AC_SUBST(GLIB_CFLAGS)
38 AC_CHECK_LIB([glib-2.0], [g_ptr_array_new_with_free_func], [],
39         [AC_MSG_ERROR([The version of glib-2.0 found does not define ]
40                 [g_ptr_array_new_with_free_func. Please upgrade glib.])],
41         [$GLIB_LIBS])
42
43 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.7.0])
44 AC_SUBST(DBUS_GLIB_LIBS)
45 AC_SUBST(DBUS_GLIB_CFLAGS)
46
47 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
48 AC_SUBST(GOBJ_LIBS)
49 AC_SUBST(GOBJ_CFLAGS)
50
51 # --------------------------------------------------------------------
52 # Find DL functionality
53
54 AC_CHECK_LIB(c, dlopen, DL_LIBS="",
55         AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl",
56                 AC_MSG_ERROR([Could not find a library with the dlopen function])
57         )
58 )
59
60 AC_SUBST(DL_LIBS)
61
62 AC_PATH_XTRA
63
64 if test x$no_x = xyes ; then
65         AC_MSG_ERROR([X development libraries not found])
66 else
67         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
68 fi
69 AC_SUBST(X_LIBS)
70
71 save_LIBS="$LIBS"
72 LIBS=""
73 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
74 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
75         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
76         $X_LIBS)
77 AC_SUBST(XTST_LIBS)
78 LIBS="$LIBS $save_LIBS"
79
80 save_LIBS="$LIBS"
81 LIBS=""
82 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
83 if test "x$have_xkb" = "xmaybe"; then 
84         AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
85 fi
86 if test "x$have_xkb" = "xyes"; then
87         AC_DEFINE([HAVE_XKB], [], [Xkb is present])
88 fi
89 LIBS="$LIBS $save_LIBS"
90
91 save_LIBS="$LIBS"
92 LIBS=""
93 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
94 if test "x$have_xinput" = "xmaybe"; then
95         save_LIBS="$LIBS"
96         LIBS="$LIBS $X_LIBS"
97         AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
98         LIBS="$save_LIBS"
99 fi
100 if test "x$have_xinput" != "xyes"; then
101         AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
102 fi
103 XINPUT_LIBS="-lXi"
104 AC_SUBST(XINPUT_LIBS)
105 LIBS="$LIBS $save_LIBS"
106
107 save_LIBS="$LIBS"
108 LIBS=""
109 AC_ARG_ENABLE(xevie,
110         [AS_HELP_STRING([--enable-xevie],
111                 [Build with XEViE support [default=yes]])],
112         enable_xevie="$enableval", enable_xevie=yes)
113
114 if test x$enable_xevie = xyes ; then
115         have_xevie=
116         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes", have_xevie="no", $X_LIBS)
117
118         if test "x$have_xevie" = "xyes"; then
119                 XEVIE_LIBS="-lXext"
120                 AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
121         else
122            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,$X_LIBS)
123            if test "x$have_xevie" = "xmaybe"; then
124               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [],
125               [[#include <X11/Xlib.h>
126 ]])
127               if test "x$have_xevie" = "xyes"; then
128                       XEVIE_LIBS="-lXext -lXevie"              
129                       AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
130               fi
131            fi   
132         fi
133         AC_SUBST(XEVIE_LIBS)
134 fi
135 LIBS="$LIBS $save_LIBS"
136
137 AC_ARG_WITH([dbus_daemondir],
138         [AS_HELP_STRING([--with-dbus-daemondir=<directory>],
139                 [Directory where the DBUS daemon is installed])],
140     [DBUS_DAEMON="$with_dbus_daemondir/dbus-daemon"],
141     [AC_PATH_PROG([DBUS_DAEMON], [dbus-daemon], [XXXDBUSDAEMONNOTFOUND],
142                 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR]dnl
143 [/libexec$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR/usr/local/bin]dnl
144 [$PATH_SEPARATOR/usr/pkg/bin])]
145         )
146 if test "$DBUS_DAEMON" = "XXXDBUSDAEMONNOTFOUND"; then
147         DBUS_DAEMON = "$bindir/dbus-daemon"
148         AC_MSG_WARN([at-spi2 relies on dbus, and the dbus-daemon was not found])
149         AC_MSG_WARN([we assume that it will be installed in "$bindir"])
150 fi
151 AC_SUBST(DBUS_DAEMON)
152
153 AC_ARG_WITH(dbus-services,
154            [AS_HELP_STRING([--with-dbus-services=<directory>],
155            [where D-BUS services directory is])])
156 if ! test -z "$with_dbus_services" ; then
157            DBUS_SERVICES_DIR="$with_dbus_services"
158 else
159            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
160 fi
161 AC_SUBST(DBUS_SERVICES_DIR)
162
163 GOBJECT_INTROSPECTION_CHECK([0.9.6])
164
165 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
166
167 AC_ARG_ENABLE([relocate],
168         [AS_HELP_STRING([--enable-relocate],
169                 [Relocate to coexist with CORBA @<:@default=no@:>@])],
170         [enable_relocate="$enableval"],
171         [enable_relocate=no])
172 if test x$enable_relocate = xyes ; then
173         AC_DEFINE(RELOCATE, , [Relocate to coexist with CORBA])
174 fi
175 AM_CONDITIONAL(RELOCATE, test x$enable_relocate = xyes)
176 AC_SUBST(enable_relocate)
177
178 AC_CONFIG_FILES([Makefile
179         xml/Makefile
180         dbind/Makefile
181 dbind/dbind-config.h
182         atspi/Makefile
183         registryd/Makefile
184         bus/at-spi-dbus-bus
185         bus/Makefile])
186
187 AC_OUTPUT