Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-06

Run builds with different FPC versions

9 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

Over the last couple of days I've partially regressed and now have lazarus-stable and lazarus-oldstable directories containing 0.9.28.3 and 0.9.26.2. I found that I needed to build these with FPC 2.4.0 and 2.2.4 respectively, so I have put copies of the fpc binary and fpcsrc directory in /usr/local/lib/fpc/x.y.z/.

In general this appears to work, but I noted that I had to change the "Compiler path" and "FPC source directory" settings in the "IDE Options" screen to track the FPC version (although I could obviously also use multiple configuration files).

I find that the "FPC source directory" setting appears to accept a macro $FPCVer(), but the "Compiler path" does not. Irrespective of whether what I'm trying to do is crazy, am I missing anything obvious?

If the above is correct, then the "IDE Options" screen appears to accept options in the format $FPCVer(), while the "Project Options" -> "Target file name" expects e.g. $(TargetCPU). Similarly the "External tools" -> "Edit tool" form suggests that different forms are supported, and in particular I notice that it refers to $TargetCPU().

Are two different macro forms still required, and can this ever be cleaned up?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd
Show quoted text 10 lines
Over the last couple of days I've partially regressed and now have lazarus-stable and lazarus-oldstable directories containing 0.9.28.3 and 0.9.26.2. I found that I needed to build these with FPC 2.4.0 and 2.2.4 respectively, so I have put copies of the fpc binary and fpcsrc directory in /usr/local/lib/fpc/x.y.z/. In general this appears to work, but I noted that I had to change the "Compiler path" and "FPC source directory" settings in the "IDE Options" screen to track the FPC version (although I could obviously also use multiple configuration files).

Yes. I guess that's better for this case.

I find that the "FPC source directory" setting appears to accept a macro $FPCVer(), but the "Compiler path" does not. Irrespective of whether what I'm trying to do is crazy, am I missing anything obvious?

Yes. The FPCVer macro gets the fpc version from the compiler.

Show quoted text 8 lines
If the above is correct, then the "IDE Options" screen appears to accept options in the format $FPCVer(), while the "Project Options" -> "Target file name" expects e.g. $(TargetCPU). Similarly the "External tools" -> "Edit tool" form suggests that different forms are supported, and in particular I notice that it refers to $TargetCPU(). Are two different macro forms still required, and can this ever be cleaned up?

Both formats are accepted.
The format $Name(Parameters) is used for macro functions. The format $(Name) indicates a macro variable.

See here:
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
> I find that the "FPC source directory" setting appears to accept a macro > $FPCVer(), but the "Compiler path" does not. Irrespective of whether > what I'm trying to do is crazy, am I missing anything obvious? Yes. The FPCVer macro gets the fpc version from the compiler.

Is the version number on the "about" box also got from the compiler, or is that determined at build time? If it's hardwired, is there a macro to access it?

Show quoted text 6 lines
Both formats are accepted. The format $Name(Parameters) is used for macro functions. The format $(Name) indicates a macro variable. See here: http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames

Thanks for that, noted.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd
Show quoted text 10 lines
Mattias Gaertner wrote: >> I find that the "FPC source directory" setting appears to accept a macro >> $FPCVer(), but the "Compiler path" does not. Irrespective of whether >> what I'm trying to do is crazy, am I missing anything obvious? > > Yes. The FPCVer macro gets the fpc version from the compiler. Is the version number on the "about" box also got from the compiler, or is that determined at build time?

That's from build time.

If it's hardwired, is there a macro to access it?

No.

Normally you use the latest and greatest fpc version to compile lazarus and for each installed fpc version you use a different lazarus config directory. The lazarus config directory is passed as command line parameter (--pcp=). This way you can use a 0.9.29 lazarus with a 2.2 fpc.

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote
Normally you use the latest and greatest fpc version to compile lazarus

Except that 0.9.26.2 from SVN won't compile with 2.4.0, I had to revert to 2.2.4.

-----8<-----
Compiling graphics.pp
..
custombitmap.inc(293,49) Error: absolute can only be associated with a var or const
custombitmap.inc(302,8) Warning: Local variable "SCB" does not seem to be initialized
fpimagebitmap.inc(108,49) Error: absolute can only be associated with a var or const
graphics.pp(2482) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted
----->8-----

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd
Show quoted text 6 lines
Mattias Gaertner wrote: > Normally you use the latest and greatest fpc version to compile lazarus Except that 0.9.26.2 from SVN won't compile with 2.4.0, I had to revert to 2.2.4.

Correct. I can understand why you might use the 0.9.26 LCL, but why use the 0.9.26 IDE?

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
> Except that 0.9.26.2 from SVN won't compile with 2.4.0, I had to revert > to 2.2.4. Correct. I can understand why you might use the 0.9.26 LCL, but why use the 0.9.26 IDE?

Partly familiarity, but mostly because I'm trying to debug some bitmap bashing that appears to be giving me different results depending on X server type. What are you suggesting: that I only use lazbuild or that I mix-and-match IDE and LCL versions (if so, how)?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd
Show quoted text 12 lines
Mattias Gaertner wrote: >> Except that 0.9.26.2 from SVN won't compile with 2.4.0, I had to revert >> to 2.2.4. > > Correct. I can understand why you might use the 0.9.26 LCL, but why use > the 0.9.26 IDE? Partly familiarity, but mostly because I'm trying to debug some bitmap bashing that appears to be giving me different results depending on X server type. What are you suggesting: that I only use lazbuild or that I mix-and-match IDE and LCL versions (if so, how)?

A 0.9.29 IDE can handle a 0.9.26 LCL.
In fact the IDE is just one single executable that can lie anywhere. All paths and settings are fetched from the config directory.

Use a separate config directory for the 0.9.26 setup (e.g. C:\laz0.9.26\config).
Start the 0.9.29 lazarus with

C:\laz0.9.29\lazarus.exe --pcp=C:\laz0.9.26\config

Set in the IDE the lazarus directory to C:\laz0.9.26 and the compiler to C:\fpc2.2.4\fpc.exe
Now your 0.9.29 IDE will use the 0.9.26 LCL with the 2.2.4 fpc when compiling your packages/projects.

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
A 0.9.29 IDE can handle a 0.9.26 LCL. In fact the IDE is just one single executable that can lie anywhere. All paths and settings are fetched from the config directory. Use a separate config directory for the 0.9.26 setup (e.g. C:\laz0.9.26\config). Start the 0.9.29 lazarus with C:\laz0.9.29\lazarus.exe --pcp=C:\laz0.9.26\config Set in the IDE the lazarus directory to C:\laz0.9.26 and the compiler to C:\fpc2.2.4\fpc.exe Now your 0.9.29 IDE will use the 0.9.26 LCL with the 2.2.4 fpc when compiling your packages/projects.

Thanks, I'll experiment.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email