Difference between revisions of "Compiling"

From BZFlagWiki
Jump to: navigation, search
(Other build systems: redirect Solaris uses to the Solaris notes page.)
(Updated the instructions for Mac OS X and removed some outdated information.)
Line 12: Line 12:
  
 
* 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.
 
* 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.
+
* 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.
 
* 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++===
 
===Visual C++===
Line 28: Line 27:
 
   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.
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====
+
===Xcode===
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.
+
The Xcode system uses the  '''Xcode/BZFlag.xcodeproj''' project. Building is fairly straightforward. Follow the instructions in the README.MacOSX file.
  
 
==Dependencies==
 
==Dependencies==
Line 75: Line 63:
 
* zlib development libraries
 
* zlib development libraries
  
===Macintosh OSX (XCode or GCC)===
+
===Macintosh OS X (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)

Revision as of 02:03, 30 January 2013

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 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++

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 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

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

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 OS X (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..) see the Compiling/Solaris_Notes page for more info.