Re: [Chicken-users] cross compilation setup

2008-09-04 Thread felix winkelmann
On Wed, Sep 3, 2008 at 12:22 PM, Jörg F. Wittenberger
[EMAIL PROTECTED] wrote:

 PATH=yourmingwpath:$PATH make PLATFORM=cross-linux-mingw
 PREFIX=yourprefix install

 What is this supposed to build?  The host system, the target system or
 both?

The target system.


 It did not work for me: looks for chicken.exe

What chicken version were you using? Could you supply a build log?


 I checked the current svn head.  How it the -host-extension supposed to
 work?  I found:

 Now chicken-setup accepts the -host-extension and sets a parameter
 object, but does not evaluate it anywhere.  (Therefore it tries to
 compile with the target instead the host compiler.)  Around line 347 I
 changed:

 (define-macro (compile . explist)
   `(run (csc ,@(if (host-extension) '(-host) '()) ,@explist) ) )


The -host option (which here is supplied to csc) tells the compiler
to not use the target C compiler and linker, but the host one. It is
intended to tell a specially built cross chicken to differentiate
between the C compilers for the host and the target system
(or build and host, which would be the autotools naming
convention). But the cross-linux-mingw platform just builds
a system for the target machine and the resulting binaries
are to be used there, so it is not what is called a cross chicken.


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] cross compilation setup

2008-09-04 Thread F. Wittenberger
Am Donnerstag, den 04.09.2008, 10:57 +0200 schrieb felix winkelmann:
 On Wed, Sep 3, 2008 at 12:22 PM, Jörg F. Wittenberger
 [EMAIL PROTECTED] wrote:
 
  PATH=yourmingwpath:$PATH make PLATFORM=cross-linux-mingw
  PREFIX=yourprefix install
 
  What is this supposed to build?  The host system, the target system or
  both?
 
 The target system.
 
 
  It did not work for me: looks for chicken.exe
 
 What chicken version were you using? Could you supply a build log?

svn head as of yesterday.

I hope I got around it changing Makefile.cross-linux-mingw like this:

# commands

HOSTSYSTEM=i586-mingw32msvc
CHICKEN=chicken



But I'm not yet there that I have tried the result.

  I checked the current svn head.  How it the -host-extension supposed to
  work?  I found:
 
  Now chicken-setup accepts the -host-extension and sets a parameter
  object, but does not evaluate it anywhere.  (Therefore it tries to
  compile with the target instead the host compiler.)  Around line 347 I
  changed:
 
  (define-macro (compile . explist)
`(run (csc ,@(if (host-extension) '(-host) '()) ,@explist) ) )
 
 
 The -host option (which here is supplied to csc) tells the compiler
 to not use the target C compiler and linker, but the host one. It is
 intended to tell a specially built cross chicken to differentiate
 between the C compilers for the host and the target system
 (or build and host, which would be the autotools naming
 convention). But the cross-linux-mingw platform just builds
 a system for the target machine and the resulting binaries
 are to be used there, so it is not what is called a cross chicken.

Well, in the second step I tried to build a cross compiler to create
windows binaries from the chicken host.  Eventually I tried
mingw-chicken-setup - the cross compile thingy - to set up easiffy.
Since that's a host extension, I passed the -host-extension option, but
that one did *not* pass the -host to csc!

Therefore I changed the define-macro as above.  Currently there is this:

(define-macro (compile . explist)
  `(run (csc ,@explist) ) )

That means the -host-extension option is ignored.


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] cross compilation setup

2008-09-04 Thread felix winkelmann
On Thu, Sep 4, 2008 at 2:11 PM, Jörg F. Wittenberger
[EMAIL PROTECTED] wrote:

 Well, in the second step I tried to build a cross compiler to create
 windows binaries from the chicken host.  Eventually I tried
 mingw-chicken-setup - the cross compile thingy - to set up easiffy.
 Since that's a host extension, I passed the -host-extension option, but
 that one did *not* pass the -host to csc!

 Therefore I changed the define-macro as above.  Currently there is this:

 (define-macro (compile . explist)
  `(run (csc ,@explist) ) )

 That means the -host-extension option is ignored.


I think you're right. Thanks for reporting this.


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] cross compilation setup

2008-09-03 Thread F. Wittenberger
Am Dienstag, den 02.09.2008, 10:01 +0200 schrieb felix winkelmann:
 Hi!
 
 
 Try:
 
 PATH=yourmingwpath:$PATH make PLATFORM=cross-linux-mingw
 PREFIX=yourprefix install

What is this supposed to build?  The host system, the target system or
both?

It did not work for me: looks for chicken.exe

  !!! Use -host-extension - not -host as the wiki said.  -host is the same
  as -H and changes the download host name!
 
 Right, thanks for mentioning this.

