Howto:Build and run FlightGear on Raspberry Pi 4: Difference between revisions

Jump to navigation Jump to search
Line 326: Line 326:
It updates fgdata between the building of SimGear and FlightGear so that the translations
It updates fgdata between the building of SimGear and FlightGear so that the translations
tool can be handled properly..."
tool can be handled properly..."
===Patching===
There could come a time when the source needs to be patched before compiling. In this case the <code>patch</code> command can be used along with it's argument <code>-p</code>. For example; the OpenSceneGraph-3.4.0 requires the '0007-Explicit-signed-char-type-for-portability-base64.patch' patch, in order for it to compile for the ARM architecture.
The argument ,<code>-p</code> adjusts the path of the patch. Below is an example of a snippet from a patch. You will need to navigate the terminal into the root folder of OpenSceneGraph-3.4.0 source. Reference the line ,<code>--- openscenegraph-3.4.orig/src/osgDB/ConvertBase64.cpp</code>. The folder <code>openscenegraph-3.4.orig/</code> can not be used, in our example. In this case, one of the path folders need to be ignored, hence <code>-p1</code>. If two path folders needed to be ignored; <code>-p2</code>.
<syntaxhighlight>Index: openscenegraph-3.4/src/osgDB/ConvertBase64.cpp
===================================================================
--- openscenegraph-3.4.orig/src/osgDB/ConvertBase64.cpp
+++ openscenegraph-3.4/src/osgDB/ConvertBase64.cpp
@@ -28,7 +28,7 @@ namespace osgDB
    int base64_decode_value(char value_in)
    {
-        static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
+        static const signed char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
        static const char decoding_size = sizeof(decoding);
        value_in -= 43;
        if (value_in < 0 || value_in > decoding_size) return -1;</syntaxhighlight>


===PLIB===
===PLIB===
320

edits

Navigation menu