[fpc-pascal] installing or using multiple versions of FPC on linux

Lloyd Park lloyd.b.park at gmail.com
Mon Jul 26 18:07:56 CEST 2010


I use symbolic links.  I created /opt/fpc directory which contains subdirectories for each version I have available.  /opt/fpc/fpc-current is a symbolic link to the directory of the version of fpc I am currently using.  /opt/fpc/bin is a symbolic link to /opt/fpc/fpc-current/bin.  In order to switch versions I just need to modify the /opt/fpc/fpc-current link.

My fpc.cfg file has unit/library/include references similar to this:  -Fu/opt/k-/fpc/fpc-current/lib/fpc/$fpcversion/units/$fpctarget
So it works with any version I install.

Here are the ugly notes I made when I set it up on my development box:

   - First time retrieve from Subversion
      cd /opt/fpc
      - Stable branch
         svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_2 fpc
      - Development branch (v2.1.1)
         svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc
      mv fpc fpc-<version>-svn
      rm fpc-source
      ln -s fpc-<version>-svn fpc-source

   - Update the source from Subversion
      cd /opt/fpc/fpc-<version>-svn
      svn update

   - Complile
      cd /opt/fpc/fpc-<version>-svn
      make OPT='-gl' zipinstall

   Install the new zip
      cd /opt/fpc
      rm fpc-current
      mkdir v<version>.<date>
      ln -s v<version>.<date> fpc-current
      cd fpc-current
      tar -zxvf ../fpc-source/fpc-<version>.<cpu>-<arch>.tar.gz
      cd bin
      ln -s ../lib/fpc/<version>/ppc386 .


Lloyd B. Park
lloyd.b.park at gmail.com


On Jul 26, 2010, at 8:18 AM, Bernd Kreuss wrote:

> Currently I have the latest svn of FPC installed (make install) which
> results in all files being installed where they belong, the binary being
> in the search path and fpc.cfg in /etc and I can easily use it with Lazarus.
> 
> Now I want to test something I wrote whether it will compile with an
> older version of FPC and I even need to recompile the entire Lazarus
> with the older FPC because it is a patch for Lazarus itself.
> 
> What is the easiest way to have a second installation of FPC around that
> I can easily switch to on the same machine without having to change half
> a dozen paths and moving config files around?
> 
> I have thought about switching compilers system-wide by simply having
> two compiled versions in two separate directories lying around and then
> simply "make install" in one of them or in the other one to switch
> between them. Does this make sense or is there a better (recommended)
> way of doing this?
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100726/23fed0bb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.jpg
Type: image/jpeg
Size: 3472 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100726/23fed0bb/attachment.jpg>


More information about the fpc-pascal mailing list