Editing Free Compiler Setup Under Linux
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | This article explains how to setup a free compiler | + | This article explains how to setup a free compiler under Linux, with an assumption that Orbiter itself can be ran under Linux with Wine for testing your modules. Latest possible setup that is capable of doing it is [http://www.winehq.org Wine 1.6.2] and [http://www.orbiter-forum.com/download.php ORBITER 2010-P1], using the built-in DX7 graphical client and [http://orbiter-forum.com/showthread.php?t=18431 DX9 client]. The steps presented here have been tested on Debian-stable ("jessie"), with Nouveau graphics drivers. |
− | The concept is based on downloading and running MS VC | + | The concept is based on downloading and running MS VC executables, wrapped by [http://www.winehq.org Wine], and fed back to a native multiplatform IDE - [http://www.codeblocks.org/ Code::Blocks]. Thanks to [http://wiki.winehq.org/winetricks/ winetricks], it's of course easy to download the VC executables, along with its IDE, and run the whole IDE through Wine, but such a setup is unstable. |
− | + | == Downloading build software and Code::Blocks == | |
− | |||
First, checkout and try to build C::B from source, to see if it the build succeeds. Alternatively, while the IDE builds, you may start hacking the source already. | First, checkout and try to build C::B from source, to see if it the build succeeds. Alternatively, while the IDE builds, you may start hacking the source already. | ||
<pre> | <pre> | ||
− | |||
sudo aptitude install subversion wine winetricks build-essential \ | sudo aptitude install subversion wine winetricks build-essential \ | ||
libtool automake libhunspell-dev libgamin-dev libwxgtk3.0-dev | libtool automake libhunspell-dev libgamin-dev libwxgtk3.0-dev | ||
− | |||
− | |||
mkdir -p ~/devel/codeblocks | mkdir -p ~/devel/codeblocks | ||
mkdir -p ~/devel/bin | mkdir -p ~/devel/bin | ||
cd ~/devel/codeblocks | cd ~/devel/codeblocks | ||
− | # Checking out version | + | # Checking out version which is the latest working version. |
svn checkout svn://svn.code.sf.net/p/codeblocks/code/tags/16.01 | svn checkout svn://svn.code.sf.net/p/codeblocks/code/tags/16.01 | ||
</pre> | </pre> | ||
− | + | == Hacking Code::Blocks == | |
The CB needs to be a bit hacked, to enable MS VC++ under Linux, which normally isn't possible. The hacking is kept to a minimum and additionally allows to use the same CB project file to compile code under Windows, using the same build targets. | The CB needs to be a bit hacked, to enable MS VC++ under Linux, which normally isn't possible. The hacking is kept to a minimum and additionally allows to use the same CB project file to compile code under Windows, using the same build targets. | ||
Save the following patch: | Save the following patch: | ||
Line 44: | Line 40: | ||
And perform the actual patching: | And perform the actual patching: | ||
<pre> | <pre> | ||
− | + | patch < ~/devel/codeblocks/16.01/src/plugins/compilergcc/compilergcc-new.cpp | |
− | |||
</pre> | </pre> | ||
− | + | == Compiling Code::Blocks == | |
<pre> | <pre> | ||
cd ~/devel/codeblocks/16.01 | cd ~/devel/codeblocks/16.01 | ||
Line 58: | Line 53: | ||
</pre> | </pre> | ||
− | == Preparing MS VC2005 Express | + | == Preparing MS VC2005 Express == |
− | + | === IDE === | |
+ | Download the IDE and executables | ||
<pre> | <pre> | ||
− | + | winetricks vc2005express | |
+ | </pre> | ||
+ | Select installation of only the first option (the IDE) | ||
+ | === Platform SDK === | ||
+ | This info comes from [http://appdb.winehq.org/objectManager.php?sClass=version&iId=9569 WineDB] | ||
+ | <pre> | ||
prefixName=vc2005express | prefixName=vc2005express | ||
− | prefixDir=$HOME/.local/share/wineprefixes | + | prefixDir=$HOME/.local/share/wineprefixes/ |
− | |||
− | + | for ((i=1; i<=10; i++)) ; do wget http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.$i.cab ; done | |
− | + | wget http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.bat | |
+ | wget http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/Extract.exe | ||
+ | WINEPREFIX=$prefixDir/$prefixName wine start.exe PSDK-FULL.bat "C:\psdktemp" | ||
+ | </pre> | ||
+ | Wait until the previous command finishes before executing the next one: | ||
+ | <pre> | ||
+ | WINEPREFIX=$prefixDir/$prefixName wine "C:\psdktemp\Setup.Exe" | ||
+ | </pre> | ||
+ | Next, next, next ... | ||
− | + | === Symbolic links for ease === | |
− | + | <pre> | |
+ | cd $prefixDir/$prefixName/drive_c | ||
+ | mkdir vc && cd vc | ||
+ | ln -s ../Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/bin/ | ||
+ | ln -s ../Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/include/ | ||
+ | ln -s ../Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/lib/ | ||
− | + | cd $prefixDir/$prefixName/drive_c | |
− | cd $ | + | mkdir psdk && cd psdk |
− | ln -s Program\ Files/Microsoft\ | + | ln -s ../Program\ Files/Microsoft\ Platform\ SDK\ for\ Windows\ XP\ SP2/Include |
− | ln -s .. | + | ln -s ../Program\ Files/Microsoft\ Platform\ SDK\ for\ Windows\ XP\ SP2/Lib |
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
== VC++ Wine wrappers == | == VC++ Wine wrappers == | ||
− | |||
− | |||
− | |||
− | |||
Create the following files: | Create the following files: | ||
− | |||
~/devel/bin/cl.sh: | ~/devel/bin/cl.sh: | ||
− | |||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
− | + | prefixName=vc2005express | |
− | wine | + | prefixDir=$HOME/.local/share/wineprefixes/ |
+ | WINEPREFIX=$prefixDir/$prefixName wine $prefixDir/$prefixName/drive_c/vc/bin/cl.exe /I"c:/vc/include" /I"c:/psdk/Include" $@ | ||
</pre> | </pre> | ||
− | |||
~/devel/bin/link.sh: | ~/devel/bin/link.sh: | ||
− | |||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
− | + | prefixName=vc2005express | |
− | wine | + | prefixDir=$HOME/.local/share/wineprefixes/ |
+ | WINEPREFIX=$prefixDir/$prefixName wine $prefixDir/$prefixName/drive_c/vc/bin/link.exe /LIBPATH:"c:/vc/lib" /LIBPATH:"c:/psdk/Lib" $@ | ||
</pre> | </pre> | ||
− | |||
~/devel/bin/rc.sh: | ~/devel/bin/rc.sh: | ||
− | |||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
− | + | prefixName=vc2005express | |
− | wine | + | prefixDir=$HOME/.local/share/wineprefixes/ |
+ | WINEPREFIX=$prefixDir/$prefixName wine $prefixDir/$prefixName/drive_c/vc/bin/rc.exe $@ | ||
</pre> | </pre> | ||
Line 125: | Line 127: | ||
* Execute codeblocks | * Execute codeblocks | ||
* Go to Settings->Compiler | * Go to Settings->Compiler | ||
− | * Select | + | * Select Tiny C Compiler |
* Select Toolchain executables tab | * Select Toolchain executables tab | ||
− | * In Compiler's installation directory, paste /home/<ENTER_YOUR_USERNAME>/devel | + | * In Compiler's installation directory, paste /home/<ENTER_YOUR_USERNAME>/devel and modify accordingly |
− | + | * Select Build options tab | |
− | * Select Build options tab | + | * Set Number of processes for parallel builds to more than 1. This is a workaround that enables persistent wineserver. See [[#Final considerations | Final considerations ]] |
− | * Download, open and use [https:// | + | * Download, open and use [https://sourceforge.net/p/enjomitchsorbit/code Launch MFD] project file (available under launchmfd/LaunchMFD.cbp) as a template |
* Download and use in your project the header file launchmfd/afxres.h. This is required for VS Express. | * Download and use in your project the header file launchmfd/afxres.h. This is required for VS Express. | ||
− | |||
* Add some sources and hit The Compile Button(TM) ! | * Add some sources and hit The Compile Button(TM) ! | ||
− | + | = Final considerations = | |
− | [[Category:Tutorials]] | + | The compilation takes a lot of time, but in theory it could be made faster by running wineserver with -p command (persistant), so that Wine doesn't spawn the server on each tool call, but even if such a server is running, Wine seems to ignore it and spawns one anyway. The command to run the wineserver on Debian is: |
− | [[Category: | + | <pre> |
+ | /usr/lib/i386-linux-gnu/wine/wineserver -p | ||
+ | </pre> | ||
+ | |||
+ | [[Category:Tutorials]][[Category:Addon tutorials]] |