This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Compiling"

From BZFlagWiki
Jump to: navigation, search
m (Source Code)
m (Obtaining sources: fixed links)
 
(39 intermediate revisions by 14 users not shown)
Line 1: Line 1:
 
==Overview==
 
==Overview==
Compiling BZFlag is the act of taking the raw source codes for the game and using tools to build an executable application(s) for a target system.
+
Compiling BZFlag is the act of building executable applications for a target system using the raw source code..
  
==Source Code==
+
==Obtaining sources==
In order to compile a user must have his or her own copy of the [[BZFlag_Source|Source Code]]. The code can be obtained from a source archive from the [[Download]] page, or from the [[BZFlag_SVN]] server.
+
In order to compile a user must have his or her own copy of the [[BZFlag Source|Source Code]]. The code can be obtained from a source archive from the [http://bzflag.org/downloads download] page, or from [[BZFlag Git|Git]].
  
==Readme Files==
+
==README files==
 
Users should always read the README files for the appropriate operating system. These files are located in the root directory of the source code tree.
 
Users should always read the README files for the appropriate operating system. These files are located in the root directory of the source code tree.
  
Line 11: Line 11:
 
BZFlag is capable of being built on a number of compilers. The compiler used will depend in some way on the operating system of the computer doing the build.
 
BZFlag is capable of being built on a number of compilers. The compiler used will depend in some way on the operating system of the computer doing the build.
  
Linux computers, use the GCC compiler.
+
* Windows computers can use the Visual C++ compiler, or the MinGW compiler (based on GCC). Windows is the most popular client OS and nearly all clients are built with the Visual C++ compiler, including the official binaries.
Macintosh Computers use the XCode compiler
+
* Macintosh OS X computers use the Xcode compiler (or optionally gcc, see notes). OS X is the second most popular client OS, official builds are built with Xcode, not GCC.
Windows Computers can use the Visual C++ compiler, or the MinGW compiler (based on GCC)
+
* Linux and BSD computers use the GCC compiler. Linux is the third most common client OS and packages for distributions are built using GCC.
  
===GCC===
+
===Visual C++===
The GCC build as a number of requirements;
+
The most common way to build on windows to to use the Visual C++ 2010 compiler (Both Express and Retail versions are supported).
* Automake X.XX
+
The current free Express version of Visual C++ can be found at [http://www.microsoft.com/express/vc/ http://www.microsoft.com/express/vc/]
* Autoconf X.XX
+
* Autotools X.XX
+
* SDL Development libraries 1.2.10 or greater
+
* OpenGL Development libraries 1.1 or greater
+
  
 +
===GCC===
 
If the required dependencies are installed, the user must then run the following commands from at root level of the source tree
 
If the required dependencies are installed, the user must then run the following commands from at root level of the source tree
  
 
   ./autogen.sh
 
   ./autogen.sh
 
   ./configure
 
   ./configure
   ./make
+
   make
   ./make install
+
   make install
  
Please note that depending on permissions levels the '''make install''' command may need to be run as an administrator or root.
+
Please note that depending on permissions levels the '''make install''' command may need to be run as an administrator or root. On Macintosh OS X, do not run make install when building with GCC. Run the program from the source directory or install it manually as desired instead.
  
===XCode===
+
===Xcode===
Click and be happy ( someone fill this in with real info that is correct ).
+
The Xcode system uses the  '''Xcode/BZFlag.xcodeproj''' project. Building is fairly straightforward. Follow the instructions in the README.MacOSX file.
  
===Visual C++===
+
==Dependencies==
 +
In order to compile BZFlag, some third party libraries may be required depending on the operating system being built for. The readme file for each OS will contain the current dependencies for each OS and should be consulted before attempting any build.
 +
 
 +
The following is a general dependency list for version 2.4.
 +
 
 +
===Windows (Visual Studio)===
 +
The only third party dependency required to build the client is the DirectX SDK that is available from Microsoft. A download is available at http://www.microsoft.com/en-us/download/details.aspx?id=6812.
 +
 
 +
If a user wishes to build a full set of windows installers, they will need to install the NSIS installer system, available from http://nsis.sourceforge.net.
 +
 
 +
All other dependencies are included.
 +
 
 +
===Linux (GCC)===
 +
====Required Libraries====
 +
* SDL development libraries (1.2.10 or greater)
 +
* SDL-sound development libraries (1.2.10 or greater)
 +
* libtool
 +
* automake
 +
* autoconf
 +
* g++
 +
* mesa development libraries (gl, and glu)
 +
* mesa development libraries
  
==== 2.0.x ====
+
====Optional Libraries====
 +
These libraries are included with the source tree but users may have better results using ones included with a Linux distribution.
  
==== 2.99.x =====
+
* curl development libraries
 +
* c-ares development libraries
 +
* glew development libraries
 +
* zlib development libraries
  
===Other build systems===
+
===Macintosh OS X (Xcode or GCC)===
Other build systems may be supported in the various readme files (minGW, IRIX, SOLARIS,etc..)
+
====Required Libraries====
 +
* SDL framework 1.2 (1.3 may not work on all versions of OSX)
  
 +
==Other build systems==
 +
Other build systems may be supported in the various readme files (minGW, IRIX, SOLARIS,etc..) see the [[Compiling/Solaris_Notes]] page for more info.
  
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Compiling]]
 
[[Category:Compiling]]
 +
[[Category:Tutorials]]

Latest revision as of 01:44, 22 November 2016

Overview[edit]

Compiling BZFlag is the act of building executable applications for a target system using the raw source code..

Obtaining sources[edit]

In order to compile a user must have his or her own copy of the Source Code. The code can be obtained from a source archive from the download page, or from Git.

README files[edit]

Users should always read the README files for the appropriate operating system. These files are located in the root directory of the source code tree.

Compilers[edit]

BZFlag is capable of being built on a number of compilers. The compiler used will depend in some way on the operating system of the computer doing the build.

  • Windows computers can use the Visual C++ compiler, or the MinGW compiler (based on GCC). Windows is the most popular client OS and nearly all clients are built with the Visual C++ compiler, including the official binaries.
  • Macintosh OS X computers use the Xcode compiler (or optionally gcc, see notes). OS X is the second most popular client OS, official builds are built with Xcode, not GCC.
  • Linux and BSD computers use the GCC compiler. Linux is the third most common client OS and packages for distributions are built using GCC.

Visual C++[edit]

The most common way to build on windows to to use the Visual C++ 2010 compiler (Both Express and Retail versions are supported). The current free Express version of Visual C++ can be found at http://www.microsoft.com/express/vc/

GCC[edit]

If the required dependencies are installed, the user must then run the following commands from at root level of the source tree

 ./autogen.sh
 ./configure
 make
 make install

Please note that depending on permissions levels the make install command may need to be run as an administrator or root. On Macintosh OS X, do not run make install when building with GCC. Run the program from the source directory or install it manually as desired instead.

Xcode[edit]

The Xcode system uses the Xcode/BZFlag.xcodeproj project. Building is fairly straightforward. Follow the instructions in the README.MacOSX file.

Dependencies[edit]

In order to compile BZFlag, some third party libraries may be required depending on the operating system being built for. The readme file for each OS will contain the current dependencies for each OS and should be consulted before attempting any build.

The following is a general dependency list for version 2.4.

Windows (Visual Studio)[edit]

The only third party dependency required to build the client is the DirectX SDK that is available from Microsoft. A download is available at http://www.microsoft.com/en-us/download/details.aspx?id=6812.

If a user wishes to build a full set of windows installers, they will need to install the NSIS installer system, available from http://nsis.sourceforge.net.

All other dependencies are included.

Linux (GCC)[edit]

Required Libraries[edit]

  • SDL development libraries (1.2.10 or greater)
  • SDL-sound development libraries (1.2.10 or greater)
  • libtool
  • automake
  • autoconf
  • g++
  • mesa development libraries (gl, and glu)
  • mesa development libraries

Optional Libraries[edit]

These libraries are included with the source tree but users may have better results using ones included with a Linux distribution.

  • curl development libraries
  • c-ares development libraries
  • glew development libraries
  • zlib development libraries

Macintosh OS X (Xcode or GCC)[edit]

Required Libraries[edit]

  • SDL framework 1.2 (1.3 may not work on all versions of OSX)

Other build systems[edit]

Other build systems may be supported in the various readme files (minGW, IRIX, SOLARIS,etc..) see the Compiling/Solaris_Notes page for more info.