Difference between revisions of "Build for Windows"
(The new way to compile xmoto from windows) |
XMOTOFREAK (talk | contribs) (→Prerequites) |
||
(13 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | = | + | ==Prequisties== |
− | + | Before we can start to compile X-Moto under windows, then we need to get 2 programs called Msys and MinGW. | |
− | |||
− | |||
− | |||
− | Before we can start to compile | ||
Fortunatly these are packed into one program, so they should be really easy to get. | Fortunatly these are packed into one program, so they should be really easy to get. | ||
Therefore go to [http://download.tuxfamily.org/xmoto/xmoto/msys/ this site] and download the most recent package. Unpack them to a place on your computer, but be aware; DO NOT place them in a path that contains spaces (Like C:\documents and settings). That will cause an error because of a bug. | Therefore go to [http://download.tuxfamily.org/xmoto/xmoto/msys/ this site] and download the most recent package. Unpack them to a place on your computer, but be aware; DO NOT place them in a path that contains spaces (Like C:\documents and settings). That will cause an error because of a bug. | ||
− | == | + | ==Preparing for compile== |
[[Image:Msys_start_screen.png|right|thumb|500px|]] | [[Image:Msys_start_screen.png|right|thumb|500px|]] | ||
Line 17: | Line 13: | ||
It's from this terminal we'll compile later on. But first we need the most recent source code for X-Moto. To get this, we use the command | It's from this terminal we'll compile later on. But first we need the most recent source code for X-Moto. To get this, we use the command | ||
+ | |||
svn co svn://svn.tuxfamily.org/svnroot/xmoto/xmoto/trunk | svn co svn://svn.tuxfamily.org/svnroot/xmoto/xmoto/trunk | ||
Line 31: | Line 28: | ||
[[Image:Msys_cd.png]] | [[Image:Msys_cd.png]] | ||
+ | You can run the command pwd to know where you are located | ||
+ | pwd | ||
When you got that: | When you got that: | ||
− | sh ./bootstrap | + | sh ./bootstrap |
+ | or just | ||
+ | bootstrap | ||
That won't take a lot of time. | That won't take a lot of time. | ||
Line 44: | Line 45: | ||
./configure | ./configure | ||
− | This will take some minutes. Be aware of that you maybe some errors, about missing .dll files. Just ignore them and press ok. It won't stop msys from configuring. | + | This will take some minutes. Be aware of that you maybe some errors, about missing .dll files. Just ignore them and press ok. It won't stop msys from configuring. Take a look at [[#More about configure|this section]] if you wan't to know more about the configure |
[[Image:After_configure.png|''It should look like this after the configure'']] | [[Image:After_configure.png|''It should look like this after the configure'']] | ||
<center>''It should look like this after the configure''</center> | <center>''It should look like this after the configure''</center> | ||
− | |||
==Compile== | ==Compile== | ||
Line 67: | Line 67: | ||
This command will remove a lot of unnecessary debugging stuff and make the .exe files size smaller. | This command will remove a lot of unnecessary debugging stuff and make the .exe files size smaller. | ||
− | Now | + | Now copy the compiled xmoto.exe in the directory of your normally installed X-Moto and replace it with the other xmoto.exe. For example in C:\program files\XMoto\xmoto.exe |
− | Then | + | Then Double-click and enjoy your own compiled xmoto! |
− | + | ==Additional things to know== | |
+ | |||
+ | In this section can you find things that are nice to know about compiling X-Moto. | ||
− | == | + | ===Updating your source code=== |
Insted of downloading all sources codes each time you want to update your svn version, then use the command: | Insted of downloading all sources codes each time you want to update your svn version, then use the command: | ||
+ | |||
+ | svn up | ||
+ | |||
+ | Then you'll only download updated files. | ||
+ | |||
+ | ===About using commands in Msys=== | ||
+ | |||
+ | After you update sources via svn up, or if you added or removed something in the source code, and you want to re-compile then you have simplyly to type the command : | ||
+ | |||
+ | make | ||
+ | |||
+ | It will rebuild only what is necessary. | ||
+ | By the way, if you get an error, it's probably because a file called configure.in or Makefile.am has been modified. In this case, you've to type : | ||
+ | |||
+ | sh ./bootstrap | ||
+ | ./config.status --recheck (or ./configure) | ||
+ | make | ||
+ | |||
+ | ====Grep==== | ||
+ | |||
+ | Another smart thing msys can do, is to search in the source code after keywords. | ||
+ | To do this we use the command ''grep''. | ||
+ | |||
+ | it works like this: ''grep [How to look for it][What to look for][Where to look for it]'' | ||
+ | |||
+ | An example: | ||
+ | |||
+ | grep -i -n x-moto trunk/src/*.cpp | ||
+ | |||
+ | gives the output: | ||
+ | |||
+ | [[Image:Msys_grep.png]] | ||
+ | |||
+ | Try to write | ||
+ | grep --help | ||
+ | And figure out why we get that output! | ||
+ | |||
+ | ===More about configure=== | ||
+ | |||
+ | When you succed the configure, a sort of table comes as you may have noticed. That table tells if an option is enabled or not. | ||
+ | |||
+ | [[Image:Msys_more_about_configure.png]] | ||
+ | |||
+ | But it also show which commands you should use to enable a option. For example if you want xmoto to use the zoom option: | ||
+ | |||
+ | ./configure --with-enable-zoom=1 | ||
+ | |||
+ | [[Image:Msys_after_configure_with_zoom.png]] | ||
+ | |||
+ | <center>''This is the table with zoom enabled''</center> |
Latest revision as of 02:30, 13 March 2013
Contents
Prequisties
Before we can start to compile X-Moto under windows, then we need to get 2 programs called Msys and MinGW. Fortunatly these are packed into one program, so they should be really easy to get.
Therefore go to this site and download the most recent package. Unpack them to a place on your computer, but be aware; DO NOT place them in a path that contains spaces (Like C:\documents and settings). That will cause an error because of a bug.
Preparing for compile
Okay, when Msys and MinGW are placed in a valid folder then open the Msys terminal (~msysForXMoto\msys.bat). It should look like this:
It's from this terminal we'll compile later on. But first we need the most recent source code for X-Moto. To get this, we use the command
svn co svn://svn.tuxfamily.org/svnroot/xmoto/xmoto/trunk
This action will probably take some minutes. It will download the source code, and place it at ~\msysForXMoto\home\xmoto\trunk.
- Note that in Msys you do not paste with ctrl-v but with the middle mousebottom.
After the download is done, then we need to change directory so we are at the source code.
To this we use the command
cd trunk
You can run the command pwd to know where you are located
pwd
When you got that:
sh ./bootstrap or just bootstrap
That won't take a lot of time.
And when the bootstrap is done:
./configure
This will take some minutes. Be aware of that you maybe some errors, about missing .dll files. Just ignore them and press ok. It won't stop msys from configuring. Take a look at this section if you wan't to know more about the configure
Compile
After the configure comes the real compile. To do this we use the command:
make
This will take a lot of time if it's the first time that you compile X-Moto. “Make” will produce the xmoto.exe and place it at \msysForXMoto\home\xmoto\trunk\src\xmoto.exe.
There is only one command left now when the make is done:
strip src/xmoto.exe
This command will remove a lot of unnecessary debugging stuff and make the .exe files size smaller.
Now copy the compiled xmoto.exe in the directory of your normally installed X-Moto and replace it with the other xmoto.exe. For example in C:\program files\XMoto\xmoto.exe
Then Double-click and enjoy your own compiled xmoto!
Additional things to know
In this section can you find things that are nice to know about compiling X-Moto.
Updating your source code
Insted of downloading all sources codes each time you want to update your svn version, then use the command:
svn up
Then you'll only download updated files.
About using commands in Msys
After you update sources via svn up, or if you added or removed something in the source code, and you want to re-compile then you have simplyly to type the command :
make
It will rebuild only what is necessary. By the way, if you get an error, it's probably because a file called configure.in or Makefile.am has been modified. In this case, you've to type :
sh ./bootstrap ./config.status --recheck (or ./configure) make
Grep
Another smart thing msys can do, is to search in the source code after keywords. To do this we use the command grep.
it works like this: grep [How to look for it][What to look for][Where to look for it]
An example:
grep -i -n x-moto trunk/src/*.cpp
gives the output:
Try to write
grep --help
And figure out why we get that output!
More about configure
When you succed the configure, a sort of table comes as you may have noticed. That table tells if an option is enabled or not.
But it also show which commands you should use to enable a option. For example if you want xmoto to use the zoom option:
./configure --with-enable-zoom=1