[Lazarus] How to build FPC/Lazarus from sources on Windows?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
I am used to installing FPC/Lazarus on Linux machines from sources via
svn. I have created a script that does most of the necessary stuff for
this.

Now I want to do the same on Windows7, but I am not really sure how.
When I google I get old instructions from the Lazarus 0.9 times, so
these are not especially useful.
Just one item: make

This is a necessary item to be able to build both FPC and Lazarus, yet
on my machine the only make utility I find are these:

where make
C:\Programs\CodeGear\RAD Studio\6.0\bin\make.exe
C:\Programs\Embarcadero\RAD Studio\12.0\bin\make.exe
C:\Programs\Borland\BDS\4.0\Bin\make.exe
C:\Programs\CodeGear\RAD Studio\5.0\bin\make.exe
C:\Programs\Borland\Delphi7\Bin\make.exe

As you can see there are no less than 5 different make utilities all
coming from various installations of Delphi/RAD Studio.

Are these OK to use or do I need to get (how?) some other make
utility? Maybe a GNU version???

Is there an up-to-date page describing the exact procedure to build
FPC and Lazarus from sources retrieved via SVN on Windows?

I do have several older versions of Lazarus/fpc installed already
(1.6, 1.8, 1.8.4 32 bit) but none seems to put fpc.exe on path.
The fpc version for the 1.8.x lazarus is 3.0.4 bundeled with their
respective and 1.6 uses fpc 3.0.0.

I want to move forward with this and not rely on some binary package
if possible.

--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
On Wed, 07 Nov 2018 11:51:36 +0100, Bo Berglund via lazarus
<[hidden email]> wrote:

>Is there an up-to-date page describing the exact procedure to build
>FPC and Lazarus from sources retrieved via SVN on Windows?
>
After posting I found this page:

http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29

Maybe this is the definite instruction?
I will have a look and see if it works out like I need...


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
On Wed, 07 Nov 2018 12:23:29 +0100, Bo Berglund via lazarus
<[hidden email]> wrote:

>On Wed, 07 Nov 2018 11:51:36 +0100, Bo Berglund via lazarus
><[hidden email]> wrote:
>
>>Is there an up-to-date page describing the exact procedure to build
>>FPC and Lazarus from sources retrieved via SVN on Windows?
>>
>After posting I found this page:
>
>http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29
>
>Maybe this is the definite instruction?
>I will have a look and see if it works out like I need...
>
A question:
This page deals with 32 bit fpc/lazarus at least on Windows...
If I want to build the 64 bit version, where should I then put the 64
bit binutils?
The suggested path c:\freepascal\binutils\i386-win32\ seems incorrect.

Could I set it to c:\freepascal\binutils\x86_64-win64\ ?
Or does it not matter? I really would like to have both 32 and 64 bit
available.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
have a look at:

http://wiki.freepascal.org/fpcupdeluxe

that should be sufficient?!!



Am 07.11.18 um 14:22 schrieb Bo Berglund via lazarus:

> On Wed, 07 Nov 2018 12:23:29 +0100, Bo Berglund via lazarus
> <[hidden email]> wrote:
>
>> On Wed, 07 Nov 2018 11:51:36 +0100, Bo Berglund via lazarus
>> <[hidden email]> wrote:
>>
>>> Is there an up-to-date page describing the exact procedure to build
>>> FPC and Lazarus from sources retrieved via SVN on Windows?
>>>
>> After posting I found this page:
>>
>> http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29
>>
>> Maybe this is the definite instruction?
>> I will have a look and see if it works out like I need...
>>
> A question:
> This page deals with 32 bit fpc/lazarus at least on Windows...
> If I want to build the 64 bit version, where should I then put the 64
> bit binutils?
> The suggested path c:\freepascal\binutils\i386-win32\ seems incorrect.
>
> Could I set it to c:\freepascal\binutils\x86_64-win64\ ?
> Or does it not matter? I really would like to have both 32 and 64 bit
> available.
>
>

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
> If I want to build the 64 bit version, where should I then put the 64 bit
binutils?

Wherever -FD in your fpc.cfg points to (remember, fpc.cfg supports
conditionals).

