Build fixes
[platform/upstream/at-spi2-core.git] / configure.ac
1 AC_INIT([at-spi2-core], [0.3.90], [accessibility-atspi@lists.linux-foundation.org])
2 AC_PREREQ([2.59])
3 AC_CONFIG_AUX_DIR(config)
4 AC_CONFIG_MACRO_DIR([m4])
5
6 AT_SPI_CORE_MAJOR_VERSION=0
7 AT_SPI_CORE_MINOR_VERSION=1
8 AT_SPI_CORE_MICRO_VERSION=3
9 AT_SPI_CORE_VERSION="$AT_SPI_CORE_MAJOR_VERSION.$AT_SPI_CORE_MINOR_VERSION"
10 AC_SUBST(AT_SPI_CORE_VERSION)
11
12 LT_RELEASE=$AT_SPI_CORE_VERSION
13 LT_CURRENT=0
14 LT_REVISION=1
15 LT_AGE=0
16 LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
17 AC_SUBST(LT_VERSION_INFO)
18 AC_SUBST(LT_RELEASE)
19 AC_SUBST(LT_CURRENT)
20 AC_SUBST(LT_REVISION)
21 AC_SUBST(LT_AGE)
22
23 AM_INIT_AUTOMAKE([1.9 -Wall foreign])
24
25 AC_PROG_CC
26 LT_INIT([disable-static])
27 PKG_PROG_PKG_CONFIG
28
29 AC_CONFIG_HEADERS([config.h])
30
31 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
32 AC_SUBST(DBUS_LIBS)
33 AC_SUBST(DBUS_CFLAGS)
34
35 PKG_CHECK_MODULES(GLIB, [glib-2.0])
36 AC_SUBST(GLIB_LIBS)
37 AC_SUBST(GLIB_CFLAGS)
38 AC_CHECK_LIB([glib-2.0], [g_ptr_array_new_with_free_func], [],
39         [AC_MSG_ERROR([The version of glib-2.0 found does not define ]
40                 [g_ptr_array_new_with_free_func. Please upgrade glib.])],
41         [$GLIB_LIBS])
42
43 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.7.0])
44 AC_SUBST(DBUS_GLIB_LIBS)
45 AC_SUBST(DBUS_GLIB_CFLAGS)
46
47 PKG_CHECK_MODULES(GOBJ, [gobject-2.0 >= 2.0.0])
48 AC_SUBST(GOBJ_LIBS)
49 AC_SUBST(GOBJ_CFLAGS)
50
51 AC_CHECK_LIB(dl, dlopen)
52
53 AC_PATH_XTRA
54
55 if test x$no_x = xyes ; then
56         AC_MSG_ERROR([X development libraries not found])
57 else
58         X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
59 fi
60 AC_SUBST(X_LIBS)
61
62 save_LIBS="$LIBS"
63 LIBS=""
64 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
65 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst,[
66         AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log])],
67         $X_LIBS)
68 AC_SUBST(XTST_LIBS)
69 LIBS="$LIBS $save_LIBS"
70
71 save_LIBS="$LIBS"
72 LIBS=""
73 AC_CHECK_LIB(X11, XkbQueryExtension, have_xkb="maybe", have_xkb="no", $X_LIBS)
74 if test "x$have_xkb" = "xmaybe"; then 
75         AC_CHECK_HEADER([X11/XKBlib.h], have_xkb=yes)
76 fi
77 if test "x$have_xkb" = "xyes"; then
78         AC_DEFINE([HAVE_XKB], [], [Xkb is present])
79 fi
80 LIBS="$LIBS $save_LIBS"
81
82 save_LIBS="$LIBS"
83 LIBS=""
84 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput="maybe", have_xinput="no", $X_LIBS)
85 if test "x$have_xinput" = "xmaybe"; then
86         save_LIBS="$LIBS"
87         LIBS="$LIBS $X_LIBS"
88         AC_CHECK_HEADER([X11/extensions/XInput.h], [have_xinput="yes"])
89         LIBS="$save_LIBS"
90 fi
91 if test "x$have_xinput" != "xyes"; then
92         AC_MSG_ERROR([Couldn't find the XInput library. Check config.log for details])
93 fi
94 XINPUT_LIBS="-lXi"
95 AC_SUBST(XINPUT_LIBS)
96 LIBS="$LIBS $save_LIBS"
97
98 save_LIBS="$LIBS"
99 LIBS=""
100 AC_ARG_ENABLE(xevie,
101         [AS_HELP_STRING([--enable-xevie],
102                 [Build with XEViE support [default=yes]])],
103         enable_xevie="$enableval", enable_xevie=yes)
104
105 if test x$enable_xevie = xyes ; then
106         have_xevie=
107         AC_CHECK_LIB(Xext, XevieStart, have_xevie="yes", have_xevie="no", $X_LIBS)
108
109         if test "x$have_xevie" = "xyes"; then
110                 XEVIE_LIBS="-lXext"
111                 AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
112         else
113            AC_CHECK_LIB(Xevie, XevieQueryVersion, have_xevie="maybe",,$X_LIBS)
114            if test "x$have_xevie" = "xmaybe"; then
115               AC_CHECK_HEADER(X11/extensions/Xevie.h, have_xevie=yes, [],
116               [[#include <X11/Xlib.h>
117 ]])
118               if test "x$have_xevie" = "xyes"; then
119                       XEVIE_LIBS="-lXext -lXevie"              
120                       AC_DEFINE([HAVE_XEVIE], [], [Xevie is present])
121               fi
122            fi   
123         fi
124         AC_SUBST(XEVIE_LIBS)
125 fi
126 LIBS="$LIBS $save_LIBS"
127
128 AC_ARG_VAR([DEFAULT_ATSPI_INTROSPECTION_PATH],
129         [Set the default path for the install of DBus introspection XML ]
130         [relative to the pkgdatadir.])
131 if test -z "$DEFAULT_ATSPI_INTROSPECTION_PATH"; then
132           DEFAULT_ATSPI_INTROSPECTION_PATH=at-spi2/dbus
133 fi
134
135 AC_ARG_WITH([dbus_daemondir],
136         [AS_HELP_STRING([--with-dbus-daemondir=<directory>],
137                 [Directory where the DBUS daemon is installed])],
138     [DBUS_DAEMON="$with_dbus_daemondir/dbus-daemon"],
139     [AC_PATH_PROG([DBUS_DAEMON], [dbus-daemon], [XXXDBUSDAEMONNOTFOUND],
140                 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR]dnl
141 [/libexec$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR/usr/local/bin]dnl
142 [$PATH_SEPARATOR/usr/pkg/bin])]
143         )
144 if test "$DBUS_DAEMON" = "XXXDBUSDAEMONNOTFOUND"; then
145         DBUS_DAEMON = "$bindir/dbus-daemon"
146         AC_MSG_WARN([at-spi2 relies on dbus, and the dbus-daemon was not found])
147         AC_MSG_WARN([we assume that it will be installed in "$bindir"])
148 fi
149 AC_SUBST(DBUS_DAEMON)
150
151 AC_ARG_WITH(dbus-services,
152            [AS_HELP_STRING([--with-dbus-services=<directory>],
153            [where D-BUS services directory is])])
154 if ! test -z "$with_dbus_services" ; then
155            DBUS_SERVICES_DIR="$with_dbus_services"
156 else
157            DBUS_SERVICES_DIR="$datadir/dbus-1/services"
158 fi
159 AC_SUBST(DBUS_SERVICES_DIR)
160
161 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
162
163 AC_ARG_ENABLE([relocate],
164         [AS_HELP_STRING([--enable-relocate],
165                 [Relocate to coexist with CORBA @<:@default=no@:>@])],
166         [enable_relocate="$enableval"],
167         [enable_relocate=no])
168 if test x$enable_relocate = xyes ; then
169         AC_DEFINE(RELOCATE, , [Relocate to coexist with CORBA])
170 fi
171 AM_CONDITIONAL(RELOCATE, test x$enable_relocate = xyes)
172
173 AC_CONFIG_FILES([Makefile
174         xml/Makefile
175         registryd/Makefile
176         bus/Makefile])
177
178 AC_OUTPUT