2007-01-08 Li Yuan <li.yuan@sun.com>
[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=15
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=11
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.12.0])
30 m4_define([req_ver_gtk],        [2.10.0])
31 m4_define([req_ver_gail],       [1.9.0])
32 m4_define([req_ver_libbonobo],  [1.107.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 dnl translation of any at-spi strings: used only for .server
41 IT_PROG_INTLTOOL([0.35.0])
42
43 dnl Checks for programs
44 AC_PROG_CC
45 AC_PROG_INSTALL
46 AC_ISC_POSIX
47
48 GNOME_COMMON_INIT
49 GNOME_COMPILE_WARNINGS(maximum)
50
51 dnl Initialize libtool
52 AM_DISABLE_STATIC
53 AM_PROG_LIBTOOL
54
55 GETTEXT_PACKAGE="${PACKAGE}"
56 AC_SUBST(GETTEXT_PACKAGE)
57 dnl internationalization support; uncomment if translatable strings are reintroduced
58 AM_GLIB_GNU_GETTEXT
59
60 # AM_GLIB_GNU_GETTEXT above subst. $DATADIRNAME
61 # this is the directory where the *.{mo,gmo} files are installed
62 localedir='${prefix}/${DATADIRNAME}/locale'
63 AC_SUBST(localedir)
64
65 GTK_DOC_CHECK([1.0])
66
67 AC_PATH_XTRA
68
69 if test x$no_x = xyes ; then
70         AC_MSG_ERROR([X development libraries not found])
71 else
72         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
73 fi
74
75 AC_SUBST(X_LIBS)
76
77 dnl Check for obsolete (mis-numbered) versions of at-spi
78 dnl oldlibs=`echo $(libdir)/libspi.so.1.*`
79 dnl if test $$oldlibs != "$(libdir)/libspi.so.1.*" ; then
80 dnl   AC_MSG_ERROR(Old libspi.1.x library found in $libdir. Please remove $(libdir)/libspi.so.1 and $$oldlibs)
81 dnl fi
82
83 dnl Checks for libraries
84 PKG_CHECK_MODULES(LIBSPI, [
85         libbonobo-2.0   >= req_ver_libbonobo
86         atk             >= req_ver_atk
87 ])
88 AC_SUBST(LIBSPI_LIBS)
89 AC_SUBST(LIBSPI_CFLAGS)
90
91 PKG_CHECK_MODULES(REGISTRYD, [
92         libbonobo-2.0   >= req_ver_libbonobo
93         atk             >= req_ver_atk
94         gtk+-2.0        >= req_ver_gtk
95 ])
96 AC_SUBST(REGISTRYD_LIBS)
97 AC_SUBST(REGISTRYD_CFLAGS)
98
99 PKG_CHECK_MODULES(TESTS, [
100         libbonobo-2.0   >= req_ver_libbonobo
101         atk             >= req_ver_atk
102         gtk+-2.0        >= req_ver_gtk
103         gail            >= req_ver_gail
104 ])
105 AC_SUBST(TESTS_LIBS)
106 AC_SUBST(TESTS_CFLAGS)
107
108 PKG_CHECK_MODULES(ATK_BRIDGE, [
109         libbonobo-2.0   >= req_ver_libbonobo
110         atk             >= req_ver_atk
111 ])      
112 AC_SUBST(ATK_BRIDGE_LIBS)
113 AC_SUBST(ATK_BRIDGE_CFLAGS)
114
115 PKG_CHECK_MODULES(LIBCSPI, [
116         libbonobo-2.0   >= req_ver_libbonobo
117         atk             >= req_ver_atk
118 ])
119 AC_SUBST(LIBCSPI_LIBS)
120 AC_SUBST(LIBCSPI_CFLAGS)
121
122 PKG_CHECK_MODULES(ORBIT, [
123         ORBit-2.0
124 ])
125 AC_SUBST(ORBIT_LIBS)
126 AC_SUBST(ORBIT_CFLAGS)
127
128 dnl orbit-idl.
129 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
130 AC_SUBST(ORBIT_IDL)
131
132 dnl Bonobo and Bonobo-Activation idl files
133 BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
134 LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
135 AC_SUBST(BONOBO_ACTIVATION_IDL_DIR)
136 AC_SUBST(LIBBONOBO_IDL_DIR)
137
138 LIBS="$LIBS $X_LIBS"
139 dnl path to Xtst
140 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
141         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
142         -lX11 -lXext)
143 AC_SUBST(XTST_LIBS)
144
145 have_xkb=
146 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe")
147 if test "x$have_xkb" = "xmaybe"; then 
148         AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
149 fi
150 if test "x$have_xkb" = "xyes"; then
151         AC_MSG_RESULT(yes)
152         AC_DEFINE(HAVE_XKB)
153 fi
154
155 have_xinput=
156 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi,,-lXext)
157 if test "x$XINPUT_LIBS" = x; then
158         AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
159 fi                             
160 AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
161 AC_SUBST(XINPUT_LIBS)
162
163 dnl Allow disabling XEViE.
164 AC_ARG_ENABLE(xevie, [  --enable-xevie  Build with XEViE support [default=yes]], enable_xevie="$enableval", enable_xevie=yes)
165
166 if test x$enable_xevie = xyes ; then
167         have_xevie=
168         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes")
169
170         if test "x$have_xevie" = "xyes"; then
171                 XEVIE_LIBS="-lXext"
172                 AC_DEFINE(HAVE_XEVIE)
173         else
174            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,-lXevie -lXext)
175            if test "x$have_xevie" = "xmaybe"; then
176               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [], [#include <X11/Xlib.h>])
177               if test "x$have_xevie" = "xyes"; then
178                       XEVIE_LIBS="-lXext -lXevie"              
179                       AC_DEFINE(HAVE_XEVIE)
180               fi
181            fi   
182         fi
183         AC_SUBST(XEVIE_LIBS)
184 fi
185
186 dnl CFLAGS="$CFLAGS -Wall"
187 AC_SUBST(CFLAGS)
188 AC_SUBST(CPPFLAGS)
189 AC_SUBST(LDFLAGS)
190
191 AC_CHECK_LIB(popt, poptGetContext, [POPT_LIBS="-lpopt"],
192 AC_MSG_ERROR([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 AC_SUBST(POPT_LIBS)
195 AC_MSG_CHECKING([for POPT_ARG_FLOAT in popt.h])
196 AC_TRY_CPP([#include <popt.h>
197 #ifndef POPT_ARG_FLOAT
198 #error popt too old
199 #endif], AC_MSG_RESULT(yes), [
200         AC_MSG_RESULT(no)
201         AC_MSG_ERROR([A newer version of popt is required to build at-spi.
202 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
203 ])
204
205 #libtool option to strip symbols starting with cspi
206 #
207 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^cspi]].*"'
208 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
209
210 REBUILD=\#
211 if test "x$enable_rebuilds" = "xyes" && \
212         test -n "$PERL" && \
213         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
214         test -n "$AWK" ; then
215                 REBUILD=
216 fi
217 AC_SUBST(REBUILD)
218
219 AC_OUTPUT([
220 Makefile
221 po/Makefile.in
222 libspi-1.0.pc
223 libspi-1.0-uninstalled.pc
224 libloginhelper-1.0.pc
225 cspi-1.0.pc
226 cspi-1.0-uninstalled.pc
227 docs/Makefile
228 docs/reference/Makefile
229 docs/reference/cspi/Makefile
230 docs/reference/idl/Makefile
231 idl/Makefile
232 libspi/Makefile
233 registryd/Makefile
234 atk-bridge/Makefile
235 login-helper/Makefile
236 test/Makefile
237 cspi/Makefile
238 cspi/bonobo/Makefile
239 ])
240
241 echo "AT-SPI setup:
242
243         Source code location:   ${srcdir}
244         Compiler:               ${CC} 
245         Prefix:                 ${prefix}
246
247         Welcome to the wonderful world of Accessibility.
248            http://developer.gnome.org/projects/gap/
249 "