2004-10-11 MÉ\99tin Æ\8fmirov <metin@karegen.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=6
5 AT_SPI_MICRO_VERSION=0
6 AT_SPI_INTERFACE_AGE=0
7 AT_SPI_BINARY_AGE=5
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=4
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 internationalization support; uncomment if translatable strings are reintroduced
55 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 id is it ja ka ko lt mn ms nb ne nl nn no or pa pl pt_BR pt ro ru sk sl sq sr@ije sr@Latn sr sv uk vi wa zh_CN"
56 dnl AM_GLIB_GNU_GETTEXT
57
58 GTK_DOC_CHECK([1.0])
59
60 AC_PATH_XTRA
61
62 if test x$no_x = xyes ; then
63         AC_MSG_ERROR([X development libraries not found])
64 else
65         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
66 fi
67
68 AC_SUBST(X_LIBS)
69
70 dnl Check for obsolete (mis-numbered) versions of at-spi
71 dnl oldlibs=`echo $(libdir)/libspi.so.1.*`
72 dnl if test $$oldlibs != "$(libdir)/libspi.so.1.*" ; then
73 dnl   AC_MSG_ERROR(Old libspi.1.x library found in $libdir. Please remove $(libdir)/libspi.so.1 and $$oldlibs)
74 dnl fi
75
76 dnl Checks for libraries
77 PKG_CHECK_MODULES(LIBSPI, [
78         libbonobo-2.0   >= req_ver_libbonobo
79         atk             >= req_ver_atk
80         gtk+-2.0        >= req_ver_gtk
81         gail            >= req_ver_gail
82 ])
83 AC_SUBST(LIBSPI_LIBS)
84 AC_SUBST(LIBSPI_CFLAGS)
85
86 PKG_CHECK_MODULES(REGISTRYD, [
87         libbonobo-2.0   >= req_ver_libbonobo
88         atk             >= req_ver_atk
89         gtk+-2.0        >= req_ver_gtk
90 ])
91 AC_SUBST(REGISTRYD_LIBS)
92 AC_SUBST(REGISTRYD_CFLAGS)
93
94 PKG_CHECK_MODULES(TESTS, [
95         libbonobo-2.0   >= req_ver_libbonobo
96         atk             >= req_ver_atk
97         gtk+-2.0        >= req_ver_gtk
98         gail            >= req_ver_gail
99 ])
100 AC_SUBST(TESTS_LIBS)
101 AC_SUBST(TESTS_CFLAGS)
102
103 PKG_CHECK_MODULES(ATK_BRIDGE, [
104         libbonobo-2.0   >= req_ver_libbonobo
105         atk             >= req_ver_atk
106 ])
107 AC_SUBST(ATK_BRIDGE_LIBS)
108 AC_SUBST(ATK_BRIDGE_CFLAGS)
109
110 PKG_CHECK_MODULES(LIBCSPI, [
111         libbonobo-2.0   >= req_ver_libbonobo
112         atk             >= req_ver_atk
113 ])
114 AC_SUBST(LIBCSPI_LIBS)
115 AC_SUBST(LIBCSPI_CFLAGS)
116
117 dnl orbit-idl.
118 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
119 AC_SUBST(ORBIT_IDL)
120
121 dnl Bonobo and Bonobo-Activation idl files
122 BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
123 LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
124 AC_SUBST(BONOBO_ACTIVATION_IDL_DIR)
125 AC_SUBST(LIBBONOBO_IDL_DIR)
126
127 LIBS="$LIBS $X_LIBS"
128 dnl path to Xtst
129 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
130         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
131         -lX11 -lXext)
132 AC_SUBST(XTST_LIBS)
133
134 have_xkb=
135 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe")
136 if test "x$have_xkb" = "xmaybe"; then 
137         AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
138 fi
139 if test "x$have_xkb" = "xyes"; then
140         AC_MSG_RESULT(yes)
141         AC_DEFINE(HAVE_XKB)
142 fi
143
144 have_xinput=
145 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi,,-lXext)
146 if test "x$XINPUT_LIBS" = x; then
147         AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
148 fi                             
149 AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
150 AC_SUBST(XINPUT_LIBS)
151
152 dnl Allow disabling XEViE.
153 AC_ARG_ENABLE(xevie, [  --enable-xevie  Build with XEViE support [default=yes]], enable_xevie="$enableval", enable_xevie=yes)
154
155 if test x$enable_xevie = xyes ; then
156         have_xevie=
157         AC_CHECK_LIB(Xext, XevieQueryVersion, have_xevie="yes")
158
159         if test "x$have_xevie" = "xyes"; then
160                 XEVIE_LIBS=-lXext
161                 AC_DEFINE(HAVE_XEVIE)
162         fi
163         AC_SUBST(XEVIE_LIBS)
164 fi
165
166 dnl CFLAGS="$CFLAGS -Wall"
167 AC_SUBST(CFLAGS)
168 AC_SUBST(CPPFLAGS)
169 AC_SUBST(LDFLAGS)
170
171 AC_CHECK_LIB(popt, poptGetContext, [POPT_LIBS="-lpopt"],
172 AC_MSG_ERROR([popt is required to build at-spi.
173 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]))
174 AC_SUBST(POPT_LIBS)
175 AC_MSG_CHECKING([for POPT_ARG_FLOAT in popt.h])
176 AC_TRY_CPP([#include <popt.h>
177 #ifndef POPT_ARG_FLOAT
178 #error popt too old
179 #endif], AC_MSG_RESULT(yes), [
180         AC_MSG_RESULT(no)
181         AC_MSG_ERROR([A newer version of popt is required to build at-spi.
182 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
183 ])
184
185 REBUILD=\#
186 if test "x$enable_rebuilds" = "xyes" && \
187         test -n "$PERL" && \
188         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
189         test -n "$AWK" ; then
190                 REBUILD=
191 fi
192 AC_SUBST(REBUILD)
193
194 AC_OUTPUT([
195 Makefile
196 libspi-1.0.pc
197 libspi-1.0-uninstalled.pc
198 libloginhelper-1.0.pc
199 cspi-1.0.pc
200 cspi-1.0-uninstalled.pc
201 docs/Makefile
202 docs/reference/Makefile
203 docs/reference/cspi/Makefile
204 idl/Makefile
205 libspi/Makefile
206 registryd/Makefile
207 atk-bridge/Makefile
208 login-helper/Makefile
209 test/Makefile
210 cspi/Makefile
211 cspi/bonobo/Makefile
212 ])
213
214 echo "AT-SPI setup:
215
216         Source code location:   ${srcdir}
217         Compiler:               ${CC} 
218         Prefix:                 ${prefix}
219
220         Welcome to the wonderful world of Accessibility.
221            http://developer.gnome.org/projects/gap/
222 "