Difference between revisions of "Fs2 open on Linux/Pre-Compile Configuration"

From FreeSpace Wiki
Jump to: navigation, search
m
(Updated tip for FreeBSD users)
 
(6 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
BookName=[[The fs2_open on Linux Guide]]|
 
BookName=[[The fs2_open on Linux Guide]]|
 
CurrentPage=Pre-Compile Configuration|Pre-Compile Configuration|
 
CurrentPage=Pre-Compile Configuration|Pre-Compile Configuration|
PrevPage=[[Fs2_open on Linux/Checkout Script|Checkout Script]]|
+
PrevPage=[[Fs2 open on Linux/Acquiring the Code|Acquiring the Code]]|
 
NextPage=[[Fs2_open on Linux/Optimization|Optimization]]}}
 
NextPage=[[Fs2_open on Linux/Optimization|Optimization]]}}
 
<p></p>
 
<p></p>
 
{{Note| This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary executable.}}
 
{{Note| This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary executable.}}
Before you compile you need to configure it for your system. In the directory you ran the CVS command from, a new directory has appear, namely fs2_open.
+
Before you compile you need to configure it for your system. In the directory you ran the Git command from, a new directory has appear, namely fs2_open.
 
If your fs2_open is a completely new checkout, you will first need to run the autogen.sh script.
 
If your fs2_open is a completely new checkout, you will first need to run the autogen.sh script.
 
Run from inside your newly created fs2_open directory:
 
Run from inside your newly created fs2_open directory:
Line 15: Line 15:
 
A full list of configure options can be found by running the configure script with the '--help' option.
 
A full list of configure options can be found by running the configure script with the '--help' option.
 
  $ ./configure --help
 
  $ ./configure --help
 +
 +
If you have gcc and clang installed on FreeBSD, it may try to use gcc and fail to compile.  To remedy this, set CC and CXX before configuring as so:
 +
$ setenv CC clang; setenv CXX clang++; ./autogen.sh
 +
 +
Note: if you have multiple versions of a dependency installed, and FSO is picking the wrong one, AND it's causing a compile issue, you should be able to select the correct version of the library with something like this: (specific example is given for lua5.1 (good) vs lua5.2 (causes problems) - thanks to ZekeS for this advice
 +
$ LDFLAGS="-l:liblua.so.5.1 $LDFLAGS" CXXFLAGS="-I/usr/include/lua5.1 $CXXFLAGS" ./autogen.sh
 +
 +
If you end up doing this, let a member of the SCP know about it so that configure.ac can be updated to exclude the incompatible version of the library.
  
 
[[Category:FreeSpace Open on Linux|Pre-Compile Configuration]]
 
[[Category:FreeSpace Open on Linux|Pre-Compile Configuration]]

Latest revision as of 16:51, 26 January 2016

« Acquiring the Code The fs2_open on Linux Guide
Pre-Compile Configuration
Optimization »

Note: This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary executable.

Before you compile you need to configure it for your system. In the directory you ran the Git command from, a new directory has appear, namely fs2_open. If your fs2_open is a completely new checkout, you will first need to run the autogen.sh script. Run from inside your newly created fs2_open directory:

$ ./autogen.sh

autogen.sh is a script that will generate the required makefiles. You will see alot of "checking for this" and "checking for that", this is actually the "configure" script (which can be run with ./configure if you need to change the options) examining and configuring fs2_open for your system.
It is possible to give autogen.sh configure options as well, autogen.sh will pass them along to configure.

A full list of configure options can be found by running the configure script with the '--help' option.

$ ./configure --help

If you have gcc and clang installed on FreeBSD, it may try to use gcc and fail to compile. To remedy this, set CC and CXX before configuring as so:

$ setenv CC clang; setenv CXX clang++; ./autogen.sh

Note: if you have multiple versions of a dependency installed, and FSO is picking the wrong one, AND it's causing a compile issue, you should be able to select the correct version of the library with something like this: (specific example is given for lua5.1 (good) vs lua5.2 (causes problems) - thanks to ZekeS for this advice

$ LDFLAGS="-l:liblua.so.5.1 $LDFLAGS" CXXFLAGS="-I/usr/include/lua5.1 $CXXFLAGS" ./autogen.sh

If you end up doing this, let a member of the SCP know about it so that configure.ac can be updated to exclude the incompatible version of the library.