> The suggested path c:\freepascal\binutils\i386-win32\ seems incorrect.

Why not? The binutils itself could still be 32-bit while generating 64-bit
binaries. Native 64-bit shouldn't be there, of course.



--
Sent from: http://free-pascal-lazarus.989080.n3.nabble.com/
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
On Wed, 7 Nov 2018 18:39:59 -0700 (MST), leledumbo via lazarus
<[hidden email]> wrote:

>> If I want to build the 64 bit version, where should I then put the 64 bit
>binutils?
>
>Wherever -FD in your fpc.cfg points to (remember, fpc.cfg supports
>conditionals).
>
>> The suggested path c:\freepascal\binutils\i386-win32\ seems incorrect.
>
>Why not? The binutils itself could still be 32-bit while generating 64-bit
>binaries. Native 64-bit shouldn't be there, of course.

So in fact I don't really need the 64 bit versions of the binutil
files?

I looked further down on the page I found and noted this regarding
creation of the bat file used to build fpc:

For crosscompiler to x86_64 add the following after the first make:

make all OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC%
PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64
INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe
DATA2INC=%myFPC%\utils\data2inc.exe

It rather looks like I don't need two different Lazarus installations
in order to build for both 32 and 64 bit windows, right?
In that case should I not focus on the 64 bit version and have 32 bit
as a crosscompile target?

I.e. Use Lazarus 64 bit to sometimes create a 32 bit program through
cross-compile.

Now I am unsure of what kind of Lazaruses I really do have (4 versions
at the moment). Is there a simple way to check if lazaus itself is 32
or 64 bit?

For Lazarus the bat file looks like this:

set myroot=c:\freepascal
set myFPC=%myroot%\fpc\3.0.4
set mybinutils=%myroot%\binutils
set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
cd %myroot%\laz
make clean all OPT="-glw2 -Xg"

Will it build a 64 or 32 bit version of Lazarus?
Looks like it uses 32 bit paths...


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, Nov 7, 2018 at 9:23 AM Bo Berglund via lazarus
<[hidden email]> wrote:

>
> On Wed, 07 Nov 2018 11:51:36 +0100, Bo Berglund via lazarus
> <[hidden email]> wrote:
>
> >Is there an up-to-date page describing the exact procedure to build
> >FPC and Lazarus from sources retrieved via SVN on Windows?
> >
> After posting I found this page:
>
> http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29
>
> Maybe this is the definite instruction?
> I will have a look and see if it works out like I need...

I made this page - then others have updated too.
I've been using this script (my own, updated, you can get here[1]) for
many years, however using fpcupdeluxe is much simpler.

[1] https://github.com/mdbs99/fp-scripts

regards,
Marcos Douglas
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Thu, Nov 8, 2018 at 10:23 AM Bo Berglund via lazarus
<[hidden email]> wrote:

>
> On Wed, 7 Nov 2018 18:39:59 -0700 (MST), leledumbo via lazarus
> <[hidden email]> wrote:
>
> >> If I want to build the 64 bit version, where should I then put the 64 bit
> >binutils?
> >
> >Wherever -FD in your fpc.cfg points to (remember, fpc.cfg supports
> >conditionals).
> >
> >> The suggested path c:\freepascal\binutils\i386-win32\ seems incorrect.
> >
> >Why not? The binutils itself could still be 32-bit while generating 64-bit
> >binaries. Native 64-bit shouldn't be there, of course.
>
> So in fact I don't really need the 64 bit versions of the binutil
> files?
>
> I looked further down on the page I found and noted this regarding
> creation of the bat file used to build fpc:
>
> For crosscompiler to x86_64 add the following after the first make:
>
> make all OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC%
> PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
> make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64
> INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe
> DATA2INC=%myFPC%\utils\data2inc.exe
>
> It rather looks like I don't need two different Lazarus installations
> in order to build for both 32 and 64 bit windows, right?
> In that case should I not focus on the 64 bit version and have 32 bit
> as a crosscompile target?
>
> I.e. Use Lazarus 64 bit to sometimes create a 32 bit program through
> cross-compile.
>
> Now I am unsure of what kind of Lazaruses I really do have (4 versions
> at the moment). Is there a simple way to check if lazaus itself is 32
> or 64 bit?
>
> For Lazarus the bat file looks like this:
>
> set myroot=c:\freepascal
> set myFPC=%myroot%\fpc\3.0.4
> set mybinutils=%myroot%\binutils
> set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
> cd %myroot%\laz
> make clean all OPT="-glw2 -Xg"
>
> Will it build a 64 or 32 bit version of Lazarus?
> Looks like it uses 32 bit paths...

