[l10n] Updated German doc translation
[dasher.git] / configure.ac
blobe7ce44a43dbe83211b825ee3f5b71901b21e1479
1 AC_PREREQ(2.5)
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],
8                        [AC_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])
17 AM_INIT_AUTOMAKE
18 AM_MAINTAINER_MODE
20 AC_PROG_MAKE_SET
22 # IT_PROG_INTLTOOL requires AM_NLS but ignores --enable-nls
23 AM_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])
32 dnl AM_ICONV
34 GETTEXT_PACKAGE=dasher
35 AC_SUBST(GETTEXT_PACKAGE)
36 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
37 AM_GLIB_GNU_GETTEXT
39 AC_PROG_CXX
41 AC_PROG_LD_GNU
43 WITHGTK=true;
45 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6)
47 AC_LANG_PUSH(C++)
48 AC_CHECK_FUNCS(lldiv)
49 AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
50 AC_LANG_POP(C++)
52 AC_ARG_ENABLE(debug,
53         AS_HELP_STRING([--enable-debug],
54                 [build with additional debugging checks (default is NO)]),
55         if test "x$enable_debug" = "xno"; then
56           DEBUG=false
57         else
58           DEBUG=true
59         fi,
60         DEBUG=false)
62 AC_ARG_WITH([gnome],
63         AS_HELP_STRING([--with-gnome],[build GNOME documentation (default is YES)]),
64         if test "x$with_gnome" = "xno"; then
65           WITHGNOME=false 
66         else
67           WITHGNOME=true
68           # Need to work out how to translate replaced variables before uncommenting
69           # AC_CONFIG_FILES([Data/Help/Gnome/C/dasher.xml])
70         fi, 
71         WITHGNOME=true)
73 AC_ARG_ENABLE([speech],
74         [AS_HELP_STRING([--enable-speech=@<:@speechdispatcher,gnomespeech@:>@],
75                 [build with speech support (default is YES)])])
77 AC_ARG_WITH([qte],
78          AS_HELP_STRING([--with-qte],[build with QTE support (default is NO -- currently untested)]), 
79          if test "x$withval" = "xno"; then
80            WITHQTE=false; 
81          else
82            WITHQTE=true;
83          fi, 
84          WITHQTE=false)
86 AC_ARG_WITH([gpe],
87          AS_HELP_STRING([--with-gpe],[build with GPE support (default is NO -- currently untested)]), 
88          if test "x$withval" = "xno"; then
89            WITHGPE=false; 
90          else
91            WITHGPE=true;
92          fi, 
93          WITHGPE=false)
95 AC_ARG_ENABLE([a11y],
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
102            WITHJAPANESE=false; 
103          else
104            AC_CHECK_LIB(canna, RkBgnBun,, AC_MSG_ERROR([Canna library not found (required for Japanese).]))
105            WITHJAPANESE=true;
106          fi, 
107          WITHJAPANESE=false)
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
112            WITHJOYSTICK=false; 
113          else
114            WITHJOYSTICK=true;
115          fi, 
116          WITHJOYSTICK=false)
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
122            WITHTILT=false; 
123          else
124            WITHTILT=true;
125          fi, 
126          WITHTILT=false)
129 AC_ARG_WITH([maemo],
130         AS_HELP_STRING([--with-maemo],[build with Maemo support (default is NO)]),
131         if test "x$withval" = "xyes"; then
132            WITHMAEMO=true;
133            WITHGNOME=false;
134            enable_a11y=no;
135         else
136            WITHMAEMO=false;
137         fi,
138         WITHMAEMO=false)
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;
144            WITHMAEMO=true;
145            WITHGNOME=false;
146            enable_a11y=no;
147         else
148            WITHMAEMOFULLSCREEN=false;
149         fi,
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
156 dnl        WITHDARWIN=true;
157 dnl     else
158 dnl        WITHDARWIN=false;
159 dnl     fi,
160 dnl     WITHDARWIN=false)
162 AC_ARG_WITH([cairo],
163          AS_HELP_STRING([--with-cairo],[build with cairo support (default is YES)]),
164          if test "x$withval" = "xno"; then
165            WITHCAIRO=false; 
166          else
167            WITHCAIRO=true;
168          fi, 
169          WITHCAIRO=true)
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
178 then 
179         PKG_CHECK_MODULES(GTK, gtk+-3.0,
180                 [GTKHERE=true],
181                 [PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0,
182                         [GTKHERE=true],
183                         [GTKHERE=false])]) 
186 if test x"$GTKHERE" = xtrue -a x"$WITHQTE" != xtrue
187 then
188         BUILDGTK=true
189 else 
190         BUILDGTK=false
193 DAM_GCONF_SOURCE_2
194 if test x$BUILDGTK = xtrue
195 then
196         PKG_CHECK_MODULES(GIO, gio-2.0,
197                 [AC_DEFINE(HAVE_GIO, 1, [gio exists so use gvfs])])
199         save_CFLAGS="$CFLAGS"
200         save_LIBS="$LIBS"
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.])
208                 fi
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.])
211                 fi]
212         )
213         CFLAGS="$save_CFLAGS"
214         LIBS="$save_LIBS"
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])
218          have_gsettings=true
219                  have_gconf=false
220                  AC_DEFINE([WITH_GSETTINGS], 1, [Use GSettings])],
221                 [have_gsettings=false
222                  PKG_CHECK_MODULES(GCONF, gconf-2.0,
223                         [have_gconf=true
224                          AC_DEFINE([WITH_GCONF], 1, [Use GConf])
225                          SETTINGS_CFLAGS=$GCONF_CFLAGS
226                          SETTINGS_LIBS=$GCONF_LIBS],
227                         [have_gconf=false
228                          AC_MSG_WARN([Neither a glib with GSettings, nor GConf were detected - user preferences will not be stored.])])
229                 ])
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])
233         AS_IF(
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"
247 else
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
260 dnl if nothing found
261 dnl   OK if wanted no speech
262 dnl   warn if default
263 dnl   error if yes
264 dnl   error if selected particular
265 dnl BTW test: The -a operator has higher precedence than the -o operator.
266 speech_module=none
267 AS_IF(
268         [test "x$enable_speech" = x],
269         [enable_speech=yes; only_warn_if_speech_not_found=yes])
270 AS_IF(
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"
277                          SPEECH_CPPFLAGS=
278                          SPEECH_LDFLAGS=
279                          SPEECH_LIBS=-lspeechd])])])
280 AS_IF(
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],
289                 [:])])
290 AS_IF(
291         [test $speech_module = none],
292         [AS_CASE(["x$enable_speech"],
293                 [xno],
294                         [:],
295                 [xyes],
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])
313                  enable_a11y=yes],
314                 [AS_IF([test x"$enable_a11y" = xyes],
315                         [AC_MSG_ERROR([cspi requested but not found])])
316                  enable_a11y=no])])
318 AC_PATH_XTRA
319 AC_CHECK_LIB(expat, XML_Parse,,[
320         if test x$no_x = xyes ; then
321                 AC_MSG_ERROR([Expat library not found.])
322         else
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.])])
328         fi
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])
333         else
334                 X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
335         fi
337         save_LIBS="$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])],
342                      $X_LIBS)
343         LIBS="$save_LIBS"
344         AC_SUBST(X_LIBS)
347 if test x"$WITHJAPANESE" = xtrue; then
348         AC_DEFINE([JAPANESE], 1, [Japanese support enabled])
349         JAPANESE_SOURCES='CannaConversionHelper.$(OBJEXT)'
350 else
351         JAPANESE_SOURCES=
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])
370 dnl fi
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.]))
376 fi                      
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)
416 AC_SUBST(GTK_CFLAGS)
417 AC_SUBST(GTK_LIBS)
419 if test x"$WITHGPE" = xtrue ; then
420         SETTINGS_CFLAGS=" "
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
445                  Data/Makefile
446                  Data/training/Makefile
447                  Data/alphabets/Makefile
448                  Data/colours/Makefile
449                  Data/control/Makefile
450                  Data/GUI/Makefile
451                  Data/Help/Makefile
452                  Data/Help/Gnome/Makefile
453                  Doc/Makefile
454                  Doc/user/Makefile
455                  Makefile
456                  Src/Makefile
457                  Src/Common/Makefile
458                  Src/DasherCore/Makefile
459                  Src/DasherCore/LanguageModelling/Makefile
460                  Src/DasherIM/Makefile
461                  Src/Gtk2/Makefile
462                  Src/Installer/Makefile
463                  Src/InstallerTobii/Makefile
464                  Src/InstallerW2K/Makefile
465                  Src/Win32/Makefile
466                  po/Makefile.in
469 AC_OUTPUT