Difference between revisions of "Compiling for Windows on Linux"

From The Powder Toy
Jump to: navigation, search
m (Add to Development category)
Line 1: Line 1:
This is for Linux users to cross-compile to Windows 32-bit.
+
This is for Linux users to cross-compile to Windows 32-bit.
 +
 
 +
This page is probably out of date.
  
 
'''BEFORE WE START, PLEASE MAKE SURE YOU CAN COMPILE FOR LINUX FIRST!'''
 
'''BEFORE WE START, PLEASE MAKE SURE YOU CAN COMPILE FOR LINUX FIRST!'''
Line 8: Line 10:
  
 
'''Ubuntu Users:'''
 
'''Ubuntu Users:'''
Copy and paste this into your address bar (FireFox):
+
Copy and paste this into your address bar (FireFox):<br>
 
 
 
''apt:mingw32,mingw32-binutils,mingw32-runtime''
 
''apt:mingw32,mingw32-binutils,mingw32-runtime''
  
If it doesn't work, use the following in a terminal:
+
If it doesn't work, use the following in a terminal:<br>
 
 
 
<code>sudo apt-get install  mingw32 mingw32-binutils mingw32-runtime</code>
 
<code>sudo apt-get install  mingw32 mingw32-binutils mingw32-runtime</code>
  
 
'''Debian Users'''
 
'''Debian Users'''
In a terminal:\\
+
In a terminal:<br>
 
<code>su -c "apt-get install mingw32 mingw32-binutils mingw32-runtime"</code>
 
<code>su -c "apt-get install mingw32 mingw32-binutils mingw32-runtime"</code>
  
 
'''Arch Users'''
 
'''Arch Users'''
In your Terminal:
+
In your Terminal:<br>
 
<code>su -c 'pacman -S mingw32-{gcc,binutils,runtime}</code>
 
<code>su -c 'pacman -S mingw32-{gcc,binutils,runtime}</code>
  
Line 27: Line 27:
 
Yes, you need to download some bits.
 
Yes, you need to download some bits.
  
  * [[http:''www.libsdl.org/release/SDL-devel-1.2.14-mingw32.tar.gz| SDL-devel-1.2.14-mingw32.tar.gz]] from [[http:''www.libsdl.org/]]