See here - https://github.com/mdbs99/fp-scripts/blob/master/fpc-make.bat#L54-L58
At least for Windows, you might install i386-win32 version then, if
you want, compile a x86_64 version as explained on script above.

But, again, try fpcupdeluxe... "there is not life without it" :)

regards,
Marcos Douglas
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
Although i never used it
didn't work anymore?
Salvatore
Inviato tramite il client di Posta WPS
Il 08/nov/2018 13:34, "Marcos Douglas B. Santos via lazarus" <[hidden email]> ha scritto:

On Thu, Nov 8, 2018 at 10:23 AM Bo Berglund via lazarus
<[hidden email]> wrote:
>
> On Wed, 7 Nov <a href="tel:201818">2018 18:39:<a href="tel:590700">59 -0700 (MST), leledumbo via lazarus
> <[hidden email]> wrote:
>
> >> If I want to build the 64 bit version, where should I then put the 64 bit
> >binutils?
> >
> >Wherever -FD in your fpc.cfg points to (remember, fpc.cfg supports
> >conditionals).
> >
> >> The suggested path c:\freepascal\binutils\i386-win32\ seems incorrect.
> >
> >Why not? The binutils itself could still be 32-bit while generating 64-bit
> >binaries. Native 64-bit shouldn't be there, of course.
>
> So in fact I don't really need the 64 bit versions of the binutil
> files?
>
> I looked further down on the page I found and noted this regarding
> creation of the bat file used to build fpc:
>
> For crosscompiler to x86_64 add the following after the first make:
>
> make all OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=%myFPC%
> PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe
> make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64
> INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe
> DATA2INC=%myFPC%\utils\data2inc.exe
>
> It rather looks like I don't need two different Lazarus installations
> in order to build for both 32 and 64 bit windows, right?
> In that case should I not focus on the 64 bit version and have 32 bit
> as a crosscompile target?
>
> I.e. Use Lazarus 64 bit to sometimes create a 32 bit program through
> cross-compile.
>
> Now I am unsure of what kind of Lazaruses I really do have (4 versions
> at the moment). Is there a simple way to check if lazaus itself is 32
> or 64 bit?
>
> For Lazarus the bat file looks like this:
>
> set myroot=c:\freepascal
> set myFPC=%myroot%\fpc\3.0.4
> set mybinutils=%myroot%\binutils
> set PATH=%mybinutils%\i386-win32;%myFPC%\bin\i386-win32;%PATH%
> cd %myroot%\laz
> make clean all OPT="-glw2 -Xg"
>
> Will it build a 64 or 32 bit version of Lazarus?
> Looks like it uses 32 bit paths...

See here - https://github.com/mdbs99/fp-scripts/blob/master/fpc-make.bat#L54-L58
At least for Windows, you might install i386-win32 version then, if
you want, compile a x86_64 version as explained on script above.

But, again, try fpcupdeluxe... "there is not life without it" :)

regards,
Marcos Douglas
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 7 Nov 2018 21:51:45 +0100, John Landmesser via lazarus
<[hidden email]> wrote:

>have a look at:
>
>http://wiki.freepascal.org/fpcupdeluxe
>
>that should be sufficient?!!
>

Looks interesting!
But I have a request:
I tried to set it up for installing fpc fixes3.2 x86_64 on windows and
also wanted to set the crosscompiler installation. Plus selecting the
lazarus version.

But then when I clicked the Install cross-compiler button to select
which crosscompiler to choose, it started a pretty long process which
clearly was not wanted and I saw no way to stop it!
It failed since it could not read some file that was supposed to be
there I guess. Later I found a button way down to the right named
Halt! Is that what is supposed to be used for such mistakes as I did?

