Ivan Shmakov | 1 Feb 2008 16:33
Picon

MinGW

	I've started hacking the Scheme48 source in order to make it
	build with MinGW.  So far, I was able to cross-compile the VM on
	a GNU/Linux host roughly as follows:

$ mkdir +build && cd +build/ 
$ ../configure --prefix=/mingw32 --host=i586-mingw32msvc \
      ac_cv_sizeof_void_p=4 ac_cv_bits_per_byte=8 \
      CPPFLAGS=-D_WIN32_WINNT=0x0501
...
$ LC_ALL=C nohup time make & 
... wait for it to break...
$ i586-mingw32msvc-gcc -shared \
      -o c/srfi-27.so c/srfi-27.o c/libscheme48.a -lwsock32 -lws2_32
$ LC_ALL=C nohup time make scheme48vm & 
... should build the VM...
$ 

	It will probably be somewhat tricky to get the image built in
	this case.

	I had to patch the current source as follows.  Some of the
	changes (minor bug fixes) probably may be useful outside of the
	scope of the MinGW compilation.  (Check c/fake/sysexits.h, and
	Makefile.in for CPPFLAGS, for example.)

diff -r 43f2807b79eb Makefile.in
--- a/Makefile.in	Sun Jan 27 18:33:32 2008 +0600
+++ b/Makefile.in	Fri Feb 01 21:15:32 2008 +0600
 <at>  <at>  -11,7 +11,7  <at>  <at>  DEFS =  <at> DEFS <at>  -D__COMPILING_SCHEME48_ITS
 DEFS =  <at> DEFS <at>  -D__COMPILING_SCHEME48_ITSELF__ -DS48_HOST_ARCHITECTURE=\"$(HOST_ARCHITECTURE)\"
(Continue reading)

Ivan Shmakov | 1 Feb 2008 16:45
Picon

Re: MinGW

>>>>> Ivan Shmakov <ivan <at> theory.asu.ru> writes:

[...]

 > It will probably be somewhat tricky to get the image built in this
 > case.

	... Or could I just reuse the image built for GNU/Linux
	Scheme48?

$ cp -avi \
      /where/is/my/gnu-linux/build/scheme48.image \
      lib/scheme48.image 
$ wine ./bin/scheme48vm -i lib/scheme48.image 
Invoking /usr/lib/wine/wine.bin ./bin/scheme48vm -i lib/scheme48.image ...
Welcome to Scheme 48 1.8T (made by ivan on Sun Jan 27 12:38:17 NOVT 2008)
Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees.
Please report bugs to scheme-48-bugs <at> s48.org.
Get more information at http://www.s48.org/.
Type ,? (comma question-mark) for help.
> 

[...]

Michael Sperber | 2 Feb 2008 16:30
Picon

Re: MinGW


Neat!

Ivan Shmakov <ivan <at> theory.asu.ru> writes:

> 	It will probably be somewhat tricky to get the image built in
> 	this case.

As you noted, you can use the image built somewhere else.

... but can't you just follow the instructions in WINDOWS.txt in this
case?

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Ivan Shmakov | 2 Feb 2008 21:47
Picon

Re: MinGW

