]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Compiling_In_Windows.textile
(Commit created by redmine exporter script from page "Compiling_In_Windows" version 1)
[xonotic/xonotic.wiki.git] / Compiling_In_Windows.textile
1 h1. Compiling In Windows
2
3 {{>toc}}
4
5 This is an updated version of the outdated [[Outdated Compiling in Windows|Compiling in Windows]] page. There are no more automated tools in this version of the guide.
6
7 You will need about 10 gigabytes of disk space to keep the sources (the uncompressed texture files are quite large and git keeps a backup copy, doubling the actual size of the sources).
8
9 h2. Step 1: installing the prerequisites
10
11 To compile and run Xonotic in Windows, you will need to download the following. Do not install anything yet, this is covered in the next section.
12 * The latest version of "MinGW":http://sourceforge.net/projects/mingw/files/. At the time of writing this guide, mingw provides an installer (mingw-get-inst). More up-to-date information on how to get MinGW can be found on http://mingw.org
13 * "msysgit":https://code.google.com/p/msysgit/downloads/list. Make sure you get the latest *full installer for official Git* (not the self-contained packages). At the time of writing this, the latest installer is called Git-1.7.11-preview20120710.exe.
14
15 h3. Installing MinGW
16
17 These instructions apply to mingw-get-inst. Run the installer. When setting up the path, if you do not pick the default, make at least sure that the installation path you choose contains no space in it. Thus, Program Files is out of question.
18
19 When you reach the "select components" section, you need to check "MSYS Basic System" (*not* "MinGW Developer Toolkit"). You will also need the C compiler, which should be selected by default.
20
21 When the setup is complete, you will get a "MinGW Shell" in your start menu. This is a Unix-like shell that you will soon use to manage and compile the Xonotic source files. It will also be used to launch the game.
22
23 h3. Installing msysgit
24
25 Run the installer. At the component selection screen ([[attachment:git-1-components.png|screenshot]]), uncheck the "Associate .sh files" option. Windows Explorer Integration can also optionnally be unselected -- it is only useful if you plan on contributing and do not like using git purely from the command line to do so. When you get to the PATH adjusting screen ([[attachment:git-2-path.png|screenshot]]), you need to select the second option (Run Git from the Windows Command Prompt). This ensures that git can be run from the MinGW shell, as we will not use the shell that comes with msysgit for this. Finally, in the line ending screen ([[attachment:git-3-crlf.png|screenshot]]), keep the first option selected unless you know what you're doing.
26
27 h3. Installing the dependencies in MinGW
28
29 Xonotic requires a few more packages in MinGW that are not provided by default. Installing them is quite simple, just open a MinGW Shell and type the following line:
30 <pre>
31 mingw-get install msys-wget msys-unzip mingw32-libiconv mingw32-libintl msys-libopenssl
32 </pre>
33 You can paste text in the shell by right-clicking the title bar and selecting _Edit_ > _Paste_. But be careful with this, mistakes can happen!
34
35 To close a MinGW Shell, just type
36 <pre>exit</pre> But keep this one open, we're going to use it some more.
37
38 To close a MinGW Shell, just type
39 <pre>
40 exit
41 </pre>But keep this one open, we're going to use it some more.
42
43
44 h2. Step 2: downloading the Xonotic source files
45
46 In this step, we will clone the Xonotic git repositories inside MinGW's install directory.
47
48 In your MinGW Shell, type
49 <pre>
50 git clone git://git.xonotic.org/xonotic/xonotic.git
51 </pre>This will clone the base repository, which contains a script called "@all@" that will manage the subrepositories. I will call this script @./all@ to avoid confusion, as this is how we will be using it in the terminal.
52
53 Next, type
54 <pre>
55 cd xonotic
56 ./all update -l best
57 </pre>The @cd@ line tells the Shell to go inside the @xonotic@ directory, where @./all@ is located. In the second line, the @-l best@ part asks @./all@ to pick the best available mirror. This step will dowload several gigabytes of data, so expect it to take a while.
58
59
60 h2. Step 3: compiling
61
62 Compiling the game is quite simple. In your MinGW Shell, just type
63 <pre>
64 ./all compile
65 </pre>
66
67 This will compile fteqcc (which is a compiler for the QuakeC language), then the game code using fteqcc, then the DarkPlaces engine.
68
69 This step can take a few minutes, so be patient! When it's over, check the last few lines to see if it reports any errors.
70
71
72 h2. Step 4: running the game!
73
74 To run the game, you have to use @./all@ again:
75 <pre>
76 ./all run
77 </pre>
78
79 If you ever need to start the game in windowed mode, you can launch it this way:
80 <pre>
81 ./all run +vid_fullscreen 0
82 </pre>
83
84 By default, @./all@ uses the SDL build (called @xonotic-sdl.exe@ in releases). You can use the WGL build (@xonotic.exe@) like this:
85 <pre>
86 ./all run wgl
87 </pre>
88
89 You will always need to use @./all@ to launch the game. Do not forget that you need to be in the @xonotic@ directory when you use the @./all@ command. That means you have to type
90 <pre>
91 cd xonotic
92 </pre>when you start a MinGW Shell before updating, compiling, or running Xonotic.
93
94
95 h2. Keeping up to date
96
97 To keep up to date, all you need to do is repeat some of the steps above. More precisely, here is what you will usually type in a new MinGW Shell to update Xonotic to the latest git revision:
98 <pre>
99 cd xonotic
100 ./all update
101 ./all compile
102 </pre>You can optionally use this as the third line if the compilation does not work:
103 <pre>
104 ./all compile -c
105 </pre>This will remove the partially compiled files from the previous compiles. It has been known to resolve some errors before, but it can take a little longer to recompile everything.
106
107
108 h2. Getting help
109
110 You can always ask for help in the "Xonotic forums":http://forums.xonotic.org, under the Help and Support section.