<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Building_Spring_Cross_Compiled</id>
	<title>Building Spring Cross Compiled - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Building_Spring_Cross_Compiled"/>
	<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Building_Spring_Cross_Compiled&amp;action=history"/>
	<updated>2026-04-21T00:39:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=Building_Spring_Cross_Compiled&amp;diff=2671&amp;oldid=prev</id>
		<title>Qrow: Created page with &quot;Development &lt; Building Spring &lt; {{FULLPAGENAME}}  __TOC__  Cross-compiling allows you to build for other platforms than the machine you are building on. You can, for example, compile Windows 32-bit binaries on a Linux 64-bit machine.  = Obtaining the Source =  {{Obtaining_The_Source_Code}}  = CMake cross compiling =  == Setting up the cross compiler ==  The compiler is called MinGW, which is a port of GCC to windows. The version...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Building_Spring_Cross_Compiled&amp;diff=2671&amp;oldid=prev"/>
		<updated>2026-03-05T01:48:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/wiki/index.php?title=Engine_Development&quot; title=&quot;Engine Development&quot;&gt;Development&lt;/a&gt; &amp;lt; &lt;a href=&quot;/wiki/index.php?title=Building_spring&quot; title=&quot;Building spring&quot;&gt;Building Spring&lt;/a&gt; &amp;lt; {{FULLPAGENAME}}  __TOC__  Cross-compiling allows you to build for other platforms than the machine you are building on. You can, for example, compile Windows 32-bit binaries on a Linux 64-bit machine.  = Obtaining the Source =  {{Obtaining_The_Source_Code}}  = CMake cross compiling =  == Setting up the cross compiler ==  The compiler is called MinGW, which is a port of GCC to windows. The version...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Building_spring|Building Spring]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Cross-compiling allows you to build for other platforms than the machine you are building on. You can, for example, compile Windows 32-bit binaries on a Linux 64-bit machine.&lt;br /&gt;