>>>>> Michael Sperber <sperber <at> deinprogramm.de> writes:

 > Neat!

	BTW, it should actually enable one to make a native build with
	MinGW (and MSYS), although I haven't tried it (yet.)

 >> It will probably be somewhat tricky to get the image built in this
 >> case.

 > As you noted, you can use the image built somewhere else.

	Great!

 > ... but can't you just follow the instructions in WINDOWS.txt in this
 > case?

	The instructions seems to imply the use of MSVC++.  This is
	somewhat problematic to me, since:

	* I have no access to it, I'm not familiar with it, and I'm
	  unsure about whether I should actually obtain and learn it (it
	  isn't free software, I guess?);

	* I have no Windows installed on the hosts I mainly use, and I'm
	  not sure that MSVC will run under Wine;

	* I generally consider deploying a development environment on a
	  W32 platform to be a hassle -- there're just too much manual
	  work; OTOH, all that I did to get a cross environment was:
(Continue reading)

Michael Sperber | 3 Feb 2008 19:09
Picon

Re: MinGW


Ivan Shmakov <ivan <at> theory.asu.ru> writes:

>  > ... but can't you just follow the instructions in WINDOWS.txt in this
>  > case?
>
> 	The instructions seems to imply the use of MSVC++.  This is
> 	somewhat problematic to me, since:

Just the instructions covering compilation of the VM C code.  I would
think the rest (from "A number of batch files" on) should work for you,
too.  They essentially don't require anything to be installed on the
Windows box.

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Ivan Shmakov | 3 Feb 2008 19:53
Picon

Re: MinGW

>>>>> Michael Sperber <sperber <at> deinprogramm.de> writes:

 >>> ... but can't you just follow the instructions in WINDOWS.txt in
 >>> this case?

 >> The instructions seems to imply the use of MSVC++.  This is somewhat
 >> problematic to me, since:

 > Just the instructions covering compilation of the VM C code.

	?  Do you mean the compilation of the VM image?  I see that the
	instructions therein imply the use of either MSVC (to compile
	the C code) or at least the VM (to do everything else, including
	the building of scheme48.image.)

	Anyway, since I'm cross-compiling, I have access to the GNU
	system and could easily build just anything I'm expected to be
	able to build out of the Scheme48 source code, including the VM
	executable for W32.  Am I right?

	As for overcoming the image build problem (in the
	cross-compilation case), I see two choices.  Either the built VM
	gets installed on the target along with the Scheme48 source and
	initial.image, so that scheme48.image can be built on the
	target, or the build process should actually produce both the
	native and the cross-compiled executable for the VM.

	Both choices make sense to me.  The first one gives the user
	somewhat better flexibility, while the second may ultimately
	lead to a better build system.  I should think on the latter;
(Continue reading)

Michael Sperber | 5 Feb 2008 20:05
Picon

Re: MinGW


Ivan Shmakov <ivan <at> theory.asu.ru> writes:

> 	?  Do you mean the compilation of the VM image?  I see that the
> 	instructions therein imply the use of either MSVC (to compile
> 	the C code) or at least the VM (to do everything else, including
> 	the building of scheme48.image.)

Yes, but I was referring specifically to the rest, starting with "A
number of batch files ...", which should work for you.
>
> 	Anyway, since I'm cross-compiling, I have access to the GNU
> 	system and could easily build just anything I'm expected to be
> 	able to build out of the Scheme48 source code, including the VM
> 	executable for W32.  Am I right?

Yes.

> 	Except for Scheme48 (or the VM executable and initial.image at
> 	least)?

Just the VM.  You need an installed Scheme 48 to build initial.image,
but I see no reason why it can't be a MinGW-built one.

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Ivan Shmakov | 6 Feb 2008 20:23
Picon

Re: MinGW

>>>>> Michael Sperber <sperber <at> deinprogramm.de> writes:

[...]

 >> Except for Scheme48 (or the VM executable and initial.image at
 >> least)?

 > Just the VM.  You need an installed Scheme 48 to build initial.image,
 > but I see no reason why it can't be a MinGW-built one.

	Actually, the problem is that when I build W32 version of
	Scheme48 on GNU/Linux, the build process doesn't produce a
	GNU/Linux executable as well.  So I have to build the same
	version of Scheme48 for GNU prior to cross-compiling in order to
	get the images.  (Surely I don't want to use Wine to finish the
	build.)

	It would be nice if the build system could handle
	cross-compilation more nicely with, e. g., building both the VM
	executable for the host platform, and for the build platform.

	OTOH, it may take less effort to just allow the native VM
	executable to be specified at the configure time (and be ignored
	unless cross-compiling.)

Michael Sperber | 7 Feb 2008 09:11
Picon

Re: MinGW


Ivan Shmakov <ivan <at> theory.asu.ru> writes:

>>>>>> Michael Sperber <sperber <at> deinprogramm.de> writes:
>
> [...]
>
>  >> Except for Scheme48 (or the VM executable and initial.image at
>  >> least)?
>
>  > Just the VM.  You need an installed Scheme 48 to build initial.image,
>  > but I see no reason why it can't be a MinGW-built one.
>
> 	Actually, the problem is that when I build W32 version of
> 	Scheme48 on GNU/Linux, the build process doesn't produce a
> 	GNU/Linux executable as well.  So I have to build the same
> 	version of Scheme48 for GNU prior to cross-compiling in order to
> 	get the images.  (Surely I don't want to use Wine to finish the
> 	build.)

I agree this would be nice to have.  Unfortunately, I'm not
knowledgeable about the pragmatics of cross-compilation.  Do you have
any hints or web references I could look at?

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Michael Sperber | 7 Feb 2008 11:10
Picon

Scheme 48 1.8 available


Scheme 48 is an implementation of Scheme written by Richard Kelsey and
Jonathan Rees. It is based on a byte-code interpreter and is designed to
be used as a testbed for experiments in implementation techniques and as
an expository tool. It comes with a module system, an extensive set of
libraries, an interactive command-line-based development environment and
a manual in various formats. Scheme 48 runs on most Unix/Linux systems,
as well as Windows NT, 2000, XP, and Vista, and is fully
R5RS-conformant.

Scheme 48 is available (under a very liberal license) from

http://www.s48.org/

Scheme 48 1.8 represents a significant internal reorganization of the OS
integration over 1.7.  In particular, 64-bit architectures are now
finally supported, and a few system components are now dynamically
loaded rather than built as a static part of the VM.  Other than that,
there are few user-visible changes or new features.

Enjoy! 
The Scheme 48 maintainers

---
01/20/08 (version 1.8)
         Additions:
           An experimental framework for asynchronous events from
            external code was added.  It's now used for asynchronous
            host-name lookups on systems with pthreads.
           Support for 64-bit architectures was added (thanks to
(Continue reading)


Gmane