Please add a confirmation box *before* operations are started so
mistakes like this can be avoided.

Regarding crosscompilers:
How can I set up those when there is no selector for *which*
crosscompiler I want to also install? The CPU selector seems to be
just a single selector option box.


Anyway I corrected what I did wrong and set it in motion.
Took a while and then it stopped with:

C:\fpc\lazarus\components\lazutils\utf8process.pp(362,69) Error:
(3285) Expected another 2 array elements
utf8process.pp(695) Fatal: (10026) There were 1 errors compiling
module, stopping
Fatal: (1018) Compilation aborted
Error: C:\fpc\fpc\bin\x86_64-win64\ppcx64.exe returned an error
exitcode
C:\fpc\fpcbootstrap\make.exe: *** [lazutils] Error 2
fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom:
Lazbuild): make.exe returned error code #2


ERROR: Fpcupdeluxe fatal error !

So what is the deal now?

--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to build FPC/Lazarus from sources on Windows?

Free Pascal - Lazarus mailing list
Fpcupdeluxe tries to install an isolated version of FPC and Lazarus.
And can help you in installing cross-compilers for this isolated
version.

Sequence:
First, install a suitable FPC (and Lazarus) version with fpcupdeluxe in
a directory of choice.
(in you case FPC fixes 3.2 (and Lazarus fixes 2.0 or trunk))

After this process has finished, you can install a cross-compiler.
Choose a CPU and OS and click install cross-compiler.
In most cases, this process will fail due to missing libs and bins.
Allow fpcupdeluxe to download the libs and bins and continue with the
process.
The second run should end with a successful build of the cross-compiler.

Keep in mind: many things can go wrong during the process.
The output should give you more clues in case of errors.
If so, you can report them in the forum.

------ Origineel bericht ------
Van: "Bo Berglund via lazarus" <[hidden email]>
Aan: [hidden email]
CC: "Bo Berglund" <[hidden email]>
Verzonden: 8-11-2018 18:07:06
Onderwerp: Re: [Lazarus] How to build FPC/Lazarus from sources on
Windows?

>On Wed, 7 Nov 2018 21:51:45 +0100, John Landmesser via lazarus
><[hidden email]> wrote:
>
>>have a look at:
>>
>>http://wiki.freepascal.org/fpcupdeluxe
>>
>>that should be sufficient?!!
>>
>
>Looks interesting!
>But I have a request:
>I tried to set it up for installing fpc fixes3.2 x86_64 on windows and
>also wanted to set the crosscompiler installation. Plus selecting the
>lazarus version.
>
>But then when I clicked the Install cross-compiler button to select
>which crosscompiler to choose, it started a pretty long process which
>clearly was not wanted and I saw no way to stop it!
>It failed since it could not read some file that was supposed to be
>there I guess. Later I found a button way down to the right named
>Halt! Is that what is supposed to be used for such mistakes as I did?
>
>Please add a confirmation box *before* operations are started so
>mistakes like this can be avoided.
>
>Regarding crosscompilers:
>How can I set up those when there is no selector for *which*
>crosscompiler I want to also install? The CPU selector seems to be
>just a single selector option box.
>
>
>Anyway I corrected what I did wrong and set it in motion.
>Took a while and then it stopped with:
>
>C:\fpc\lazarus\components\lazutils\utf8process.pp(362,69) Error:
>(3285) Expected another 2 array elements
>utf8process.pp(695) Fatal: (10026) There were 1 errors compiling
>module, stopping
>Fatal: (1018) Compilation aborted
>Error: C:\fpc\fpc\bin\x86_64-win64\ppcx64.exe returned an error
>exitcode
>C:\fpc\fpcbootstrap\make.exe: *** [lazutils] Error 2
>fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom:
>Lazbuild): make.exe returned error code #2
>
>
>ERROR: Fpcupdeluxe fatal error !
>
>So what is the deal now?
>
>--
>Bo Berglund
>Developer in Sweden
>
>--
>_______________________________________________
>lazarus mailing list
>[hidden email]
>https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus