This wiki is archived and useful information is being migrated to the main bzflag.org website
Difference between revisions of "Compiling"
(Add correct dependencies and mention that there may just happen to be other OSs then Linux.) |
(Apply proper wiki style and remove some lies.) |
||
Line 7: | Line 7: | ||
==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. | ||
+ | |||
+ | ==Compilers== | ||
+ | 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 OSX computers use the XCode compiler (or optionally gcc, see notes). OSX 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++=== | ||
+ | '''Compiler''' | ||
+ | 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/ http://www.microsoft.com/express/vc/] | ||
+ | |||
+ | ===GCC=== | ||
+ | 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 OSX the user can either run make to find any problems, or xcodebuild (after ./configure) to make an .app that is useable. | ||
+ | |||
+ | ===XCode=== | ||
+ | The XCode system uses the '''bzflag/BZFlag.xcodeproj''' project. | ||
+ | Steps to build; | ||
+ | |||
+ | * Select'''BZFlag''' as the active target. | ||
+ | * Select '''Development''' as the active build configuration. | ||
+ | * Click on '''Targets''' then click the '''Build''' icon. | ||
+ | |||
+ | When this process is complete, the application will be in '''bzflag/build/Development'''. The application can be run from any location. | ||
+ | |||
+ | ====Building on Snow Leopard==== | ||
+ | Snow Leopard defaults to 64-bit binaries, which isn't compatible with MacDisplay.cxx due to Carbon.framework not implementing a lot of functionality in 64-bit mode. To compile on Snow Leopard, the build must be 32-bit. | ||
==Dependencies== | ==Dependencies== | ||
Line 13: | Line 50: | ||
The following is a general dependency list for version 2.4. | The following is a general dependency list for version 2.4. | ||
− | ===Windows=== | + | ===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. | 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. | ||
Line 20: | Line 57: | ||
All other dependencies are included. | All other dependencies are included. | ||
− | ===Linux=== | + | ===Linux (GCC)=== |
====Required Libraries==== | ====Required Libraries==== | ||
* SDL development libraries (1.2.10 or greater) | * SDL development libraries (1.2.10 or greater) | ||
Line 39: | Line 76: | ||
* zlib development libraries | * zlib development libraries | ||
− | ===Macintosh OSX=== | + | ===Macintosh OSX (XCode or GCC)=== |
====Required Libraries==== | ====Required Libraries==== | ||
* SDL framework 1.2 (1.3 may not work on all versions of OSX) | * SDL framework 1.2 (1.3 may not work on all versions of OSX) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Other build systems=== | ===Other build systems=== | ||
− | Other build systems may be supported in the various readme files (minGW, IRIX, SOLARIS,etc..) | + | Other build systems may be supported in the various readme files (minGW, IRIX, SOLARIS,etc..) see[[Solaris Notes]] for more info. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
[[Category:Development]] | [[Category:Development]] | ||
[[Category:Compiling]] | [[Category:Compiling]] | ||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Revision as of 02:58, 13 May 2012
Overview
Compiling BZFlag is the act of building executable applications for a target system using the raw source code. This is usually not necessary to install the game.
Obtaining sources
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 the BZFlag Subversion server.
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.
Compilers
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 OSX computers use the XCode compiler (or optionally gcc, see notes). OSX 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++
Compiler 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
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 OSX the user can either run make to find any problems, or xcodebuild (after ./configure) to make an .app that is useable.
XCode
The XCode system uses the bzflag/BZFlag.xcodeproj project. Steps to build;
- SelectBZFlag as the active target.
- Select Development as the active build configuration.
- Click on Targets then click the Build icon.
When this process is complete, the application will be in bzflag/build/Development. The application can be run from any location.
Building on Snow Leopard
Snow Leopard defaults to 64-bit binaries, which isn't compatible with MacDisplay.cxx due to Carbon.framework not implementing a lot of functionality in 64-bit mode. To compile on Snow Leopard, the build must be 32-bit.
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
Required Libraries
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 OSX (XCode or GCC)
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..) seeSolaris Notes for more info.