[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Cygwin has no TclX



I've been trying to build emacspeak on cygwin. So far I have been unsuccessful. I have run into a number of problems, the first of which is that there seems to be no TclX for Cygwin. I found Cygwin ports and found both espeak and emacs on there,but no TclX. So, of course, I tried to compile it myself, but this
failed.

The reason I needed TclX was to use the espeak server. however most of the docs for emacspeak refer to old old versions of Tcl, and much of the functionality from external packages has been rolled into Tcl itself. Since Tcl 8.6 is is still only on version 8.6.0 I looked at Tcl8.5.x, and while this lacks the signal handling required, Expect is readily available, is available for Cygwin, and has the ability to handle signals. One of the two attached patches is an attempt to work around the absence of TclX, and use Package Expect instead
if Tcl8.5 is in use.

I am reasonably confident about that patch, but would appreciate others'
critical examination of it.

The other patch is almost a stab in the dark. :-)  In attempting to get
the supporting C++ server code to compile on cygwin I was running into
things not being defined.  It turned out that things like snprintf()
are defined in terms of a macro _EFUNC in <stdio.h> in cygwin.  My
explorations suggest that this is defined in /usr/include/_ansi.h , so
I have included that in the code with a #ifdef to apply this only to Cygwin.

However, I am not sure if I have taken the right approach here.  Also,
I still cannot get this to compile because of missing header files that espeak should have. However on downloading the appropriate version of espeak I find that I can't build that either. I have a working espeak on the machine as
part of NVDA, but it turns out this is in the form of a DLL.

Given that I have already had to build emacs, install it to get the
libraries for emacspeak, then uninstall it and replace it with the pre-built cygwin one for it to work, I suspect I will have to do this with espeak. I conclude that I am just doing this wrong, so I am bringing what I have in case some of it of use to others, and hoping someone has the obvious bit of
insight I am missing.

Thank you,
Hugh
diff -urab servers.old/linux-espeak/tclespeak.cpp servers/linux-espeak/tclespeak.cpp
--- servers.old/linux-espeak/tclespeak.cpp	2012-03-20 17:29:26.000000000 +0000
+++ servers/linux-espeak/tclespeak.cpp	2013-03-04 19:40:08.000000000 +0000
@@ -35,10 +35,13 @@
 //>
 //<includes
 
+#ifdef __CYGWIN__
+#include <_ansi.h>
+#endif
+
 #include <sys/time.h>
 #include <dlfcn.h>
 #include <tcl.h>
-#include <string.h>
 #include <stdlib.h>
 #include <string>
 #include <assert.h>
@@ -50,6 +53,12 @@
 #include <string>
 using std::string;
 
+// for snprintf():
+extern "C" {
+#include <stdio.h>
+#include <string.h>
+}
+
 #define PACKAGENAME "tts"
 #define PACKAGEVERSION "1.0"
 #define EXPORT
Only in servers.old: .servers
diff -urab servers.old/espeak servers/espeak
--- servers.old/espeak	2012-04-24 17:49:50.000000000 +0100
+++ servers/espeak	2013-03-04 12:41:06.000000000 +0000
@@ -34,7 +34,31 @@
 # }}}
 # {{{source common code 
 
-package require Tclx
+if {[catch {package require Tcl 8.5} result ] == 0} {
+  # On cygwin there is no TclX, and most of the functionality
+  # has been absorbed into Tcl.  Expect should be available,
+  # and fairly widely at that.
+  if {[set exp_code [catch {package require Expect} result ] ] == 0} {
+    # expect is available: use its trap to handle signals
+    proc signal {action sig {cmd {}} } {
+       switch -exact $action {
+          ignore {trap $sig {} }
+          # Nothing else is used here...
+          # default {}
+          # error {}
+          # get {}
+          # set {}
+          # block {}
+          # unlblock {}
+       }
+    }
+
+  } else {
+    return -code $exp_code $result
+  }
+} else {
+  package require Tclx
+}
 set wd [file dirname $argv0]
 source $wd/tts-lib.tcl
 


If you have questions about this archive or had problems using it, please send mail to:

priestdo@xxxxxxxxxxx No Soliciting!

Emacspeak List Archive | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog