Support.CrossCompile History

Hide minor edits - Show changes to markup

April 30, 2009, at 05:31 PM by enrico - Update cross-compilation notes and links.
Changed lines 11-24 from:
to:

Furthermore, you need some libraries and their include files for the GTK environment. The easiest way to get them is to use the GTK Bundle available on http://www.gtk.org/download-windows.html and http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libiconv-1.9.1.bin.woe32.zip.

Changed line 46 from:
    $ cross-configure.sh
to:
    $ cross-configure.sh --enable-gnu-regex
Added lines 53-54:

The option --enable-gnu-regex is necessary to use the bundled regular expression implementation which is necessary to be used on Windows.

Changed lines 67-77 from:
to:

http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.16/gtk+-bundle_2.16.1-20090419_win32.zip
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libiconv-1.9.1.bin.woe32.zip

February 24, 2008, at 10:51 AM by enrico - Remove note about lrealpath(we don't use it anymore).
Added line 60:

\\

Changed lines 62-63 from:

If you got some linker errors like undefined reference to `_fnmatch' or undefined reference to `_lrealpath', you need another version of libiberty. Read again the beginning of this text.

to:

If you got some linker errors like undefined reference to `_fnmatch', you need another version of libiberty. Read again about Libiberty.

February 22, 2008, at 10:03 AM by enrico - Add fix_pkgconfig.sh script by Yura. Force line breaks in wget-list of URLs.
Changed lines 38-39 from:

First, go to PREFIX/lib/pkgconfig/ and edit all .pc files. They have a line prefix= which you have to edit and set it to your prefix, in my case /usr/local/cross-tools/. Do this for every .pc file or write a little script which does this automatically ;-).

to:

First, go to PREFIX/lib/pkgconfig/ and edit all .pc files. They have a line prefix= which you have to edit and set it to your prefix, in my case /usr/local/cross-tools/. Do this for every .pc file. Yura Siamashka wrote a nice script to do this at once, you can download it here: fix_pkgconfig.sh.

Changed lines 70-85 from:
to:
October 13, 2007, at 11:43 AM by enrico - Updated link for cross-tools
Changed line 70 from:

http://www.libsdl.org/extras/win32/cross/mingw32-linux-x86-glibc-2.3.tar.gz

to:

http://www.libsdl.org/extras/win32/cross/mingw32-linux-x86-glibc-2.5.tar.gz

July 26, 2006, at 11:49 AM by enrico - removed gettext notice
Changed lines 49-50 from:

For configuring and compiling you should use the two scripts. cross-configure.sh can be used like the usual ./configure command. The cross-make.sh is a simple wrapper for the make command.

to:

For configuring and compiling you should use the two scripts. cross-configure.sh can be used like the usual ./configure command.
The cross-make.sh is just a simple wrapper for the make command.

Changed lines 63-65 from:

Problems

If you all do like described above and all worked fine, your executable won't be able to use gettext translation catalogs. I don't know yet why it doesn't work. If someone knows it, please drop me a mail.

to:

Links

For more information about the toolchain and some further information and what to take care about can be found on the following sites:
http://ricardo.ecn.wfu.edu/%7Ecottrell/cross-gtk/#config-build
and
http://www.libsdl.org/extras/win32/cross/README.txt

July 25, 2006, at 08:41 PM by enrico - created
Added lines 1-81:

Setting up a cross compiler on Linux to build Geany for Windows

Getting the files

You need the following files: First the compiler with all related tools(binutils, linker, ...). Visit http://www.libsdl.org/extras/win32/cross/ there are precompiled binaries for x86 Linux available and also a script to compile all by hand. I used the precompiled binaries to save time. Then download cross-make.sh and cross-configure.sh from the same site. There is also a ReadMe file, which has more information.

To compile some code which uses the Windows API, you need the appropriate header files. These can be obtained from: http://prdownloads.sourceforge.net/mingw/w32api-3.1.tar.gz?download

Furthermore, you need some libraries and their include files for the GTK environment: ftp://ftp.gtk.org/pub/gtk/v2.6/win32/atk-1.9.0.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/atk-dev-1.9.0.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/glib-2.6.6.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/glib-dev-2.6.6.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/gtk+-2.6.10-20050823.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/gtk+-dev-2.6.10-20050823.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/pango-1.8.2.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/pango-dev-1.8.2.zip ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/gettext-0.14.5.zip ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/gettext-dev-0.14.5.zip ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/libiconv-1.9.1.bin.woe32.zip I chosed the latest 2.6 series of GTK because for Windows Me or older only a GTK 2.6 runtime environment is available and we want to support them. If not, just use a newer GTK version.

Libiberty

And don't forget to get a newer version of libiberty. The one included in the binary archive is missing some symbols which are needed. A working version can be found here: http://files.uvena.de/misc/libiberty.a.gz (note that this file is also from the mingw32 project). Probably, you won't need this file if you are compile the compiler and related tools by hand.

Unpacking the files

Now, after downloading the files, they have to be extracted. Start with the precompiled binaries. Extract them somewhere to your filesystem, I recommend /usr/local/cross-tools, then you have not much work with adjusting paths. /usr/local/cross-tools is now the PREFIX and all other files should be extracted into this directory. So, proceed with the other archives and extract them into your prefix.

After that, copy the both scripts cross-configure.sh and cross-make.sh somewhere in your path. Perhaps, it is a good idea to rename them to something shorter. On my system the scripts are called xconfigure and xmake and reside in ~/bin.

The file libiberty.a.gz has to be extracted to PREFIX/lib/.

Setting up the environment

First, go to PREFIX/lib/pkgconfig/ and edit all .pc files. They have a line prefix= which you have to edit and set it to your prefix, in my case /usr/local/cross-tools/. Do this for every .pc file or write a little script which does this automatically ;-).

Then edit the script cross-configure.sh. Add the following lines somewhere at the beginning of the file:

    PKG_CONFIG_PATH=/usr/local/cross-tools/lib/pkgconfig/
    export PKG_CONFIG_PATH

Don't forget to adjust your paths. The other script doesn't have to be modified.

Configuring and compiling your sources

You have done the job. If all went well, you can start compiling your sources. For configuring and compiling you should use the two scripts. cross-configure.sh can be used like the usual ./configure command. The cross-make.sh is a simple wrapper for the make command.

Let's say you want to compile Geany, the following should work(assuming cross-make.sh and cross-configure.sh are in your PATH):

    $ svn co https://svn.sourceforge.net/svnroot/geany/trunk/ geany
    $ cd geany
    $ ./autogen.sh
    $ cross-configure.sh
    $ cross-make.sh

After that, you should have an executable in the src directory named geany.exe. If you got some linker errors like undefined reference to `_fnmatch' or undefined reference to `_lrealpath', you need another version of libiberty. Read again the beginning of this text.

Problems

If you all do like described above and all worked fine, your executable won't be able to use gettext translation catalogs. I don't know yet why it doesn't work. If someone knows it, please drop me a mail.

All needed files (wget-friendly) listed:

http://www.libsdl.org/extras/win32/cross/mingw32-linux-x86-glibc-2.3.tar.gz http://www.libsdl.org/extras/win32/cross/cross-make.sh http://www.libsdl.org/extras/win32/cross/cross-configure.sh http://prdownloads.sourceforge.net/mingw/w32api-3.1.tar.gz?download http://files.uvena.de/misc/libiberty.a.gz ftp://ftp.gtk.org/pub/gtk/v2.6/win32/atk-1.9.0.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/atk-dev-1.9.0.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/glib-2.6.6.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/glib-dev-2.6.6.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/gtk+-2.6.10-20050823.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/gtk+-dev-2.6.10-20050823.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/pango-1.8.2.zip ftp://ftp.gtk.org/pub/gtk/v2.6/win32/pango-dev-1.8.2.zip ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/gettext-0.14.5.zip ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/gettext-dev-0.14.5.zip ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/libiconv-1.9.1.bin.woe32.zip