13,212
edits
mNo edit summary |
(cat: Core developer documentation; Spelling; Headings; Copy editing) |
||
Line 1: | Line 1: | ||
download_and_compile.sh can build either the next/master branch, or the stable version of | download_and_compile.sh can build either the next/master branch, or the stable version of FlightGear. | ||
When building different versions of | When building different versions of FlightGear, its important to note that each version has its own version of fgdata, and FlightGear will check the version to ensure it is compatible. | ||
Since fgdata is so large, it makes sense to download the whole thing only once. You can keep versions of it separately from the install tree that download_and_compile.sh creates and create symbolic links to them before using the script. That way when you decide to rebuild from scratch, at least the fgdata will remain. | Since fgdata is so large, it makes sense to download the whole thing only once. You can keep versions of it separately from the install tree that download_and_compile.sh creates and create symbolic links to them before using the script. That way when you decide to rebuild from scratch, at least the fgdata will remain. | ||
The instructions below tell how to do this for existing or new uses of download_and_compile.sh. The | The instructions below tell how to do this for existing or new uses of download_and_compile.sh. The technical details are not dependent on where you put your builds. You can use the directory scheme I use or your own existing scheme. | ||
The concept as a whole works great. I've been using it for months. The instructions are a work in progress and have yet to be fully tested. | The concept as a whole works great. I've been using it for months. The instructions are a work in progress and have yet to be fully tested. | ||
== The main ideas == | |||
* | * You may only need one copy of each version of fgdata you are working with | ||
* fgdata normally lives as a sub-directory in install/fgfs/ | * fgdata normally lives as a sub-directory in install/fgfs/ | ||
* | * Once it exists, install/fgdata can moved and replaced by a symbolic link to fgdata's real directory location | ||
== Technical Points and command examples == | |||
* <code>mkdir -p install/fgfs</code> will create the install directory and subdirectory if either does not yet exist | |||
* <code>mv</code> can move a directory | |||
* <code>cp -R</code> will copy a directory recursively. | |||
* <code>ln -s targetname linkname</code> creates linkname as a symbolic link to the target. The target may or may not yet exist and that's normally ok. Not in this case, because of the way we create the directory with git. | |||
* The symbolic link must be created <b>after</b> downloading | |||
* Important: You can move the FlightGear source directories and download_and_compile.sh to different folders at will. Git will not care. All the git specific files move right along with the sources. Its the same for SVN. However, the same does not hold true for the files created during a build by cmake. The build and install folders cannot be moved because the files in them have hard coded paths in some cases. They'll need to be deleted and rebuilt. | |||
== Background info == | |||
I do my builds of different versions and options in separate sub-directories under ~/work/fg. Sometimes I'll create an extra tree for debugging purposes. I don't want to have to copy all of fgdata just to do the work on a debug version. I also copy the sources for the various components to avoid re downloading those as well. In download_and_compile.sh, Git takes care of any changes needed to switch to between master and stable as needed. | I do my builds of different versions and options in separate sub-directories under ~/work/fg. Sometimes I'll create an extra tree for debugging purposes. I don't want to have to copy all of fgdata just to do the work on a debug version. I also copy the sources for the various components to avoid re downloading those as well. In download_and_compile.sh, Git takes care of any changes needed to switch to between master and stable as needed. | ||
== Here's how I handle fgdata... == | |||
Normally fgdata lands in install/fgfs. | Normally fgdata lands in install/fgfs. | ||
I've moved my 2.10.0 and 2.11.0 fgdata versions and replaced them with symbolic links to the new location as needed. | I've moved my 2.10.0 and 2.11.0 fgdata versions and replaced them with symbolic links to the new location as needed. | ||
Its as simple as that. | Its as simple as that. | ||
== Detailed directions == | |||
In short the steps are: | |||
# Create a directory for each version of fgdata you are going to use | |||
# Create a directory for each version or variation of FlightGear you want to build | |||
# Do you first build of FlightGear | |||
# Retrofit previous use of download_and_compile.sh | |||
# Prepare to build another version | |||
# Building with options | |||
=== | === Create a directory for each version of fgdata you are going to use === | ||
<code> | <code> | ||
mkdir -p ~/work/fg/fgdata_2.10.0 | mkdir -p ~/work/fg/fgdata_2.10.0 | ||
Line 42: | Line 46: | ||
Eventually a particular version of fgdata will be in each | Eventually a particular version of fgdata will be in each | ||
=== | === Create a directory for each version or variation of FlightGear you want to build === | ||
download_and_compile.sh will be run from these directories | download_and_compile.sh will be run from these directories | ||
Line 56: | Line 59: | ||
Note that I never build at the ~/work/fg level. download_and_compile.sh is always run from a sub-directory | Note that I never build at the ~/work/fg level. download_and_compile.sh is always run from a sub-directory | ||
=== | === Do you first build of flightgear === | ||
You can skip this step if you've already done one. | You can skip this step if you've already done one. | ||
Line 69: | Line 71: | ||
~/work/fg/master/install/fgfs/fgdata | ~/work/fg/master/install/fgfs/fgdata | ||
=== | === Retrofit previous use of download_and_compile.sh === | ||
Download_and_compile.sh placed the fgdata directory in the install/fgfs directory. | Download_and_compile.sh placed the fgdata directory in the install/fgfs directory. | ||
Line 88: | Line 89: | ||
</code> | </code> | ||
=== Prepare to build another version === | |||
=== | |||
In step 1, we created a spot for two fgdata versions. So far only one is actually there, fgdata_2.11.0/fgdata. Lets fix that so we don't have to download another copy for 2.10.0 | In step 1, we created a spot for two fgdata versions. So far only one is actually there, fgdata_2.11.0/fgdata. Lets fix that so we don't have to download another copy for 2.10.0 | ||
<code> | <code> | ||
Line 114: | Line 113: | ||
mkdir -p /installfgfs | mkdir -p /installfgfs | ||
ln -s ~/work/fg/fgdata/2.8.0 install/fgfs | ln -s ~/work/fg/fgdata/2.8.0 install/fgfs | ||
ls -lah install/fgfs/fgdata # show the symlink to fgdata | ls -lah install/fgfs/fgdata # show the symlink to fgdata | ||
ls install/fgfs/fgdata # make sure there's something there. | ls install/fgfs/fgdata # make sure there's something there. | ||
</code> | </code> | ||
Now you can build stable | Now you can build stable | ||
Line 122: | Line 121: | ||
</code> | </code> | ||
=== | === Building with options === | ||
You can use download_and_compile to build master or stable with various options such as -i for openrti or -g to build a debug version. | You can use download_and_compile to build master or stable with various options such as -i for openrti or -g to build a debug version. | ||
Line 139: | Line 137: | ||
You have choices. You can use the options in ~/work/fg/stable and ~/work/fg/master, or you can do things in separate directories. Whatever suits your purpose. | You have choices. You can use the options in ~/work/fg/stable and ~/work/fg/master, or you can do things in separate directories. Whatever suits your purpose. | ||
[[Category:Core developer documentation]] |