<div dir="ltr"><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, 6 Nov 2021, 02:09 James Richters via fpc-pascal, <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="#0563C1" vlink="#954F72" style="word-wrap:break-word" lang="EN-US"><div><p class="MsoNormal">Do I need to use the source to re-install FPC every time I want to update it? <span> </span>If so how is this accomplished?<u></u><u></u></p><p class="MsoNormal">Or is there a better way to just update everything when I update the repository without re-installing it?</p></div></div></blockquote><div> </div></div><div dir="auto">To build the compiler, rtl and packages from newly updated source, call </div><div dir="auto"></div><div dir="auto">make clean all</div><div dir="auto"><br></div><div dir="auto">from the base folder of the source containing the compiler, rtl etc folders. This will produce a new compiler located in the compiler folder. It will be called something like ppcx64 (depends on your host architecture). Compiled units for rtl are located in rtl/units/$fpctarget and packages will sit under packages/*/units/$fpctarget.</div><div dir="auto"><br></div><div dir="auto">a) You can use this as is without installing, but then your config file needs to be updated with the relevant locations to units and utilities. Either call ppcx64 (or your target compiler) directly, or build the fpc frontend located in compiler/utils, then copy the resulting fpc executable into the compiler folder from where it can call the target specific executables. Since this folder layout is most likely different from the installed layout, use a different fpc.cfg file with paths updated according to the source structure.</div><div dir="auto"><br></div><div>b) You can install the new compiler (make install), which would typically overwrite the existing installed version. Or you can install to a custom location by specifying INSTALL_PREFIX=path/to/install/folder. You need the previous stable compiler to start the build process, so do not overwrite the installed version. This also requires a custom fpc.cfg, since the base folder will be different to the installed path.</div><div><br></div><div>For either of the options, call the compiler with the option -n to not load the default config file (which would point to the installed version, leading to unit version conflicts) and @/path/to/new/fpc.cfg so that the compiler can load the new config.<br></div><div dir="auto"><br></div><div>Notes</div><div>1. I'm using Linux conventions above, translate path separators and .exe extensions as required for Windows.</div><div>2. If the stable compiler is not in the path, add FPC=path/to/compiler/ppcx64 to the make commands.</div><div>3. There are many more permutations I'm sure, these are just the options I've managed to get working.</div><div><br></div><div>As Ryan mentioned, you have to frequently (if you want to stay up to date) update the source (git pull), then rebuild. So configuring your setup initially is key, after that it is relatively simple to stay up to date.<br></div><div><br></div><div>On a personal note, I got tangled up with config files and conflicts between old and new compiler versions in the past. When you run into strange compiler errors about not finding units, or invalid PPU versions or some such, take note of the paths used for the compiler, config file and the relevant units. My strategy was to never install fpc into the search path, always specify the path to the compiler executable and know when the compiler should ignore the default and load a specific config file for the particular compiler.</div><div><br></div><div>Alternatively use fpcupdeluxe, it has an option to checkout and build main. I haven't tested this much, since I'm comfortable with my workflow. There is an active thread on the Lazarus forum for fpcupdeluxe support.<br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>
</div>