+
  * [http://www.libsdl.org/release/SDL-devel-1.2.14-mingw32.tar.gz SDL-devel-1.2.14-mingw32.tar.gz] from [http://www.libsdl.org/ http://www.libsdl.org/]
  
  * [[http:''sourceforge.net/projects/mingw/files/MinGW/bzip2/1.0.6-1/bzip2-1.0.6-1-mingw32-src.tar.lzma/download| bzip2-1.0.5-2-mingw32-dev.tar.lzma]] from [[http:''sourceforge.net/projects/mingw/files/MinGW/bzip2/release%201.0.5-2/| MinGW on SourceForge]].
+
  * [http://sourceforge.net/projects/mingw/files/MinGW/bzip2/1.0.6-1/bzip2-1.0.6-1-mingw32-src.tar.lzma/download bzip2-1.0.5-2-mingw32-dev.tar.lzma] from [http://sourceforge.net/projects/mingw/files/MinGW/bzip2/release%201.0.5-2/ MinGW on SourceForge].
  
  * [[http:''sourceforge.net/projects/mingw/files/UserContributed/regex/mingw-regex-2.5.1/mingw-libgnurx-2.5.1-dev.tar.gz/download| mingw32-libgnurx-2.5.1-dev.tar]] from [[http:''sourceforge.net/projects/mingw/files/UserContributed/regex/mingw-regex-2.5.1/| MinGW on SourceForge]]
+
  * [http://sourceforge.net/projects/mingw/files/UserContributed/regex/mingw-regex-2.5.1/mingw-libgnurx-2.5.1-dev.tar.gz/download mingw32-libgnurx-2.5.1-dev.tar] from [http://sourceforge.net/projects/mingw/files/UserContributed/regex/mingw-regex-2.5.1/ MinGW on SourceForge]
  
 
====  Extraction  ====
 
====  Extraction  ====
Line 58: Line 58:
 
These DLLs will need to be distributed with your builds so they work. Or if your lazy you can just  post the URLs and tell everyone else to download them.
 
These DLLs will need to be distributed with your builds so they work. Or if your lazy you can just  post the URLs and tell everyone else to download them.
  
  * [[http://tinyurl.com/sdldll]] - SDL.dll
+
  * http://tinyurl.com/sdldll - SDL.dll
  
  * [[http://tinyurl.com/bz2dll]] - libbz2-2.dll
+
  * http://tinyurl.com/bz2dll - libbz2-2.dll
  
  * [[http://tinyurl.com/grxdll]] - libgnurx-0.dll
+
  * http://tinyurl.com/grxdll - libgnurx-0.dll
  
 
====  Compile  ====
 
====  Compile  ====
Line 69: Line 69:
 
Arch users need to set the following in the Makefile:
 
Arch users need to set the following in the Makefile:
  
<code>WIN_COMPILER := i486-mingw32-gcc
+
<code>WIN_COMPILER := i486-mingw32-gcc<br>
 
WIN_RES := i486-mingw32-windres</code>
 
WIN_RES := i486-mingw32-windres</code>
  
 
Change all instances of ''-llibregex'' to ''-llibgnurx''
 
Change all instances of ''-llibregex'' to ''-llibgnurx''
  
Save, Exit, cd to your powder toy directory and run:\\
+
Save, Exit, cd to your powder toy directory and run:
 
<code>$make powder-sse.exe powder-sse2.exe powder-sse3.exe</code>
 
<code>$make powder-sse.exe powder-sse2.exe powder-sse3.exe</code>
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 20:58, 24 October 2011

This is for Linux users to cross-compile to Windows 32-bit.

This page is probably out of date.

BEFORE WE START, PLEASE MAKE SURE YOU CAN COMPILE FOR LINUX FIRST!

Packages

Search for the following in your package manager: mingw32 mingw32-binutils mingw32-runtime

Ubuntu Users: Copy and paste this into your address bar (FireFox):
apt:mingw32,mingw32-binutils,mingw32-runtime

If it doesn't work, use the following in a terminal:
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime

Debian Users In a terminal:
su -c "apt-get install mingw32 mingw32-binutils mingw32-runtime"

Arch Users In your Terminal:
su -c 'pacman -S mingw32-{gcc,binutils,runtime}

Things you need to Download

Yes, you need to download some bits.

* SDL-devel-1.2.14-mingw32.tar.gz from http://www.libsdl.org/
* bzip2-1.0.5-2-mingw32-dev.tar.lzma from MinGW on SourceForge.
* mingw32-libgnurx-2.5.1-dev.tar from MinGW on SourceForge

Extraction

THE EXTRACTION PROCESS CAN ONLY BE DONE AS ROOT USER. USE AN ALTERNATE WORKSPACE AND CLOSE ALL WINDOWS WHEN FINISHED.

GNOME: sudo nautilus -OR- su -c "nautilus"\\ XFCE use Thunar instead of Nautilus\\ KDE use Konqueror

The target folder for all extractions is /usr/i586-mingw32msvc (Arch use /usr/i486-mingw32)\\ Everything I'm telling you to extract is a folder and any overwrites or merges should be permitted.

SDL-devel-1.2.14-mingw32.tar.gz

Extract the bin, include and libs folders

bzip2-1.0.5-2-mingw32-dev.tar.gz

Extract the entire archive.

mingw32-libgnurx-2.5.1-dev.tar

Extract the entire archive.

DLLs

These DLLs will need to be distributed with your builds so they work. Or if your lazy you can just post the URLs and tell everyone else to download them.

* http://tinyurl.com/sdldll - SDL.dll
* http://tinyurl.com/bz2dll - libbz2-2.dll
* http://tinyurl.com/grxdll - libgnurx-0.dll

Compile

Some Makefile changes may be needed.

Arch users need to set the following in the Makefile:

WIN_COMPILER := i486-mingw32-gcc
WIN_RES := i486-mingw32-windres

Change all instances of -llibregex to -llibgnurx

Save, Exit, cd to your powder toy directory and run: $make powder-sse.exe powder-sse2.exe powder-sse3.exe