[dasher] Don't error out by default if libcspi is not found.



commit bb27def4ed7b6e06ace5f9650cb8cee9647d7182
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Thu May 26 15:30:56 2011 +0100

    Don't error out by default if libcspi is not found.
    
    If libcspi is found, use it for direct entry mode,else, use libXtst. If
    libcspi is specifically requested with --enable-a11y, then error out if
    not found.

 Src/Makefile.am |    2 ++
 configure.ac    |   29 ++++++++++++++---------------
 2 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/Src/Makefile.am b/Src/Makefile.am
index 0fc4cf5..29e37f2 100644
--- a/Src/Makefile.am
+++ b/Src/Makefile.am
@@ -15,6 +15,7 @@ AM_CXXFLAGS = \
 	-I$(srcdir)/Gtk2 \
 	-I$(srcdir)/DasherCore \
 	$(GTKBUILD_CFLAGS) \
+	$(SPEECH_CPPFLAGS) \
 	-DPREFIX=\"$(PREFIX)\" \
 	-DLIBDIR=\"$(libdir)\" \
 	-DDATADIR=\"$(datadir)\" \
@@ -31,6 +32,7 @@ dasher_LDADD = \
 	DasherCore/LanguageModelling/libdasherlm.a \
 	Common/libdashermisc.a \
 	$(GTKBUILD_LIBS) \
+	$(SPEECH_LIBS) \
 	-lexpat \
 	$(POPT_LIBS) \
 	$(GPELIB)
diff --git a/configure.ac b/configure.ac
index 6918021..6e9bfbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,13 +97,8 @@ AC_ARG_WITH([gpe],
 	 WITHGPE=false)
 
 AC_ARG_ENABLE([a11y],
-	 AS_HELP_STRING([--enable-a11y],[build with support for the GNOME accessibility framework (default is YES)]),
-	 if test "x$enableval" = "xno"; then
-	   WITHA11Y=false; 
-	 else
-	   WITHA11Y=true;
-         fi, 
-	 WITHA11Y=true)
+	[AS_HELP_STRING([--enable-a11y],
+		[use cspi rather than Xtst for direct entry mode if found])])
 
 AC_ARG_ENABLE([japanese],
 	 AS_HELP_STRING([--enable-japanese],[build with support for Japanese Kanji entry (experimental -- default is NO)]),
@@ -140,7 +135,7 @@ AC_ARG_WITH([maemo],
 	if test "x$withval" = "xyes"; then
 	   WITHMAEMO=true;
 	   WITHGNOME=false;
-	   WITHA11Y=false;
+	   enable_a11y=no;
 	else
 	   WITHMAEMO=false;
         fi,
@@ -152,7 +147,7 @@ AC_ARG_WITH([maemo-fullscreen],
 	   WITHMAEMOFULLSCREEN=true;
 	   WITHMAEMO=true;
 	   WITHGNOME=false;
-	   WITHA11Y=false;
+	   enable_a11y=no;
 	else
 	   WITHMAEMOFULLSCREEN=false;
         fi,
@@ -306,10 +301,14 @@ AC_SUBST(SPEECH_CPPFLAGS)
 AC_SUBST(SPEECH_LDFLAGS)
 AC_SUBST(SPEECH_LIBS)
 
-if test x"$WITHA11Y" = xtrue; then
-	PKG_CHECK_MODULES(gnome_a11y, bonobo-activation-2.0 libbonobo-2.0 ORBit-2.0 cspi-1.0 atk)
-	AC_DEFINE([GNOME_A11Y], 1, [gnome_a11y libraries are present])
-fi
+AS_IF(	[test x"$enable_a11y" != xno],
+	[PKG_CHECK_MODULES([gnome_a11y],
+		[bonobo-activation-2.0 libbonobo-2.0 ORBit-2.0 cspi-1.0 atk],
+		[AC_DEFINE([GNOME_A11Y], 1, [cspi library is present])
+		 enable_a11y=yes],
+		[AS_IF([test x"$enable_a11y" = xyes],
+			[AC_MSG_ERROR([cspi requested but not found])])
+		 enable_a11y=no])])
 
 AC_PATH_XTRA
 AC_CHECK_LIB(expat, XML_Parse,,[
@@ -323,7 +322,7 @@ AC_CHECK_LIB(expat, XML_Parse,,[
 		             [AC_MSG_ERROR([Expat library not found.])])
 	fi
 ])
-if test x"$WITHQTE" != xtrue -a x"$WITHA11Y" != xtrue; then
+if test x"$WITHQTE" != xtrue -a x"$enable_a11y" != xyes; then
 	if test	x$no_x = xyes ; then
 		AC_MSG_ERROR([X development libraries not found])
 	else
@@ -401,7 +400,7 @@ AM_CONDITIONAL(DOGTK, test x$BUILDGTK = xtrue)
 AM_CONDITIONAL(DOQTE, test x$WITHQTE = xtrue)
 AM_CONDITIONAL(USE_GNOMESPEECH, test $speech_module = gnomespeech)
 AM_CONDITIONAL(USE_SPEECHDISPATCHER, test $speech_module = speechdispatcher)
-AM_CONDITIONAL(GNOME_A11Y, test x$WITHA11Y = xtrue)
+AM_CONDITIONAL(GNOME_A11Y, test $enable_a11y = yes)
 AM_CONDITIONAL(GNOME_HELP, test x$WITHGNOME = xtrue)
 AM_CONDITIONAL(WITH_GPE, test x$WITHGPE = xtrue)
 AM_CONDITIONAL(WITH_MAEMO, test x$WITHMAEMO = xtrue)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]