&lt;br /&gt;
= Obtaining the Source =&lt;br /&gt;
&lt;br /&gt;
{{Obtaining_The_Source_Code}}&lt;br /&gt;
&lt;br /&gt;
= CMake cross compiling =&lt;br /&gt;
&lt;br /&gt;
== Setting up the cross compiler ==&lt;br /&gt;
&lt;br /&gt;
The compiler is called MinGW, which is a port of GCC to windows. The version are going to need is MinGW GCC 4.4.0 (which is MinGW 2.7) or later. Most Linux distributions come with MinGW-GCC 4.1.2 only in their standard repos (Summer 2009), so you have to do extra work to get 4.4.0+.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Gentoo===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge crossdev&lt;br /&gt;
EXTRA_ECONF=&amp;quot;--with-dwarf2 --disable-sjlj-exceptions&amp;quot; crossdev -t i686-mingw32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Additional instructions can be found [http://en.gentoo-wiki.com/wiki/Crossdev here] or [http://psas.pdx.edu/GentooCrossCompilerHowto/ here].&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 10.04===&lt;br /&gt;
&lt;br /&gt;
Use the repository specified [https://launchpad.net/~tobydox/+archive/mingw mingw ppa], and then install the required packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   sudo add-apt-repository ppa:tobydox/mingw&lt;br /&gt;
   sudo apt-get update&lt;br /&gt;
   sudo apt-get install mingw32-x-binutils mingw32-x-gcc mingw32-x-runtime mingw-x-w32api&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 11.10===&lt;br /&gt;
&lt;br /&gt;
see the section [https://github.com/spring/spring/blob/develop/buildbot/README.markdown Recompile MinGW package with dwarf2 exceptions instead of sjlj exceptions].&lt;br /&gt;
&lt;br /&gt;
===Other distros===&lt;br /&gt;
&lt;br /&gt;
You have to find a way yourself, or use [http://www.profv.de/mingw_cross_env/#tutorial these] instructions to get the sources and compile it yourself. When doing so, make sure to use these build flags for gcc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
--with-dwarf2 --disable-sjlj-exceptions --enable-shared --enable-version-specific-runtime-libs&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can add them under &amp;#039;&amp;#039;src/gcc-core.mk&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; This method will most likely not work anymore, as the checksum of the build files is checked by the makefile.&lt;br /&gt;
&lt;br /&gt;
Alternatively, use this line to compile all the deps (which will then be used instead of mingwlibs):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;make zlib boost devil ogg vorbis openal freetype sdl glew gcc&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting Spring&amp;#039;s windows dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are called &amp;#039;&amp;#039;&amp;#039;mingwlibs&amp;#039;&amp;#039;&amp;#039;. How to get them is described below.&lt;br /&gt;
&lt;br /&gt;
=== official MinGW - dwarf2 (default) ===&lt;br /&gt;
You can get it here (&amp;#039;&amp;#039;&amp;#039;Download Source&amp;#039;&amp;#039;&amp;#039; button, or use &amp;#039;&amp;#039;git&amp;#039;&amp;#039;):&lt;br /&gt;
* [http://github.com/spring/mingwlibs &amp;#039;&amp;#039;&amp;#039;mingwlibs&amp;#039;&amp;#039;&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
=== TDM MinGW - sjlj (alternative) ===&lt;br /&gt;
http://github.com/spring/spring/downloads&lt;br /&gt;
&lt;br /&gt;
== Setting up your directories ==&lt;br /&gt;
Here is my recommended layout&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
~/spring-xcompile/   (or wherever you want to put it all)&lt;br /&gt;
___ spring/   (the spring source)&lt;br /&gt;
___ win32/    (your target platform)&lt;br /&gt;
_______ build/ (the build files for your target will go here)&lt;br /&gt;
_______ final/ (the compiled binaries and libs will be installed here)&lt;br /&gt;
_______ libs/  (mingwlibs, the target libraries you just downloaded)&lt;br /&gt;
_______ win32.cmake (see below)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create your cmake toolchain ==&lt;br /&gt;
Create the toolchain file:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;pico &amp;quot;~/spring-xcompile/win32/win32.cmake&amp;quot;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
=== Example toolchain file ===&lt;br /&gt;
An example should be self-explanatory:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# the name of the target operating system&lt;br /&gt;
SET(CMAKE_SYSTEM_NAME Windows)&lt;br /&gt;
&lt;br /&gt;
# which compilers to use for C and C++&lt;br /&gt;
SET(CMAKE_C_COMPILER i686-mingw32-gcc)&lt;br /&gt;
SET(CMAKE_CXX_COMPILER i686-mingw32-g++)&lt;br /&gt;
&lt;br /&gt;
# here is the target environment located&lt;br /&gt;
SET(CMAKE_FIND_ROOT_PATH /usr/i686-mingw32)&lt;br /&gt;
&lt;br /&gt;
# the spring mingw32 dependencies&lt;br /&gt;
SET(MINGWLIBS ~/spring-xcompile/win32/libs)&lt;br /&gt;
&lt;br /&gt;
# the path that make install will use to put the final binaries&lt;br /&gt;
SET(CMAKE_INSTALL_PREFIX ~/spring-xcompile/win32/final)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pass this with &amp;lt;code&amp;gt;-DCMAKE_TOOLCHAIN_FILE=~/spring-xcompile/win32/win32.cmake&amp;lt;/code&amp;gt; to cmake or select it in the gui to make a cross-compilation (see below).&lt;br /&gt;
&lt;br /&gt;
=== Some Options Explained ===&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;MINGWLIBS&amp;#039;&amp;#039;&amp;#039;: absolute path to the directory where [[Building_Spring_Cross_Compiled#Getting_Spring.27s_windows_dependencies |&amp;#039;&amp;#039;&amp;#039;mingwlibs&amp;#039;&amp;#039;&amp;#039;]] are located&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CMAKE_INSTALL_PREFIX&amp;#039;&amp;#039;&amp;#039;: installation prefix (defaults to &amp;#039;&amp;#039;/usr/local&amp;#039;&amp;#039;) defines the base directory for installing&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;DATADIR&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;LIBDIR&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;BINDIR&amp;#039;&amp;#039;&amp;#039;: where to install data, libraries or binaries (relative paths are based on &amp;#039;&amp;#039;CMAKE_INSTALL_PREFIX&amp;#039;&amp;#039;, absolute paths are absolute (&amp;#039;&amp;#039;DESTDIR&amp;#039;&amp;#039; is still respected))&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;APPLICATIONS_DIR&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;MIME_DIR&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;PIXMAPS_DIR&amp;#039;&amp;#039;&amp;#039;: where to install freedesktop-files (icons, mime-types and application-description)&lt;br /&gt;
&lt;br /&gt;
=== Further reference ===&lt;br /&gt;
* [http://www.vtk.org/Wiki/CMake_FAQ CMake FAQ]&lt;br /&gt;
* &amp;#039;&amp;#039;man CMake&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.cmake.org/HTML/cmake-2.6.html CMake documentation] (long!)&lt;br /&gt;
&lt;br /&gt;
== Run CMake ==&lt;br /&gt;
&lt;br /&gt;
=== The GUI method ===&lt;br /&gt;
CMake offers a nice Qt4 gui to ease the following steps (to use the gui explained here, cmake must be at least version 2.6.1). Doing so should be straightforward:&lt;br /&gt;
* run &amp;lt;code&amp;gt;cmake-gui&amp;lt;/code&amp;gt;&lt;br /&gt;
* select source directory&lt;br /&gt;
* select (and/or create) build directory where temporary files are stored&lt;br /&gt;
* hit configure button&lt;br /&gt;
* choose your build type:&lt;br /&gt;
** Unix makefile if you are using linux and want to compile linux executables&lt;br /&gt;
** mingw makefiles if you are working on windows&lt;br /&gt;
** Unix makefile with cross compiler setup to cross-compile mingw32 executables, you have to select the toolchain file you want to use (see below)&lt;br /&gt;
* configure variables to your need (move the mouse over the options and read the tooltip for further informations on them and or see Section &amp;quot;Options&amp;quot;)&lt;br /&gt;
* push generate button&lt;br /&gt;
* open commandline and do &amp;quot;make&amp;quot; and &amp;quot;make install&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== The commandline method ===&lt;br /&gt;
&lt;br /&gt;
* cd to build directory&lt;br /&gt;
     &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;cd ~user/spring-xcompile/win32/build&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;cmake &amp;lt;path to source tree&amp;gt; &amp;lt;options&amp;gt;&amp;lt;/code&amp;gt; where:&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;path to source tree&amp;gt;&amp;lt;/code&amp;gt; is the path to the spring source directory&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;options&amp;gt;&amp;lt;/code&amp;gt; are defined like &amp;lt;code&amp;gt;-D&amp;lt;option name&amp;gt;=&amp;lt;value&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* IMPORTANT: depending on your settings you may need to run this command twice. It can&amp;#039;t hurt so I recommend doing it anyway.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;cmake &amp;quot;~user/spring-xcompile/spring&amp;quot; &amp;quot;-DCMAKE_TOOLCHAIN_FILE=~user/spring-xcompile/win32/win32.cmake&amp;quot;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;make spring &amp;amp;&amp;amp; make install-spring DESTDIR=~user/spring-xcompile/win32/final&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to show other build targets type: &amp;lt;code&amp;gt;make help&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Package Maintainers Note: ==&lt;br /&gt;
* doing &amp;lt;code&amp;gt;make install DESTDIR=/some/path&amp;lt;/code&amp;gt; will install spring in the specified place, putting files in subdirectories like configured. This may be helpful when making packages so Spring don&amp;#039;t get installed on your system for real (see also CMake FAQ [[http://www.vtk.org/Wiki/CMake_FAQ#Does_CMake.27s_.22make_install.22_support_DESTDIR.3F]]).&lt;br /&gt;
* You need to update the mime database (&amp;lt;code&amp;gt;update-mime-database&amp;lt;/code&amp;gt;) and the kde database (&amp;lt;code&amp;gt;kbuildsycoca&amp;lt;/code&amp;gt;) after installing to make the system aware of the newly installed mime types and desktop shortcuts.&lt;br /&gt;
&lt;br /&gt;
==Buildbot==&lt;br /&gt;
For setting up a buildbot slave, see: {{sourcelink|file=buildbot/README.markdown}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Qrow</name></author>
	</entry>
</feed>