-*- Outline -*- * Scsh binary for Cygwin The binary was compiled on an older Cygwin installation: CYGWIN_NT-5.1 xxx 1.3.5(0.47/3/2) 2001-11-13 23:16 i686 unknown You will need cygwin1.dll in a directory in your path. Please note that I'm providing this binary "AS IS". USE IT AT YOUR OWN RISK! I don't have the time to support it. To use it just unpack the archive under /usr/local (the path is hard coded in the Scsh binary) and enjoy. A complete installation is included. * Compiling Scsh under Cygwin To compile Scsh under Cygwin you have to make sure that the directory where Scsh is being compiled as well as the directory where temporary files are created during the compilation are mounted in "binary" mode. Otherwise you will get errors about corrupted images. For example: mount -b c:/home/ecl/scheme/scsh/scsh-0.6.7 /scsh mount -b c:/tmp /tmp Now change the working directory to /scsh and start the compilation there with ./configure make The build should finish without any problems and everything else seems to work but at least with the old Cygwin I'm using one gets a misleading "heap overflow" error when using regexps: /scsh% ./go Welcome to scsh 0.6.7 (R6RS) Type ,? for help. > (+ 3 39) 42 > (car '(a b c)) 'a > (file-exists? "./scshvm.exe") #t > (regexp-search? (rx printing) "foo") Scheme48 heap overflow [Last command exited with status 255] The reason for this is that the scshvm.exe binary fails to find the regexp library. At this point I edited the (automatically generated) Makefile and added Cygwin's "/lib/libregex.a" to LIBS: diff -c "/scsh/Makefile.~1~" "/scsh/Makefile" *** /scsh/Makefile.~1~ Tue Oct 31 09:35:51 2006 --- /scsh/Makefile Tue Oct 31 09:51:32 2006 *************** *** 8,14 **** CC = gcc DEFS = -DHAVE_CONFIG_H ! LIBS = -lcrypt -lm -lutil CFLAGS = -O2 INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} --- 8,14 ---- CC = gcc DEFS = -DHAVE_CONFIG_H ! LIBS = /lib/libregex.a -lcrypt -lm -lutil CFLAGS = -O2 INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} Diff finished. Tue Oct 31 09:51:39 2006 Now using regular expressions should work, but you get an error when using e.g. the "printing" char class, as reported by Matthew R. Dempsky [1]: /scsh% ./go Welcome to scsh 0.6.7 (R6RS) Type ,? for help. > (regexp-search? (rx (= 2 "o")) "foo") #t > (regexp-search? (rx printing) "foo") Error: Posix regexp ([^²³¹¼½¾--]) : invalid character range #{Regexp} 1> Michael Sperber explained [2] this is due to a regexp library which doesn't allow characters above the ASCII range. Also there has been complaints that the regexp library shipped with Cygwin is not POSIX compliant. One solution is to install the GNU regexp library from ftp://ftp.gnu.org/gnu/regex/regex-0.12.tar.gz. After unpacking, run the "configure" script as usual: % ./configure and then % make regex.o Now use "ar" to build a library containing regex.o: % ar ru libgnuregex.a regex.o Now copy GNU's "regex.h" to the include directory, usually /usr/include, and move "libgnuregex.a" to the Cygwin library directory, usually /lib. Modify the Makefile to link against "/lib/libgnuregex.a". After a "make clean" followed by "make" everything should now work: /scsh% ./go Welcome to scsh 0.6.7 (R6RS) Type ,? for help. > (regexp-search? (rx (= 2 "o")) "foo") #t > (regexp-search? (rx printing) "foo") #t > You can umount the directories after the compilation. No changes to Scsh's source code are necessary at all. Emilio Lopes Footnotes: [1] http://article.gmane.org/gmane.lisp.scheme.scsh/7615 [2] http://article.gmane.org/gmane.lisp.scheme.scsh/7616