2 AC_INIT([dasher],[4.7.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=dasher])
3 AC_REVISION([$Id: configure.in,v])
4 AC_CONFIG_SRCDIR([Src/main.cc])
5 AC_CONFIG_HEADERS(config.h)
7 dnl The following two changes are required currently for the Maemo build (but will break the GNOME build)
9 dnl AM_INIT_AUTOMAKE([1.9 gnu check-news dist-bzip2 no-dist-gzip])
10 AM_INIT_AUTOMAKE([1.8 gnu check-news dist-bzip2 no-dist-gzip])
14 IT_PROG_INTLTOOL([0.34.90])
15 dnl AC_PROG_INTLTOOL(0.30)
20 if test "x$GCC" = "xyes"; then
21 CXXFLAGS="$CXXFLAGS -Wall -Wno-non-virtual-dtor"
24 *) CXXFLAGS="$CXXFLAGS -O2" ;;
31 GETTEXT_PACKAGE=dasher
32 AC_SUBST(GETTEXT_PACKAGE)
33 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
42 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4, have_glib=true, have_glib=false)
44 AC_CHECK_LIB(expat, XML_Parse,, AC_MSG_ERROR([Expat library not found.]))
47 AC_HELP_STRING([--enable-debug],[build with additional debugging checks (default is NO)]),
48 if test $withval = "no"; then
56 AC_HELP_STRING([--with-gnome],[build with GNOME support (default is YES)]),
57 if test $withval = "no"; then
64 AC_ARG_ENABLE([speech],
65 AC_HELP_STRING([--enable-speech],[build with speech support (default is NO)]),
66 if test $enableval = "no"; then
74 AC_HELP_STRING([--with-qte],[build with QTE support (default is NO -- currently untested)]),
75 if test $withval = "no"; then
83 AC_HELP_STRING([--with-gpe],[build with GPE support (default is NO -- currently untested)]),
84 if test $withval = "no"; then
92 AC_HELP_STRING([--enable-a11y],[build with support for the GNOME accessibility framework (default is YES)]),
93 if test $enableval = "no"; then
100 AC_ARG_ENABLE([japanese],
101 AC_HELP_STRING([--enable-japanese],[build with support for Japanese Kanji entry (experimental -- default is NO)]),
102 if test $enableval = "no"; then
105 AC_CHECK_LIB(canna, RkBgnBun,, AC_MSG_ERROR([Canna library not found (required for Japanese).]))
110 AC_ARG_ENABLE([chinese],
111 AC_HELP_STRING([--enable-chinese],[build with support for Chinese PinYin entry (experimental -- default is NO)]),
112 if test $enableval = "no"; then
119 AC_ARG_ENABLE([joystick],
120 AC_HELP_STRING([--enable-joystick],[Build with Linux joystick support (note that other UNIX based operating systems aren't supported here)]),
121 if test $enableval = "no"; then
129 AC_ARG_ENABLE([tilt],
130 AC_HELP_STRING([--enable-tilt],[Build with experimental support for tilt sensor input (experimental -- default is NO)]),
131 if test $enableval = "no"; then
140 AC_HELP_STRING([--with-maemo],[build with Maemo support (default is NO)]),
141 if test $withval = "yes"; then
150 AC_ARG_WITH([maemo-fullscreen],
151 AC_HELP_STRING([--with-maemo-fullscreen],[build as standalone Maemo fullscreen app (default is NO)]),
152 if test $withval = "yes"; then
153 WITHMAEMOFULLSCREEN=true;
158 WITHMAEMOFULLSCREEN=false;
160 WITHMAEMOFULLSCREEN=false)
163 dnl AC_ARG_WITH([darwin],
164 dnl AC_HELP_STRING([--with-darwin],[build with Darwin (Mac OS X) support (default is NO)]),
165 dnl if test $withval = "yes"; then
168 dnl WITHDARWIN=false;
170 dnl WITHDARWIN=false)
173 AC_HELP_STRING([--with-cairo],[build with cairo support (default is YES)]),
174 if test $withval = "no"; then
181 if [[ x"$WITHGTK2" = xtrue ]]
183 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.4.0,[GTK2HERE=true],[GTK2HERE=false])
184 PKG_CHECK_MODULES(GCONF, gconf-2.0,[GCONF2HERE=true],[GCONF2HERE=false])
185 if [[ x$GCONF2HERE = xfalse ]]; then
186 AC_MSG_WARN("GConf was not detected - user preferences will not be stored.")
190 if [[ x"$GTK2HERE" = xtrue ]] && [[ x"$WITHGTK2" = xtrue ]] && [[ x"$WITHQTE" != xtrue ]]
193 elif [[ x"$GTK2HERE" = xtrue ]] && [[ x"$WITHQTE" != xtrue ]]
200 if [[ x$BUILDGTK2 = xfalse ]] && [[ x"$WITHQTE" != xtrue ]]
203 AC_ERROR("Unable to find GTK2 or another necessary library. See the previous line for more useful data.")
206 if [[ x"$WITHQTE" != xtrue ]]
208 dnl test for X libraries
209 if test x$no_x = xyes ; then
210 AC_MSG_ERROR([X development libraries not found])
212 X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
216 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst)
217 if test "x$XTST_LIBS" = x; then
219 for xtstpath in /usr/X11R6/lib64 /usr/X11R6/lib /usr/openwin/lib $x_libraries; do
220 LIBS="-L$xtstpath -lXtst"
222 *solaris*) XTST_RPATH_FLAGS="-R$xtstpath" ;;
224 AC_MSG_CHECKING(for -lXtst in $xtstpath)
225 AC_TRY_LINK([], [XTestFakeKeyEvent()], [
227 XTST_LIBS="$XTST_RPATH_FLAGS -L$xtstpath -lXtst"
229 break],[AC_MSG_RESULT(no)])
232 if test "x$XTST_LIBS" = x; then
233 AC_MSG_ERROR(Couldn't find the Xtst library. Check config.log for details)
235 X_LIBS="$X_LIBS $XTST_LIBS"
236 AC_DEFINE(HAVE_XTST, 1, [The XTest extension is present])
242 if [[ x"$DEBUG" = xtrue ]]; then
243 AC_DEFINE([DEBUG], 1, [Additional debug checks enabled])
246 if [[ x"$WITHGNOME" = xtrue ]]; then
247 PKG_CHECK_MODULES(gnome, libgnome-2.0 libgnomeui-2.0 gnome-vfs-2.0)
248 AC_DEFINE([GNOME_LIBS], 1, [libgnome-2, libgnomeui-2, and gnome-vfs-2 are present])
251 if [[ x"$WITHSPEECH" = xtrue ]]; then
252 PKG_CHECK_MODULES(gnome_speech, gnome-speech-1.0 bonobo-activation-2.0 libbonobo-2.0 ORBit-2.0)
253 AC_DEFINE([GNOME_SPEECH], 1, [gnome_speech-1 libraries are present])
254 # SPEECH_SOURCES='speech.$(OBJEXT)'
257 if [[ x"$WITHA11Y" = xtrue ]]; then
258 PKG_CHECK_MODULES(gnome_a11y, bonobo-activation-2.0 libbonobo-2.0 ORBit-2.0 libgnomeui-2.0 cspi-1.0 atk)
259 AC_DEFINE([GNOME_A11Y], 1, [gnome_a11y libraries are present])
262 if [[ x"$WITHJAPANESE" = xtrue ]]; then
263 AC_DEFINE([JAPANESE], 1, [Japanese support enabled])
264 JAPANESE_SOURCES='CannaConversionHelper.$(OBJEXT)'
269 AC_SUBST(JAPANESE_SOURCES)
271 if [[ x"$WITHCHINESE" = xtrue ]]; then
272 AC_DEFINE([CHINESE], 1, [Chinese support enabled])
273 CHINESE_SOURCES='PinYinConversionHelper.$(OBJEXT) PinyinParser.$(OBJEXT)'
279 AC_SUBST(CHINESE_SOURCES)
281 if [[ x"$WITHJOYSTICK" = xtrue ]]; then
282 AC_DEFINE([JOYSTICK], 1, [Linux joystick support enabled])
285 if [[ x"$WITHTILT" = xtrue ]]; then
286 AC_DEFINE([TILT], 1, [Tilt input support enabled])
289 if [[ x"$WITHGPE" = xtrue ]]; then
290 AC_DEFINE([WITH_GPE], 1, [gpe is present])
293 dnl if [[ x"$WITHDARWIN" = xtrue ]]; then
294 dnl AC_DEFINE([WITH_DARWIN], 1, [Targeting Darwin/X11])
297 if [[ x"$WITHMAEMO" = xtrue ]]; then
298 AC_DEFINE([WITH_MAEMO], 1, [Maemo is present])
300 glade_LIBS="/usr/lib/libglade-2.0.a"
301 PKG_CHECK_MODULES(hildon, hildon-libs)
302 AC_CHECK_LIB(osso, osso_initialize,, AC_MSG_ERROR([Osso library not found.]))
305 if [[ x"$WITHMAEMOFULLSCREEN" = xtrue ]]; then
306 AC_DEFINE([WITH_MAEMOFULLSCREEN], 1, [Building as fullscreen Maemo app])
309 if [[ x"$WITHCAIRO" = xtrue ]]; then
310 PKG_CHECK_MODULES(cairo, gtk+-2.0 >= 2.8.0)
311 AC_DEFINE([WITH_CAIRO], 1, [use cairo (needs Gtk+ >= 2.8.0)])
314 if [[ x"$BUILDGTK2" = xtrue ]]; then
315 PKG_CHECK_MODULES(glade, libglade-2.0)
316 if [[ x"$WITHMAEMO" = xtrue ]]; then
318 glade_LIBS=`echo $glade_LIBS | sed s/-lglade-2.0//`
319 glade_LIBS="$glade_LIBS /usr/lib/libglade-2.0.a"
322 PKG_CHECK_MODULES(gthread, gthread-2.0)
325 dnl if [[ x"$WITHMAEMO" = xfalse ]]; then
326 dnl PKG_CHECK_MODULES(wnck, libwnck-1.0)
327 dnl AC_DEFINE([HAVE_WNCK], 1, [wnck is present])
331 if [[ x"$GCONF2HERE" = xtrue ]]; then
333 AC_DEFINE([WITH_GCONF], 1, [Use GConf])
336 AC_SUBST(gnome_speech_LIBS)
337 AC_SUBST(gnome_speech_CFLAGS)
338 AC_SUBST([SPEECH_SOURCES])
340 AC_SUBST(gnome_a11y_LIBS)
341 AC_SUBST(gnome_a11y_CFLAGS)
342 AC_SUBST([A11Y_SOURCES])
345 AC_SUBST(gnome_CFLAGS)
348 AC_SUBST(glade_CFLAGS)
350 AC_SUBST(gthread_LIBS)
351 AC_SUBST(gthread_CFLAGS)
354 AC_SUBST(wnck_CFLAGS)
356 AC_SUBST(hildon_LIBS)
357 AC_SUBST(hildon_CFLAGS)
359 AC_SUBST(GETTEXT_PACKAGE)
361 AM_CONDITIONAL(DOGTK2, test x$BUILDGTK2 = xtrue)
362 AM_CONDITIONAL(DOQTE, test x$WITHQTE = xtrue)
363 AM_CONDITIONAL(GNOME_SPEECH, test x$WITHSPEECH = xtrue)
364 AM_CONDITIONAL(GNOME_A11Y, test x$WITHA11Y = xtrue)
365 AM_CONDITIONAL(GNOME_HELP, test x$WITHGNOME = xtrue)
366 AM_CONDITIONAL(WITH_GPE, test x$WITHGPE = xtrue)
367 AM_CONDITIONAL(WITH_MAEMO, test x$WITHMAEMO = xtrue)
368 AM_CONDITIONAL(WITH_MAEMOFULLSCREEN, test x$WITHMAEMOFULLSCREEN = xtrue)
369 AM_CONDITIONAL(JAPANESE, test x$WITHJAPANESE = xtrue)
370 AM_CONDITIONAL(CHINESE, test x$WITHCHINESE = xtrue)
371 AM_CONDITIONAL(JOYSITICK, test x$WITHJOYSTICK = xtrue)
373 AC_SUBST(GTK2_CFLAGS)
376 AC_SUBST(GCONF_CFLAGS)
379 if [[ x"$WITHGPE" = xtrue ]]; then
381 SETTINGS_LIBS="-lgpewidget -lXsettings-client -lXsettings"
383 SETTINGS_CFLAGS=$GCONF_CFLAGS
384 SETTINGS_LIBS=$GCONF_LIBS
386 AC_SUBST(SETTINGS_CFLAGS)
387 AC_SUBST(SETTINGS_LIBS)
389 GTK2BUILD_CFLAGS="$GTK2_CFLAGS $SETTINGS_CFLAGS $gthread_CFLAGS $gnome_speech_CFLAGS $gnome_a11y_CFLAGS $glade_CFLAGS $gnome_CFLAGS $wnck_CFLAGS $hildon_CFLAGS"
391 dnl Check for GNU ld stolen from libtool.m4 - code reuse would be nice here
393 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], have_prog_gnu_ld,
394 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
395 case `$LD -v 2>&1 </dev/null` in
396 *GNU* | *'with BFD'*)
404 if [[ x"$have_prog_gnu_ld" = xyes ]]; then
405 ed_flags="-Wl,--export-dynamic,"
410 GTK2BUILD_LIBS="$X_LIBS $GTK2_LIBS $SETTINGS_LIBS $gthread_LIBS $gnome_speech_LIBS $gnome_a11y_LIBS $glade_LIBS $gnome_LIBS $wnck_LIBS $hildon_LIBS $ed_flags"
412 AC_SUBST(GTK2BUILD_CFLAGS)
413 AC_SUBST(GTK2BUILD_LIBS)
415 if [[ x"$WITHGNOME" = xtrue ]]; then
418 # Allows compilation if --without-gnome is passed
419 AM_CONDITIONAL(ENABLE_SK, test "x$enable_scrollkeeper" = "xyes")
422 AC_CONFIG_FILES([Data/dasher.desktop.in
424 Data/training/Makefile
425 Data/alphabets/Makefile
427 Data/colours/Makefile
428 Data/controllabels/Makefile
430 Data/Help/Gnome/Makefile
436 Src/DasherCore/Makefile
437 Src/DasherCore/LanguageModelling/Makefile
438 Src/DasherIM/Makefile
440 Src/Installer/Makefile
441 Src/InstallerTobii/Makefile
442 Src/InstallerW2K/Makefile