Difference between revisions of "Compiling for Windows on Linux"

From The Powder Toy
Jump to: navigation, search
m (1 revision)
(talk)
Line 1: Line 1:
<h2> Cross Compilation </h3>
+
<h2> Cross Compilation </h2>
 
This is for Linux users to cross-compile to Windows 32-bit.
 
This is for Linux users to cross-compile to Windows 32-bit.
  
 
'''BEFORE WE START, PLEASE MAKE SURE YOU CAN COMPILE FOR LINUX FIRST!'''
 
'''BEFORE WE START, PLEASE MAKE SURE YOU CAN COMPILE FOR LINUX FIRST!'''
  
<h4> Packages </h5>
+
<h4> Packages </h4>
 
Search for the following in your package manager:
 
Search for the following in your package manager:
 
''mingw32  mingw32-binutils  mingw32-runtime''
 
''mingw32  mingw32-binutils  mingw32-runtime''
Line 25: Line 25:
 
<code>su -c 'pacman -S mingw32-{gcc,binutils,runtime}</code>
 
<code>su -c 'pacman -S mingw32-{gcc,binutils,runtime}</code>
  
<h4> Things you need to Download </h5>
+
<h4> Things you need to Download </h4>
 
Yes, you need to download some bits.
 
Yes, you need to download some bits.
  
Line 34: Line 34:
 
  * [[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]]
  
<h4> Extraction </h5>
+
<h4> Extraction </h4>
 
'''THE EXTRACTION PROCESS CAN ONLY BE DONE AS ROOT USER. USE AN ALTERNATE WORKSPACE AND CLOSE ALL WINDOWS WHEN FINISHED.'''
 
'''THE EXTRACTION PROCESS CAN ONLY BE DONE AS ROOT USER. USE AN ALTERNATE WORKSPACE AND CLOSE ALL WINDOWS WHEN FINISHED.'''
  
Line 47: Line 47:
 
Everything I'm telling you to extract is a folder and any overwrites or merges should be permitted.
 
Everything I'm telling you to extract is a folder and any overwrites or merges should be permitted.
  
<h5> SDL-devel-1.2.14-mingw32.tar.gz </h6>
+
<h5> SDL-devel-1.2.14-mingw32.tar.gz </h5>
 
Extract the bin, include and libs folders
 
Extract the bin, include and libs folders
  
<h5> bzip2-1.0.5-2-mingw32-dev.tar.gz </h6>
+
<h5> bzip2-1.0.5-2-mingw32-dev.tar.gz </h5>
 
Extract the entire archive.
 
Extract the entire archive.
  
<h5> mingw32-libgnurx-2.5.1-dev.tar </h6>
+
<h5> mingw32-libgnurx-2.5.1-dev.tar </h5>
 
Extract the entire archive.
 
Extract the entire archive.
  
<h4> DLLs </h5>
+
<h4> DLLs </h4>
 
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.
  
Line 65: Line 65:
 
  * [[http://tinyurl.com/grxdll]] - libgnurx-0.dll
 
  * [[http://tinyurl.com/grxdll]] - libgnurx-0.dll
  
<h4> Compile </h5>
+
<h4> Compile </h4>
 
Some Makefile changes may be needed.
 
Some Makefile changes may be needed.
  

Revision as of 19:28, 28 September 2011

Cross Compilation

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

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.

* [[1]] - SDL.dll
* [[2]] - libbz2-2.dll
* [[3]] - 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