Added new, more efficient screen review API to AccessibleText.
[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=1
5 AT_SPI_MICRO_VERSION=8
6 AT_SPI_INTERFACE_AGE=0
7 AT_SPI_BINARY_AGE=8
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=`expr $AT_SPI_MICRO_VERSION - $AT_SPI_INTERFACE_AGE`
19 LT_REVISION=$AT_SPI_INTERFACE_AGE
20 LT_AGE=`expr $AT_SPI_BINARY_AGE - $AT_SPI_INTERFACE_AGE`
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 Specify a header configuration file
29 AM_CONFIG_HEADER(config.h)
30
31 dnl Initialize maintainer mode
32 AM_MAINTAINER_MODE
33
34 AC_PROG_INTLTOOL
35
36 dnl Checks for programs
37 AC_PROG_CC
38 AC_PROG_INSTALL
39 AC_ISC_POSIX
40
41 GNOME_COMMON_INIT
42 GNOME_PLATFORM_GNOME_2(yes, force)
43 GNOME_COMPILE_WARNINGS(maximum)
44
45 dnl Initialize libtool
46 AM_DISABLE_STATIC
47 AM_PROG_LIBTOOL
48
49 dnl internationalization support
50 dnl ALL_LINGUAS=""
51 dnl AM_GLIB_GNU_GETTEXT
52
53 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
54
55 gtk_doc_min_version=0.6
56 if $GTKDOC ; then
57     gtk_doc_version=`gtkdoc-mkdb --version`
58     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
59     if perl <<EOF ; then
60 my @installed = split /\./, "$gtk_doc_version";
61 my @required = split /\./, "$gtk_doc_min_version";
62
63 while (scalar @required) {
64     my \$installed_ver = (shift @installed || 0);
65     my \$required_ver = shift @required;
66     exit 1 if (\$installed_ver < \$required_ver);
67     exit 0 if (\$installed_ver > \$required_ver);
68 }
69 exit 0;
70 EOF
71       AC_MSG_RESULT(yes)
72    else
73       AC_MSG_RESULT(no)
74         GTKDOC=false
75    fi
76 fi
77
78 dnl Let people disable the gtk-doc stuff.
79 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
80
81 if test x$enable_gtk_doc = xauto ; then
82   if test x$GTKDOC = xtrue ; then
83     enable_gtk_doc=yes
84   else
85     enable_gtk_doc=no
86   fi
87 fi
88
89 dnl NOTE: We need to use a separate automake conditional for this
90 dnl       to make this work with the tarballs.
91 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
92
93 AC_PATH_XTRA
94
95 if test x$no_x = xyes ; then
96   AC_MSG_ERROR([X development libraries not found])
97 else
98   X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
99 fi
100
101 AC_SUBST(X_LIBS)
102
103 dnl Checks for libraries
104 PKG_CHECK_MODULES(LIBSPI, \
105         libbonobo-2.0 >= 1.107.0 \
106         atk >= 1.1.0 \
107         gtk+-2.0 > 2.0.0 \
108         gail >= 0.16)
109 AC_SUBST(LIBSPI_LIBS)
110 AC_SUBST(LIBSPI_CFLAGS)
111
112 PKG_CHECK_MODULES(REGISTRYD, \
113         libbonobo-2.0 >= 1.107.0 \
114         gtk+-2.0 > 2.0.0 \
115         atk >= 1.1.0)
116 AC_SUBST(REGISTRYD_LIBS)
117 AC_SUBST(REGISTRYD_CFLAGS)
118
119 PKG_CHECK_MODULES(TESTS, \
120         libbonobo-2.0 >= 1.107.0 \
121         atk >= 1.1.0 \
122         gtk+-2.0 > 2.0.0 \
123         gail >= 0.16)
124 AC_SUBST(TESTS_LIBS)
125 AC_SUBST(TESTS_CFLAGS)
126
127 PKG_CHECK_MODULES(ATK_BRIDGE, \
128         libbonobo-2.0 >= 1.107.0 \
129         atk >= 1.1.0)
130 AC_SUBST(ATK_BRIDGE_LIBS)
131 AC_SUBST(ATK_BRIDGE_CFLAGS)
132
133 PKG_CHECK_MODULES(LIBCSPI, \
134         libbonobo-2.0 >= 1.107.0 \
135         atk >= 1.1.0)
136 AC_SUBST(LIBCSPI_LIBS)
137 AC_SUBST(LIBCSPI_CFLAGS)
138
139 dnl orbit-idl.
140 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
141 AC_SUBST(ORBIT_IDL)
142
143 dnl Bonobo and Bonobo-Activation idl files
144 BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
145 LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
146 AC_SUBST(BONOBO_ACTIVATION_IDL_DIR)
147 AC_SUBST(LIBBONOBO_IDL_DIR)
148
149 dnl path to Xtst
150 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst)
151 if test "x$XTST_LIBS" = x; then
152   save_LIBS="$LIBS"
153   for xtstpath in /usr/X11R6/lib /usr/openwin/lib; do
154     LIBS="-L$xtstpath -lXtst"
155     case "$host" in
156     *solaris*) XTST_RPATH_FLAGS="-R$xtstpath" ;;
157     esac
158     AC_MSG_CHECKING(for -lXtst in $xtstpath)
159     AC_TRY_LINK([], [XTestFakeKeyEvent()], [
160         AC_MSG_RESULT(yes)
161         XTST_LIBS="$XTST_RPATH_FLAGS -L$xtstpath -lXtst"
162         LIBS="$save_LIBS"
163         break],[AC_MSG_RESULT(no)])
164   done
165   if test "x$XTST_LIBS" = x; then
166     AC_MSG_ERROR(Couldn't find the Xtst library. Check config.log for details)
167   fi
168 fi
169 AC_SUBST(XTST_LIBS)
170
171 have_xkb=
172 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe",,$X_LIBS)
173 if test "x$have_xkb" = "xmaybe"; then 
174   AC_CHECK_HEADER(X11/XKBlib.h, have_xkb=yes)
175 fi
176 if test "x$have_xkb" = "xyes"; then
177   AC_MSG_RESULT(yes)
178   AC_DEFINE(HAVE_XKB)
179 fi
180
181 have_xinput=
182 AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi)
183 if test "x$XINPUT_LIBS" = x; then
184   save_LIBS="$LIBS"
185   for xinputpath in /usr/X11R6/lib /usr/openwin/lib; do
186     LIBS="-L$xinputpath -lXi"
187     case "$host" in
188     *solaris*) XINPUT_RPATH_FLAGS="-R$xinputpath" ;;
189     esac
190     AC_MSG_CHECKING(for -lXi in $xinputpath)
191     AC_TRY_LINK([], [XOpenDisplay()], [
192         AC_MSG_RESULT(yes)
193         XINPUT_LIBS="$XINPUT_RPATH_FLAGS -L$xinputpath -lXi"
194         LIBS="$save_LIBS"
195         break],[AC_MSG_RESULT(no)])
196   done
197   if test "x$XINPUT_LIBS" = x; then
198     AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
199   fi                           
200     AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
201 fi
202 AC_SUBST(XINPUT_LIBS)
203
204 AC_SUBST(CFLAGS)
205 AC_SUBST(CPPFLAGS)
206 AC_SUBST(LDFLAGS)
207
208 AC_CHECK_LIB(popt, poptGetContext, [POPT_LIBS="-lpopt"],
209 AC_MSG_ERROR([popt is required to build at-spi.
210 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]))
211 AC_SUBST(POPT_LIBS)
212 AC_MSG_CHECKING([for POPT_ARG_FLOAT in popt.h])
213 AC_TRY_CPP([#include <popt.h>
214 #ifndef POPT_ARG_FLOAT
215 #error popt too old
216 #endif], AC_MSG_RESULT(yes), [
217   AC_MSG_RESULT(no)
218   AC_MSG_ERROR([A newer version of popt is required to build at-spi.
219 You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
220 ])
221
222 REBUILD=\#
223 if test "x$enable_rebuilds" = "xyes" && \
224         test -n "$PERL" && \
225         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
226      test -n "$AWK" ; then
227   REBUILD=
228 fi
229 AC_SUBST(REBUILD)
230
231 AC_OUTPUT([
232 Makefile
233 libspi-1.0.pc
234 cspi-1.0.pc
235 docs/Makefile
236 docs/reference/Makefile
237 docs/reference/cspi/Makefile
238 idl/Makefile
239 libspi/Makefile
240 registryd/Makefile
241 atk-bridge/Makefile
242 test/Makefile
243 cspi/Makefile
244 cspi/bonobo/Makefile
245 ])
246
247 echo "AT-SPI setup:
248
249         Source code location:   ${srcdir}
250         Compiler:               ${CC} 
251         Prefix:                 ${prefix}
252
253         Welcome to the wonderful world of Accessibility.
254            http://developer.gnome.org/projects/gap/
255 "