2 AC_INIT([dasher],[4.11])
4 # This becomes part of AC_INIT in autoconf 2.64
5 m4_ifndef([AC_PACKAGE_URL],
6 [m4_define([AC_PACKAGE_URL],["http://www.inference.phy.cam.ac.uk/dasher/"])
7 AC_DEFINE_UNQUOTED([PACKAGE_URL],
9 [Define to the home page for this package.])
10 AC_SUBST([PACKAGE_URL],[AC_PACKAGE_URL])])
12 AC_CONFIG_SRCDIR([Src/main.cc])
13 AC_CONFIG_HEADERS(config.h)
14 AC_CONFIG_AUX_DIR([build-aux])
15 AC_CONFIG_MACRO_DIR([m4])
22 # IT_PROG_INTLTOOL requires AM_NLS but ignores --enable-nls
24 AM_CONDITIONAL(USE_INTLTOOL, test "x$USE_NLS" = "xyes")
25 AS_IF([test "x$USE_NLS" = "xyes"],[
26 IT_PROG_INTLTOOL([0.40.1])
28 [touch po/Makefile.in.in]) dnl as intltoolize insists
30 LT_INIT([disable-static])
34 GETTEXT_PACKAGE=dasher
35 AC_SUBST(GETTEXT_PACKAGE)
36 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
45 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6)
49 AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
53 AS_HELP_STRING([--enable-debug],
54 [build with additional debugging checks (default is NO)]),
55 if test "x$enable_debug" = "xno"; then
63 AS_HELP_STRING([--with-gnome],[build GNOME documentation (default is YES)]),
64 if test "x$with_gnome" = "xno"; then
68 # Need to work out how to translate replaced variables before uncommenting
69 # AC_CONFIG_FILES([Data/Help/Gnome/C/dasher.xml])
73 AC_ARG_ENABLE([speech],
74 [AS_HELP_STRING([--enable-speech=@<:@speechdispatcher,gnomespeech@:>@],
75 [build with speech support (default is YES)])])
78 AS_HELP_STRING([--with-qte],[build with QTE support (default is NO -- currently untested)]),
79 if test "x$withval" = "xno"; then
87 AS_HELP_STRING([--with-gpe],[build with GPE support (default is NO -- currently untested)]),
88 if test "x$withval" = "xno"; then
96 [AS_HELP_STRING([--enable-a11y],
97 [use cspi rather than Xtst for direct entry mode if found])])
99 AC_ARG_ENABLE([japanese],
100 AS_HELP_STRING([--enable-japanese],[build with support for Japanese Kanji entry (experimental -- default is NO)]),
101 if test "x$enableval" = "xno"; then
104 AC_CHECK_LIB(canna, RkBgnBun,, AC_MSG_ERROR([Canna library not found (required for Japanese).]))
109 AC_ARG_ENABLE([joystick],
110 AS_HELP_STRING([--enable-joystick],[Build with Linux joystick support (note that other UNIX based operating systems aren't supported here)]),
111 if test "x$enableval" = "xno"; then
119 AC_ARG_ENABLE([tilt],
120 AS_HELP_STRING([--enable-tilt],[Build with experimental support for tilt sensor input (experimental -- default is NO)]),
121 if test "x$enableval" = "xno"; then
130 AS_HELP_STRING([--with-maemo],[build with Maemo support (default is NO)]),
131 if test "x$withval" = "xyes"; then
140 AC_ARG_WITH([maemo-fullscreen],
141 AS_HELP_STRING([--with-maemo-fullscreen],[build as standalone Maemo fullscreen app (default is NO)]),
142 if test "x$withval" = "xyes"; then
143 WITHMAEMOFULLSCREEN=true;
148 WITHMAEMOFULLSCREEN=false;
150 WITHMAEMOFULLSCREEN=false)
153 dnl AC_ARG_WITH([darwin],
154 dnl AS_HELP_STRING([--with-darwin],[build with Darwin (Mac OS X) support (default is NO)]),
155 dnl if test "x$withval" = "xyes"; then
158 dnl WITHDARWIN=false;
160 dnl WITHDARWIN=false)
163 AS_HELP_STRING([--with-cairo],[build with cairo support (default is YES)]),
164 if test "x$withval" = "xno"; then
171 AC_ARG_WITH([gsettings],
172 [AS_HELP_STRING([--with-gsettings],
173 [store user preferences using GSettings (default is YES)])])
174 AC_ARG_VAR([GLIB_COMPILE_SCHEMAS],
175 [Path to glib-compile-schemas, used for compiling GSettings schema])
177 if test x"$WITHGTK" = xtrue
179 PKG_CHECK_MODULES(GTK, gtk+-3.0,
181 [PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0,
186 if test x"$GTKHERE" = xtrue -a x"$WITHQTE" != xtrue
194 if test x$BUILDGTK = xtrue
196 PKG_CHECK_MODULES(GIO, gio-2.0,
197 [AC_DEFINE(HAVE_GIO, 1, [gio exists so use gvfs])])
199 save_CFLAGS="$CFLAGS"
201 CFLAGS="$CFLAGS $GTK_CFLAGS"
202 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
203 LIBS="$LIBS $GTK_LIBS"
204 AC_CHECK_HEADERS([gdk/gdkkeysyms-compat.h])
205 AC_CHECK_FUNCS([gtk_builder_new gtk_show_uri gdk_window_get_width gtk_cairo_should_draw_window g_settings_new], [],
206 [if test "x$ac_cv_func_gtk_builder_new" = "xno"; then
207 AC_MSG_ERROR([A version of GTK+ providing GtkBuilder is necessary.])
209 if test "x$ac_cv_func_gtk_show_uri" = "xno"; then
210 AC_MSG_WARN([This version of GTK+ doesn't provide gtk_show_uri - help will not be displayed from within dasher.])
213 CFLAGS="$save_CFLAGS"
216 AS_IF([test "x$with_gsettings" != "xno" -a "x$ac_cv_func_g_settings_new" = "xyes"],
217 [AC_CHECK_TOOLS([GLIB_COMPILE_SCHEMAS], [glib-compile-schemas])
220 AC_DEFINE([WITH_GSETTINGS], 1, [Use GSettings])],
221 [have_gsettings=false
222 PKG_CHECK_MODULES(GCONF, gconf-2.0,
224 AC_DEFINE([WITH_GCONF], 1, [Use GConf])
225 SETTINGS_CFLAGS=$GCONF_CFLAGS
226 SETTINGS_LIBS=$GCONF_LIBS],
228 AC_MSG_WARN([Neither a glib with GSettings, nor GConf were detected - user preferences will not be stored.])])
230 AS_IF([test "x$with_gsettings" = "xyes" -a $have_gsettings = false],
231 [AC_MSG_ERROR([GSettings requested but not found])])
232 AC_MSG_CHECKING([which settings store to use])
234 [test $have_gsettings = true -a $have_gconf = false],
235 [AC_MSG_RESULT([GSettings])],
236 [test $have_gsettings = false -a $have_gconf = true],
237 [AC_MSG_RESULT([GConf])],
238 [test $have_gsettings = false -a $have_gconf = false],
239 [AC_MSG_RESULT([none])],
240 [AC_MSG_ERROR([Logic error in configure.ac - please send bug report!])])
242 # GtkBuilder's autoconnect feature requires dasher to be
243 # linked with the --export-dynamic flag. pkg-config does not
244 # provide it, and libtool knows what to do with -export-dynamic.
245 # (We need this e.g., for <object class="DasherEditor">)
246 GTK_LIBS="$GTK_LIBS -export-dynamic"
248 AC_MSG_ERROR("Unable to find GTK or another necessary library.")
251 if test x"$DEBUG" = xtrue; then
252 AC_DEFINE([DEBUG], 1, [Additional debug checks enabled])
255 dnl default: enable speech
256 dnl if speechdispatcher or default
257 dnl check for speechdispatcher
258 dnl if gnomespeech or (default and nothing found)
259 dnl check for gnomespeech
261 dnl OK if wanted no speech
264 dnl error if selected particular
265 dnl BTW test: The -a operator has higher precedence than the -o operator.
268 [test "x$enable_speech" = x],
269 [enable_speech=yes; only_warn_if_speech_not_found=yes])
271 [test "x$enable_speech" = xspeechdispatcher -o "x$enable_speech" = xyes],
272 [AC_CHECK_HEADER([speech-dispatcher/libspeechd.h],
273 [AC_CHECK_LIB([speechd], [spd_open],
274 [AC_DEFINE([HAVE_SPEECHD], 1,
275 [speechdispatcher libraries are present])
276 speech_module="speechdispatcher"
279 SPEECH_LIBS=-lspeechd])])])
281 [test "x$enable_speech" = xgnomespeech -o "x$enable_speech" = xyes -a $speech_module = none],
282 [PKG_CHECK_MODULES([gnome_speech],
283 [gnome-speech-1.0 bonobo-activation-2.0 libbonobo-2.0 ORBit-2.0],
284 [AC_DEFINE([GNOME_SPEECH], 1, [gnome_speech-1 libraries are present])
285 SPEECH_CPPFLAGS=$gnome_speech_CFLAGS
286 SPEECH_LDFLAGS=$gnome_speech_LIBS
287 SPEECH_LIBS=$gnome_speech_LIBS
288 speech_module=gnomespeech],
291 [test $speech_module = none],
292 [AS_CASE(["x$enable_speech"],
296 [AS_IF([test x$only_warn_if_speech_not_found = xyes],
297 [AC_MSG_WARN([no speech module found])],
298 [AC_MSG_ERROR([speech requested but no speech module found])])],
299 [AC_MSG_ERROR([speech module "$enable_speech" requested but not found])])])
300 AC_MSG_CHECKING([which speech module to use])
301 AC_MSG_RESULT([$speech_module])
302 AS_IF([test $speech_module != none],
303 [AC_DEFINE([WITH_SPEECH], 1, [text-to-speech is present])])
305 AC_SUBST(SPEECH_CPPFLAGS)
306 AC_SUBST(SPEECH_LDFLAGS)
307 AC_SUBST(SPEECH_LIBS)
309 AS_IF( [test x"$enable_a11y" != xno],
310 [PKG_CHECK_MODULES([gnome_a11y],
311 [bonobo-activation-2.0 libbonobo-2.0 ORBit-2.0 cspi-1.0 atk],
312 [AC_DEFINE([GNOME_A11Y], 1, [cspi library is present])
314 [AS_IF([test x"$enable_a11y" = xyes],
315 [AC_MSG_ERROR([cspi requested but not found])])
319 AC_CHECK_LIB(expat, XML_Parse,,[
320 if test x$no_x = xyes ; then
321 AC_MSG_ERROR([Expat library not found.])
323 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
324 LDFLAGS="$LDFLAGS $X_LIBS"
325 dnl Check for different function to avoid cached "no" result.
326 AC_CHECK_LIB(expat, XML_SetElementHandler,,
327 [AC_MSG_ERROR([Expat library not found.])])
330 if test x"$WITHQTE" != xtrue -a x"$enable_a11y" != xyes; then
331 if test x$no_x = xyes ; then
332 AC_MSG_ERROR([X development libraries not found])
334 X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
338 AC_CHECK_LIB([Xtst], [XTestFakeKeyEvent],
339 [X_LIBS="$X_LIBS -lXtst"
340 AC_DEFINE(HAVE_XTST, 1, [The XTest extension is present])],
341 [AC_MSG_ERROR([Couldn't find the Xtst library. Check config.log for details])],
347 if test x"$WITHJAPANESE" = xtrue; then
348 AC_DEFINE([JAPANESE], 1, [Japanese support enabled])
349 JAPANESE_SOURCES='CannaConversionHelper.$(OBJEXT)'
354 AC_SUBST(JAPANESE_SOURCES)
356 if test x"$WITHJOYSTICK" = xtrue; then
357 AC_DEFINE([JOYSTICK], 1, [Linux joystick support enabled])
360 if test x"$WITHTILT" = xtrue; then
361 AC_DEFINE([TILT], 1, [Tilt input support enabled])
364 if test x"$WITHGPE" = xtrue; then
365 AC_DEFINE([WITH_GPE], 1, [gpe is present])
368 dnl if test x"$WITHDARWIN" = xtrue ; then
369 dnl AC_DEFINE([WITH_DARWIN], 1, [Targeting Darwin/X11])
372 if test x"$WITHMAEMO" = xtrue; then
373 AC_DEFINE([WITH_MAEMO], 1, [Maemo is present])
374 PKG_CHECK_MODULES(hildon, hildon-libs)
375 AC_CHECK_LIB(osso, osso_initialize,, AC_MSG_ERROR([Osso library not found.]))
378 if test x"$WITHMAEMOFULLSCREEN" = xtrue; then
379 AC_DEFINE([WITH_MAEMOFULLSCREEN], 1, [Building as fullscreen Maemo app])
382 if test x"$WITHCAIRO" = xtrue; then
383 PKG_CHECK_MODULES(cairo, cairo)
384 AC_DEFINE([WITH_CAIRO], 1, [use cairo])
387 if test x"$BUILDGTK" = xtrue; then
388 PKG_CHECK_MODULES(gthread, gthread-2.0)
391 AC_SUBST(gnome_a11y_LIBS)
392 AC_SUBST(gnome_a11y_CFLAGS)
394 AC_SUBST(gthread_LIBS)
395 AC_SUBST(gthread_CFLAGS)
397 AC_SUBST(hildon_LIBS)
398 AC_SUBST(hildon_CFLAGS)
400 AC_SUBST(GETTEXT_PACKAGE)
402 AM_CONDITIONAL(USE_GCONF, test x$have_gconf = xtrue)
403 AM_CONDITIONAL(USE_GSETTINGS, test x$have_gsettings = xtrue)
404 AM_CONDITIONAL(DOGTK, test x$BUILDGTK = xtrue)
405 AM_CONDITIONAL(DOQTE, test x$WITHQTE = xtrue)
406 AM_CONDITIONAL(USE_GNOMESPEECH, test $speech_module = gnomespeech)
407 AM_CONDITIONAL(USE_SPEECHDISPATCHER, test $speech_module = speechdispatcher)
408 AM_CONDITIONAL(GNOME_A11Y, test $enable_a11y = yes)
409 AM_CONDITIONAL(GNOME_HELP, test x$WITHGNOME = xtrue)
410 AM_CONDITIONAL(WITH_GPE, test x$WITHGPE = xtrue)
411 AM_CONDITIONAL(WITH_MAEMO, test x$WITHMAEMO = xtrue)
412 AM_CONDITIONAL(WITH_MAEMOFULLSCREEN, test x$WITHMAEMOFULLSCREEN = xtrue)
413 AM_CONDITIONAL(JAPANESE, test x$WITHJAPANESE = xtrue)
414 AM_CONDITIONAL(JOYSTICK, test x$WITHJOYSTICK = xtrue)
419 if test x"$WITHGPE" = xtrue ; then
421 SETTINGS_LIBS="-lgpewidget -lXsettings-client -lXsettings"
424 GTKBUILD_CFLAGS="$GTK_CFLAGS $GIO_CFLAGS $SETTINGS_CFLAGS $gthread_CFLAGS $gnome_a11y_CFLAGS $hildon_CFLAGS"
426 GTKBUILD_LIBS="$X_LIBS $GTK_LIBS $GIO_LIBS $SETTINGS_LIBS $gthread_LIBS $gnome_a11y_LIBS $hildon_LIBS"
428 AC_SUBST(GTKBUILD_CFLAGS)
429 AC_SUBST(GTKBUILD_LIBS)
431 AC_MSG_CHECKING([for gnome-doc-utils])
432 dnl Avoid default action which is to complain if not found
433 GNOME_DOC_INIT([0.9.0],[gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no])
434 AC_MSG_RESULT($gdu_cv_have_gdu)
436 if test x"$WITHGNOME" = xtrue -a x"$gdu_cv_have_gdu" = xno ; then
437 AC_MSG_ERROR([gnome-doc-utils not found!])
440 dnl XXX PRLW How is this better than the standard
441 dnl gdu_cv_have_gdu && enable_scrollkeeper ?
442 AM_CONDITIONAL(ENABLE_SK, test x"$WITHGNOME" = xfalse -a x"$enable_scrollkeeper" = "xyes")
444 AC_CONFIG_FILES([Data/dasher.desktop.in
446 Data/training/Makefile
447 Data/alphabets/Makefile
448 Data/colours/Makefile
449 Data/control/Makefile
452 Data/Help/Gnome/Makefile
458 Src/DasherCore/Makefile
459 Src/DasherCore/LanguageModelling/Makefile
460 Src/DasherIM/Makefile
462 Src/Installer/Makefile
463 Src/InstallerTobii/Makefile
464 Src/InstallerW2K/Makefile