Forum > Beginners

making 2.7 compiler with 2.6.4 release

(1/2) > >>

pm:
Hi, I am very interested in testing non-gui Free Pascal with UTF16 UnicodeStrings.  I think I need to use the v2.7 svn branch of the compiler -- which is okay -- but I am struck finding current instructions for making it.

I have 2.6.4 release installed. 
I have the 2.7 svn files.

I have lots of experience with Delphi 1.0 through XE5 and none with the 'make' process used by FPC.

I read about a flag that could be used to toggle the definition of 'string' between Ansi and Unicode. Is that already obsolete in 2.6.4?  I saw compiler messages about it being depecated or ignored or something like that.

Some guidance would be very much appreciated.

-Ann

marcov:
Have a look at  http://www.stack.nl/~marcov/buildfaq.pdf.

But more importantly, will 2.7.x deliver what you expect? Since it is not copy and paste and recompile D2009, just the early beginnings.

Currently trunk (2.7.x) adds to 2.6.x:


* the ansistring type now also supports multiple encodings like D2009+
* The support for unicodestring is slightly more evolved.
* Most routines in system and sysutils that deal with files and directories now accept unicodestring (and on Windows call the "-W" calls).
* a mode delphunicode exists where string=unicodestring
* unit Windows now has the -W variants default
Most notably NOT done:


* rework classes unit (and everything that depends on it, which is nearly everything that uses classes in general) to work with unicodestring default

kapibara:
I produced this a while ago. Its laz/fpc installation in general.
If you can follow, then after that probably anything goes.
No one has proof read it yet though, but that might happen now.  ;)

We will recompile Lazarus sources with FPC 2.7.1 and also
use FPC 2.7.1 to build all applications that Lazarus produces.

To smoothly get updated versions of Lazarus and FPC you should
have a SVN client installed. I use Tortoise.

[1] Get Tortoise: http://tortoisesvn.net/downloads.html
     Install with COMMANDLINE TOOLS option checked so
     Lazarus AboutBox will show the correct SVN number.

[2] You need the release version of fpc to build the development
    versions of fpc. For 64 bit versions of fpc, the is no official
    release. But Lazarus 64bit provides such a 64 bit fpc version.

    Install latest official Lazarus version to c:\lazarus\release
    http://www.lazarus.freepascal.org/index.php?page=downloads
    Before you start Lazarus, edit the shortcut:
    c:\lazarus\release\startlazarus.exe --pcp=c:\lazarus\release\configdir
    That means the settings will be isolated from other Lazarus installations.

[3] Install the source for FPC 2.71 by doing a Tortoise SVN Checkout:
    http://svn.freepascal.org/svn/fpc/trunk
    I suggest 'c:\fpc\trunk' as source directory. Rightclick it in the
    explorer and do Checkout with Tortoise. Choose the head version.
    All FPC sources will be downloaded to this directory.

