New IDL API, extensions to basic at-spi interfaces.
[platform/upstream/at-spi2-core.git] / configure.in
1 AC_INIT(idl/Accessibility.idl)
2
3 AT_SPI_MAJOR_VERSION=1
4 AT_SPI_MINOR_VERSION=7
5 AT_SPI_MICRO_VERSION=0
6 AT_SPI_INTERFACE_AGE=0
7 AT_SPI_BINARY_AGE=0
8 AT_SPI_VERSION="$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION.$AT_SPI_MICRO_VERSION"
9 AM_INIT_AUTOMAKE(at-spi, $AT_SPI_VERSION)
10 AC_SUBST(AT_SPI_MAJOR_VERSION)
11 AC_SUBST(AT_SPI_MINOR_VERSION)
12 AC_SUBST(AT_SPI_MICRO_VERSION)
13 AC_SUBST(AT_SPI_INTERFACE_AGE)
14 AC_SUBST(AT_SPI_BINARY_AGE)
15
16 # libtool versioning
17 LT_RELEASE=$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION
18 LT_CURRENT=10
19 LT_REVISION=6
20 LT_AGE=10
21 LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
22 AC_SUBST(LT_VERSION_INFO)
23 AC_SUBST(LT_RELEASE)
24 AC_SUBST(LT_CURRENT)
25 AC_SUBST(LT_REVISION)
26 AC_SUBST(LT_AGE)
27
28 dnl required versions of other tools.
29 m4_define([req_ver_atk],        [1.7.2])
30 m4_define([req_ver_libbonobo],  [1.107.0])
31 m4_define([req_ver_gail],       [1.3.0])
32 m4_define([req_ver_gtk],        [2.0.0])
33
34 dnl Specify a header configuration file
35 AM_CONFIG_HEADER(config.h)
36
37 dnl Initialize maintainer mode
38 AM_MAINTAINER_MODE
39
40 AC_PROG_INTLTOOL
41
42 dnl Checks for programs
43 AC_PROG_CC
44 AC_PROG_INSTALL
45 AC_ISC_POSIX
46
47 GNOME_COMMON_INIT
48 GNOME_COMPILE_WARNINGS(maximum)
49
50 dnl Initialize libtool
51 AM_DISABLE_STATIC
52 AM_PROG_LIBTOOL
53
54 dnl DO NOT PUT THIS BACK: at-spi DOES NOT INCLUDE TRANSLATABLE STRINGS. wph 2006.
55 dnl
56 dnl internationalization support; uncomment if translatable strings are reintroduced
57 dnl ALL_LINGUAS="ar az be bg bn bs ca cs cy da de el en_CA en_GB eo es et eu fa fi fr gl gu he hi hr hu id is it ja ka ko lt mn mr ms nb ne nl nn no or pa pl pt_BR pt ro ru rw sk sl sq sr@ije sr@Latn sr sv th ug uk vi wa xh zh_CN zh_HK zh_TW"
58 dnl AM_GLIB_GNU_GETTEXT
59
60 GTK_DOC_CHECK([1.0])
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
70 AC_SUBST(X_LIBS)
71
72 dnl Check for obsolete (mis-numbered) versions of at-spi
73 dnl oldlibs=`echo $(libdir)/libspi.so.1.*`
74 dnl if test $$oldlibs != "$(libdir)/libspi.so.1.*" ; then
75 dnl   AC_MSG_ERROR(Old libspi.1.x library found in $libdir. Please remove $(libdir)/libspi.so.1 and $$oldlibs)
76 dnl fi
77
78 dnl Checks for libraries
79 PKG_CHECK_MODULES(LIBSPI, [
80         libbonobo-2.0   >= req_ver_libbonobo
81         atk             >= req_ver_atk
82         gtk+-2.0        >= req_ver_gtk
83         gail            >= req_ver_gail
84 ])
85 AC_SUBST(LIBSPI_LIBS)
86 AC_SUBST(LIBSPI_CFLAGS)
87
88 PKG_CHECK_MODULES(REGISTRYD, [
89         libbonobo-2.0   >= req_ver_libbonobo
90         atk             >= req_ver_atk
91         gtk+-2.0        >= req_ver_gtk
92 ])
93 AC_SUBST(REGISTRYD_LIBS)
94 AC_SUBST(REGISTRYD_CFLAGS)
95
96 PKG_CHECK_MODULES(TESTS, [
97         libbonobo-2.0   >= req_ver_libbonobo
98         atk             >= req_ver_atk
99         gtk+-2.0        >= req_ver_gtk
100         gail            >= req_ver_gail
101 ])
102 AC_SUBST(TESTS_LIBS)
103 AC_SUBST(TESTS_CFLAGS)
104
105 PKG_CHECK_MODULES(ATK_BRIDGE, [
106         libbonobo-2.0   >= req_ver_libbonobo
107         atk             >= req_ver_atk
108 ])
109 AC_SUBST(ATK_BRIDGE_LIBS)
110 AC_SUBST(ATK_BRIDGE_CFLAGS)
111
112 PKG_CHECK_MODULES(LIBCSPI, [
113         libbonobo-2.0   >= req_ver_libbonobo
114         atk             >= req_ver_atk
115 ])
116 AC_SUBST(LIBCSPI_LIBS)
117 AC_SUBST(LIBCSPI_CFLAGS)
118
119 dnl orbit-idl.
120 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
121 AC_SUBST(ORBIT_IDL)
122
123 dnl Bonobo and Bonobo-Activation idl files
124 BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
125 LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
126 AC_SUBST(BONOBO_ACTIVATION_IDL_DIR)
127 AC_SUBST(LIBBONOBO_IDL_DIR)
128
129 LIBS="$LIBS $X_LIBS"
130 dnl path to Xtst
131 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
132         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
133         -lX11 -lXext)
134 AC_SUBST(XTST_LIBS)
135
136 have_xkb=
137 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe")
138 if test "x$have_xkb" = "xmaybe"; then 
139         AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
140 fi
141 if test "x$have_xkb" = "xyes"; then
142         AC_MSG_RESULT(yes)
143         AC_DEFINE(HAVE_XKB)
144 fi
145
146 have_xinput=
147 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi,,-lXext)
148 if test "x$XINPUT_LIBS" = x; then
149         AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
150 fi                             
151 AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
152 AC_SUBST(XINPUT_LIBS)
153
154 dnl Allow disabling XEViE.
155 AC_ARG_ENABLE(xevie, [  --enable-xevie  Build with XEViE support [default=yes]], enable_xevie="$enableval", enable_xevie=yes)
156
157 if test x$enable_xevie = xyes ; then
158         have_xevie=
159         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes")
160
161         if test "x$have_xevie" = "xyes"; then
162                 XEVIE_LIBS="-lXext"
163                 AC_DEFINE(HAVE_XEVIE)
164         else
165            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,-lXext)
166            if test "x$have_xevie" = "xmaybe"; then
167               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes)
168               if test "x$have_xevie" = "xyes"; then
169                       XEVIE_LIBS="-lXext -lXevie"              
170                       AC_DEFINE(HAVE_XEVIE)
171               fi
172            fi   
173         fi
174         AC_SUBST(XEVIE_LIBS)
175 fi
176
177 dnl CFLAGS="$CFLAGS -Wall"
178 AC_SUBST(CFLAGS)
179 AC_SUBST(CPPFLAGS)
180 AC_SUBST(LDFLAGS)
181
182 AC_CHECK_LIB(popt, poptGetContext, [POPT_LIBS="-lpopt"],
183 AC_MSG_ERROR([popt is required to build at-spi.
184 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]))
185 AC_SUBST(POPT_LIBS)
186 AC_MSG_CHECKING([for POPT_ARG_FLOAT in popt.h])
187 AC_TRY_CPP([#include <popt.h>
188 #ifndef POPT_ARG_FLOAT
189 #error popt too old
190 #endif], AC_MSG_RESULT(yes), [
191         AC_MSG_RESULT(no)
192         AC_MSG_ERROR([A newer version of popt is required to build at-spi.
193 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
194 ])
195
196 REBUILD=\#
197 if test "x$enable_rebuilds" = "xyes" && \
198         test -n "$PERL" && \
199         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
200         test -n "$AWK" ; then
201                 REBUILD=
202 fi
203 AC_SUBST(REBUILD)
204
205 AC_OUTPUT([
206 Makefile
207 libspi-1.0.pc
208 libspi-1.0-uninstalled.pc
209 libloginhelper-1.0.pc
210 cspi-1.0.pc
211 cspi-1.0-uninstalled.pc
212 docs/Makefile
213 docs/reference/Makefile
214 docs/reference/cspi/Makefile
215 idl/Makefile
216 libspi/Makefile
217 registryd/Makefile
218 atk-bridge/Makefile
219 login-helper/Makefile
220 test/Makefile
221 cspi/Makefile
222 cspi/bonobo/Makefile
223 ])
224
225 echo "AT-SPI setup:
226
227         Source code location:   ${srcdir}
228         Compiler:               ${CC} 
229         Prefix:                 ${prefix}
230
231         Welcome to the wonderful world of Accessibility.
232            http://developer.gnome.org/projects/gap/
233 "