2009-07-22 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/upstream/at-spi2-core.git] / configure.ac
1
2 AC_INIT([at-spi], [1.9.0], [accessibility-atspi@lists.linux-foundation.org])
3 AC_CONFIG_AUX_DIR(config)
4
5 AT_SPI_MAJOR_VERSION=1
6 AT_SPI_MINOR_VERSION=23
7 AT_SPI_MICRO_VERSION=3
8 AT_SPI_INTERFACE_AGE=0
9 AT_SPI_BINARY_AGE=0
10 AT_SPI_VERSION="$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION.$AT_SPI_MICRO_VERSION"
11 AC_SUBST(AT_SPI_MAJOR_VERSION)
12 AC_SUBST(AT_SPI_MINOR_VERSION)
13 AC_SUBST(AT_SPI_MICRO_VERSION)
14 AC_SUBST(AT_SPI_INTERFACE_AGE)
15 AC_SUBST(AT_SPI_BINARY_AGE)
16
17 # libtool versioning
18 LT_RELEASE=$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION
19 LT_CURRENT=10
20 LT_REVISION=11
21 LT_AGE=10
22 LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
23 AC_SUBST(LT_VERSION_INFO)
24 AC_SUBST(LT_RELEASE)
25 AC_SUBST(LT_CURRENT)
26 AC_SUBST(LT_REVISION)
27 AC_SUBST(LT_AGE)
28
29 AM_INIT_AUTOMAKE([-Wall foreign])
30
31 dnl translation of any at-spi strings: used only for .server
32 dnl IT_PROG_INTLTOOL([0.35.0])
33
34 AC_PROG_CC
35 AM_PATH_PYTHON(2.4)
36 AM_DISABLE_STATIC
37 AM_PROG_LIBTOOL
38 PKG_PROG_PKG_CONFIG
39
40 GETTEXT_PACKAGE="${PACKAGE}"
41 AC_SUBST(GETTEXT_PACKAGE)
42 dnl internationalization support; uncomment if translatable strings are reintroduced
43 AM_GLIB_GNU_GETTEXT
44
45 # AM_GLIB_GNU_GETTEXT above subst. $DATADIRNAME
46 # this is the directory where the *.{mo,gmo} files are installed
47 localedir='${prefix}/${DATADIRNAME}/locale'
48 AC_SUBST(localedir)
49
50 AC_CONFIG_HEADERS([config.h])
51
52 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
53 AC_SUBST(DBUS_LIBS)
54 AC_SUBST(DBUS_CFLAGS)
55
56 PKG_CHECK_MODULES(GLIB, [glib-2.0])
57 AC_SUBST(GLIB_LIBS)
58 AC_SUBST(GLIB_CFLAGS)
59
60 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.7.0])
61 AC_SUBST(DBUS_GLIB_LIBS)
62 AC_SUBST(DBUS_GLIB_CFLAGS)
63
64 PKG_CHECK_MODULES(LIB_XML, [libxml-2.0 >= 2.0.0])
65 AC_SUBST(LIB_XML_LIBS)
66 AC_SUBST(LIB_XML_CFLAGS)
67
68 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
69 AC_SUBST(GOBJ_LIBS)
70 AC_SUBST(GOBJ_CFLAGS)
71
72 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.0.0])      
73 AC_SUBST(GMODULE_LIBS)
74 AC_SUBST(GMODULE_CFLAGS)
75
76 PKG_CHECK_MODULES(ATK, [atk >= 1.17.0])
77 AC_SUBST(ATK_LIBS)
78 AC_SUBST(ATK_CFLAGS)
79
80 PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0])
81 AC_SUBST(GTK_LIBS)
82 AC_SUBST(GTK_CFLAGS)
83
84 PKG_CHECK_MODULES(GDK, [gdk-2.0 >= 2.0.0])
85 AC_SUBST(GDK_LIBS)
86 AC_SUBST(GDK_CFLAGS)
87
88 AC_PATH_XTRA
89
90 if test x$no_x = xyes ; then
91         AC_MSG_ERROR([X development libraries not found])
92 else
93         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
94 fi
95 AC_SUBST(X_LIBS)
96
97 #LIBS="$LIBS $X_LIBS"
98 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
99         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
100         -lX11 -lXext)
101 AC_SUBST(XTST_LIBS)
102
103 have_xkb=
104 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe")
105 if test "x$have_xkb" = "xmaybe"; then 
106         AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
107 fi
108 if test "x$have_xkb" = "xyes"; then
109         AC_MSG_RESULT(yes)
110         AC_DEFINE([HAVE_XKB], [], Xkb is present)
111 fi
112
113 have_xinput=
114 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi,,-lXext)
115 if test "x$XINPUT_LIBS" = x; then
116         AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
117 fi                             
118 AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
119 AC_SUBST(XINPUT_LIBS)
120
121 AC_ARG_ENABLE(xevie, [--enable-xevie  Build with XEViE support [default=yes]], enable_xevie="$enableval", enable_xevie=yes)
122
123 if test x$enable_xevie = xyes ; then
124         have_xevie=
125         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes")
126
127         if test "x$have_xevie" = "xyes"; then
128                 XEVIE_LIBS="-lXext"
129                 AC_DEFINE([HAVE_XEVIE], [], Xevie is present)
130         else
131            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,-lXevie -lXext)
132            if test "x$have_xevie" = "xmaybe"; then
133               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [], [#include <X11/Xlib.h>])
134               if test "x$have_xevie" = "xyes"; then
135                       XEVIE_LIBS="-lXext -lXevie"              
136                       AC_DEFINE([HAVE_XEVIE], [], Xevie is present)
137               fi
138            fi   
139         fi
140         AC_SUBST(XEVIE_LIBS)
141 fi
142
143 dnl Allow disabling SMlib
144 AC_ARG_ENABLE(sm, [  --enable-sm  Enable session management support [default=yes]], enable_sm="$enableval", enable_sm=yes)
145
146 if test x$enable_sm = xyes ; then
147         have_sm=
148         AC_CHECK_LIB(SM, SmcSaveYourselfDone, have_sm="yes")
149         if test x$have_sm = xyes ; then
150                 SM_LIBS="-lSM -lICE"
151                 AC_DEFINE(HAVE_SM, , [Building with SM support])
152         fi
153         AC_SUBST(SM_LIBS)
154 fi
155
156
157 AC_ARG_VAR([DEFAULT_ATSPI_INTROSPECTION_PATH],
158            [Set the default path for the install ofDBus introspection XML
159             relative to the pkgdatadir.])
160 if test -z "$DEFAULT_ATSPI_INTROSPECTION_PATH"; then
161           DEFAULT_ATSPI_INTROSPECTION_PATH=dbus
162 fi
163
164 AC_ARG_VAR([GTK_MODULE_DIR],
165            [Where to place the atk-adaptor gtk module])
166 if test -z "$GTK_MODULE_DIR"; then
167           GTK_MODULE_DIR=gtk-2.0/modules
168 fi
169
170 AC_ARG_WITH(dbus-services,
171            [AC_HELP_STRING([--with-dbus-services=<dir>],
172            [where D-BUS services directory is])])
173 if ! test -z "$with_dbus_services" ; then
174            DBUS_SERVICES_DIR="$with_dbus_services"
175 else
176            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
177 fi
178 AC_SUBST(DBUS_SERVICES_DIR)
179
180 dnl find sizes & alignments
181 orig_CPPFLAGS=$CPPFLAGS
182 CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
183 DBIND_CHECK_ALIGNOF(char)
184 DBIND_CHECK_ALIGNOF(dbus_bool_t)
185 DBIND_CHECK_ALIGNOF(dbus_int16_t)
186 DBIND_CHECK_ALIGNOF(dbus_int32_t)
187 DBIND_CHECK_ALIGNOF(dbus_int64_t)
188 DBIND_CHECK_ALIGNOF(double)
189 DBIND_CHECK_ALIGNOF(dbind_pointer)
190 DBIND_CHECK_ALIGNOF(dbind_struct)
191 CPPFLAGS=$orig_CPPFLAGS 
192
193 #libtool option to strip symbols starting with cspi
194 #
195 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^cspi]].*"'
196 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
197
198 AC_CONFIG_FILES([Makefile
199                  libloginhelper-1.0.pc
200                  cspi-1.0.pc
201                  cspi-1.0-uninstalled.pc
202                  xml/Makefile
203                  tests/Makefile
204                  tools/Makefile
205                  droute/Makefile
206                  spi-common/Makefile
207                  registryd/Makefile
208                  registryd/at-spi-registryd.desktop.in
209                  atk-adaptor/Makefile
210                  login-helper/Makefile
211                  tests/dummyatk/Makefile
212                  tests/data/Makefile
213                  tests/pyatspi/Makefile
214                  tests/pyatspi/pasytest/Makefile
215                  tests/apps/Makefile
216                  tests/cspi/Makefile
217                  dbind/Makefile
218                  cspi/Makefile
219                  pyatspi/Makefile
220                  dbind-config.h])
221
222 AC_OUTPUT