[4] Now build fpc 2.7.1 using the fpc 2.6.2 binaries from Lazarus.
    Start a commandprompt at c:\fpc\trunk and issue these commands:

    PATH=c:\lazarus\release\fpc\2.6.2\bin\x86_64-win64\
    SET FPC=c:\lazarus\release\fpc\2.6.2\bin\x86_64-win64\fpc.exe
    make all
    make install INSTALL_PREFIX=C:\fpc\2.7.1

    (INSTALL_PREFIX represents the TARGET path for the
     newly compiled version)

    Whatever you have in your system path doesnt matter since you
    set your own temporary path from the prompt. Later we'll change
    the system path permanently.

    Exit/Close this commandprompt after make has finished!
    Dont reuse it because the path will point to wrong fpc version.

    When MAKE finishes you will have a new directory: C:\fpc\2.7.1
    with the fpc 2.7.1 binaries in it. Because Lazarus uses the
    source files from fpc, you need to put a copy of \packages and
    \rtl directories and their content in the c:\fpc\2.7.1 directory.

    (If you dont do that you cant update the trunk version without
    affecting the current 2.7.1 fpc installation. Because when you
    update the trunk you will get some new sourcefiles and they will of
    course not match the binaries of your old installation without
    a recompile. So just copy packages and rtl. This way you can update
    the trunk fpc and install other versions of fpc in new dirs following
    the steps above).

    Since this is a fresh install of fpc, you have no fpc.cfg.
    Copy c:\lazarus\release\fpc\2.6.2\bin\x86_64-win64\fpc.cfg to
    c:\fpc\2.7.1\bin\x86_64-win64 and edit the paths. Lines starting
    with # means they are commented out. Just leave such lines as they
    are.

    If a line looks like this:
    -Fuc:\lazarus\release\fpc\$FPCVERSION/units/$fpctarget

    You should change it to:
    -Fuc:\fpc\2.7.1\$FPCVERSION/units/$fpctarget

    Or use fpcmkcfg to create fpc.cfg:
    fpcmkcfg -d basepath=c:\fpc\2.7.1 -o c:\fpc\2.7.1\bin\x86_64-win64\fpc.cfg

    (The first dir is the path that will be used for the content of the config file, the second
      dir is what directory to put the resulting fpc.cfg in)

    We are actually done with fpc 2.6.2 for now!
    But dont delete the release version of Lazarus or the
    2.6.2 fpc that comes with it because you always need it
    to recompile new fpc versions with it. New SVN versions
    must always be compiled with the release version of fpc.
    Plus Lazarus release can use it.

    Now Add c:\fpc\2.7.1\bin\x86_64-win64 to your system PATH:
    * In Explorer, Rightclick Computer: choose Properties.
    * Choose Advanced system settings
    * Click the Environment Variables button
    * In System Variables Listbox, scroll down to the Path variable
    and doubleclick it. Add c:\fpc\2.7.1\bin\x86_64-win64; at the
    BEGINNING of the line, before everything else and dont forget the
    semicolon.

    Now REBOOT! Yes. Otherwise there can be a mismatch between release version
    of fpc and the freshly compiled fpc.

[5] Install the source for the Lazarus development version by doing a
    Tortoise SVN Checkout: http://svn.freepascal.org/svn/lazarus/trunk

[6] Build Lazarus. From a NEW commandprompt, go to c:\lazarus\LazSVN and run:
    make clean bigide

[7] Go to the desktop and make yourself a shortcut to start Lazarus from.
    Choose startlazarus.exe as programfile:
    c:\lazarus\lazSVN startlazarus.exe --pcp=c:\lazarus\lazSVN\configdir

    Configdir is automatically created when you start Lazarus.
    If you dont supply a -pcp (primary config path) Lazarus will create
    a directory under C:\Users\Elvis\AppData\Local\lazarus

    When you start Lazarus for the first time you must fill in file locations
    for fpc.exe, fpc sources, make.exe and gdb.exe so Lazarus knows what
    compiler etc to use.

[8] Optional: Install latest binw64 binaries to c:\fpc\binw64 by doing a
    Tortoise SVN Checkout:
    http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw64/


To summarize this. You now have a fpc trunk directory
with the development sources. With Tortoise you can update
fpc as often as you like. When you do that you must
follow the steps under [4], except for the fpc.cfg.

Also Lazarus can be independently update with Tortoise, just get
new sources and go to Tools -> Build Lazarus. If you instead do
a 'make clean bigide' you will have to reinstall 3rd party components
that you have added to the component palette.

BigChimp:
Either that or use fpcup, setting the fpcurl to

--- Code: -----fpcurl=http://svn.freepascal.org/svn/fpc/trunk

--- End code ---

:)

(Although manually building with svn is the supported way, fpcup automates this process)
http://wiki.lazarus.freepascal.org/fpcup

Disclaimer: I'm one of the fpcup authors...

pm:
THANK YOU.  Those are huge steps forward, and, I appreciate your clarity on what is not ready yet.  I do use Classes (TComponent) extensively.  Nonetheless, I will practice building v2.7 and see what I can see. 

Ann

Navigation

[0] Message Index

[#] Next page

Go to full version