I checked the current svn head.  How it the -host-extension supposed to
work?  I found:

 Now chicken-setup accepts the -host-extension and sets a parameter
 object, but does not evaluate it anywhere.  (Therefore it tries to
 compile with the target instead the host compiler.)  Around line 347 I
 changed:

 (define-macro (compile . explist)
   `(run (csc ,@(if (host-extension) '(-host) '()) ,@explist) ) )

/Jörg


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] cross compilation setup

2008-09-02 Thread felix winkelmann
Hi!


Try:

PATH=yourmingwpath:$PATH make PLATFORM=cross-linux-mingw
PREFIX=yourprefix install

 !!! Use -host-extension - not -host as the wiki said.  -host is the same
 as -H and changes the download host name!

Right, thanks for mentioning this.


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] cross compilation setup

2008-09-01 Thread F. Wittenberger
Hi all,

I'm trying to set up a cross compilation environment following the steps
details in http://chicken.wiki.br/cross-compilation .  This did not
fully apply, here is what I did:

I want to compile on Linux (Ubuntu 8.04) and build Windows executables.

1. I installed the mingw32 package.

2. make PLATFORM=linux HOST=i586-mingw32msvc PREFIX=/ ARCH=x86 DESTDIR=
$HOME/lib/mingw  

This leads to the first suspicious difference between the wiki page and
my command line.  the wiki said Setting HOST will compile the C files
for the CHICKEN runtime system with ... [arm-linux-gcc] - hence I'd
expect i586-mingw32msvc-gcc to be used, but the first I see is:

gcc -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -c apply-hack.x86.s -o
apply-hack.x86.o

which looks different.  The defaults.make appears to use HOSTSYSTEM, not
HOST.  So let's start all over.

3. make PLATFORM=linux HOSTSYSTEM=i586-mingw32msvc PREFIX=/ ARCH=x86
DESTDIR=$HOME/lib/mingw  

This dies searching for sysexits.h -- which in turn comes from
chicken-defaults.h (or was it chicken-config.h - why those two?).  I
removed them and ran

4. make PLATFORM=mingw-msys HOSTSYSTEM=i586-mingw32msvc PREFIX=/
ARCH=x86 DESTDIR=$HOME/lib/mingw 

This did generate the files, but dies after compiling apply-hack.x86.s
and  library.c to library-static.o -- it misses chicken.exe so badly.

5. make PLATFORM=linux HOSTSYSTEM=i586-mingw32msvc PREFIX=/ ARCH=x86
DESTDIR=$HOME/lib/mingw POSIXFILE=posixwin


This failes in the linker missing -ldl

6. make PLATFORM=mingw-msys HOSTSYSTEM=i586-mingw32msvc PREFIX=/
ARCH=x86 DESTDIR=$HOME/lib/mingw POSIXFILE=posixwin

  Creating library file: libchicken.dll.a ? Is this correct???

again missing chicken.exe

7. make CHICKEN=chicken PLATFORM=linux HOSTSYSTEM=i586-mingw32msvc
PREFIX=/ ARCH=x86 DESTDIR=$HOME/lib/mingw POSIXFILE=posixwin

Maybe that's a better trick than (5) ?

$ file chicken.exe 
chicken.exe: MS-DOS executable PE  for MS Windows (console) Intel 80386
32-bit

At least it seems to work.

8. make PLATFORM=mingw-msys HOSTSYSTEM=i586-mingw32msvc PREFIX=/
ARCH=x86 DESTDIR=$HOME/lib/mingw POSIXFILE=posixwin CHICKEN=chicken
install-libs

9. make PLATFORM=linux HOSTSYSTEM=i586-mingw32msvc PREFIX=/ ARCH=x86
DESTDIR=$HOME/lib/mingw POSIXFILE=posixwin CHICKEN=chicken clean

rm chicken-defaults.h chicken-config.h

10.   make PLATFORM=linux TARGET_PREFIX=$HOME/lib/mingw
TARGETSYSTEM=i586-mingw32msvc PREFIX=$HOME/lib/mingw-cross
TARGET_RUN_PREFIX='C:Ball' PROGRAM_PREFIX=mingw- install

[[[ The huge amount of #\\ is just trialerror and ought to be fixed in
the Makefile - skipping that now, because it seems that more #\/ are
inserted into filenames, which I doubt is acceptable for Wind$s. ]]]

$ PATH=/home/jfw/lib/mingw-cross/bin/:$PATH
$ mingw-csi

CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.3.11 - linux-unix-gnu-x86 [ manyargs dload ptables applyhook
cross ]
SVN rev. 11663  compiled 2008-09-01 on berfert (Linux)

looks good so far

11. mingw-chicken-setup -host-extension -v easyffi

!!! Use -host-extension - not -host as the wiki said.  -host is the same
as -H and changes the download host name!

Now chicken-setup accepts the -host-extension and sets a parameter
object, but does not evaluate it anywhere.  (Therefore it tries to
compile with the target instead the host compiler.)  Around line 347 I
changed:

(define-macro (compile . explist)
  `(run (csc ,@(if (host-extension) '(-host) '()) ,@explist) ) )

Repeat from (10) to install the fixed binary.

$ mingw-chicken-setup -l
chicken-wrap   Version: 1.92 
easyffiVersion: 1.92 (Release
200802130216)
silex  Version:  1.1 (Release
200803222148)

That's enough for today.  I need a break.

best regards

/Jörg


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users