English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
OCaml + Windows cross-compilation (code from the short talk today)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-02-04 (22:31)
From: Richard Jones <rich@a...>
Subject: OCaml + Windows cross-compilation (code from the short talk today)
The code is here:


The README from the tarball is also attached below.



This tarball / directory contains an example of cross-compiling OCaml
LablGtk programs for Windows, which I originally demonstrated at the
OCaml Users Conference meeting Feb 2009.

You will need to start here:


It's a good idea to join the Fedora MinGW mailing list (mentioned on
the above page), and if you have any problems post them on the mailing

	 	-   -   -

You must install Fedora 10 which you will need to upgrade to Fedora
Rawhide (the development version):


If you don't have Fedora Rawhide already, try installing it in a
virtual machine.

OCaml cross-compilation is _not_ supported on RHEL, EPEL, CentOS,
Fedora <= 10, etc at this time, although we may add these
distributions in future.

The software required is partially in Rawhide and partially in a
separate repository.  Create and edit a file /etc/yum.repos.d/mingw.repo


Replace "x86_64" with "i386" if you have a 32 bit machine.  We do not
compile the temporary repository for non-x86 architectures at this

Now install the packages and their deps by typing this command (as

  yum install \
     ocaml ocaml-x11 ocaml-findlib-devel \
     mingw32-gcc \
     mingw32-ocaml mingw32-ocaml-findlib mingw32-ocaml-lablgtk2 \
     mingw32-nsis mingw32-nsiswrapper \
     wine autoconf automake

You should now be able to compile the Windows demo by doing:


and then run/test it in Wine by doing:

  wine gtk_test.exe

To compile the Windows installer you will first need to install the
program (this is an arcane requirement which will be fixed in future).
As root do:

  make install

Then as a normal user do:

  make installer.exe

Copy installer.exe to a Windows machine to try it.

     		   -   -   -

Developers: The only files you need to copy in order to create an
autotools package are 'configure.ac' and 'Makefile.am'.  After copying
these to a new directory, run:

  autoreconf -i

(You may need to create empty files 'README', 'NEWS' etc. as

     		   -   -   -

For questions/problems please join the Fedora MinGW mailing list.

    		       	      	   - Richard Jones, Feb 2009

Richard Jones
Red Hat