Recent

Author Topic: using make with a different fpc.cfg to build Lazarus  (Read 224 times)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
using make with a different fpc.cfg to build Lazarus
« on: May 09, 2026, 08:28:46 am »
Code: Bash  [Select][+][-]
  1. $ cd ~/lazarus
  2. $ make PP=/usr/bin/fpc-fixes OPT="-n @/etc/fpc-fixes.cfg" bigide

How to build Lazarus using "make" with a different "fpc.cfg"?

Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: using make with a different fpc.cfg to build Lazarus
« Reply #1 on: May 09, 2026, 08:38:01 am »
Just change the OPT= to a different fpc.cfg ?
objects are fine constructs. You can even initialize them with constructors.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: using make with a different fpc.cfg to build Lazarus
« Reply #2 on: May 09, 2026, 08:43:00 am »
Just change the OPT= to a different fpc.cfg ?

I have tried that, but "/etc/fpc.cfg" keeps being used.

dbannon

  • Hero Member
  • *****
  • Posts: 3826
    • tomboy-ng, a rewrite of the classic Tomboy
Re: using make with a different fpc.cfg to build Lazarus
« Reply #3 on: May 09, 2026, 08:43:10 am »
I'd suggest you might be better making you fpc.cfg work with all your versions of FPC.

The one supplied with fpc322 is not up to it but one with 324rc1 makes much better use of replaceable parameters. And you can have different sections depending on what you are compiling.

But if you still want to change things, you can use -n to stop if reading the default and @ to get to to read the one you do want.

Davo

edit - Hmm, I should have spotted "..using make..." !
Lazarus 4, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: using make with a different fpc.cfg to build Lazarus
« Reply #4 on: May 09, 2026, 09:04:17 am »
I'd suggest you might be better making you fpc.cfg work with all your versions of FPC.

The one supplied with fpc322 is not up to it but one with 324rc1 makes much better use of replaceable parameters. And you can have different sections depending on what you are compiling.

But if you still want to change things, you can use -n to stop if reading the default and @ to get to to read the one you do want.

Davo

edit - Hmm, I should have spotted "..using make..." !

Correct: "-n and @" works with "$ /usr/bin/fpc-fixes", but not with "$ make".

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: using make with a different fpc.cfg to build Lazarus
« Reply #5 on: May 09, 2026, 02:41:39 pm »
1. not install global fpc
2. make script that is launch fpc and is name fpc.bat/fpc.sh
3. use script for fpc= when is use make.
4. script have hardcode fpc.cfg

I'd suggest you might be better making you fpc.cfg work with all your versions of FPC.
This is more better solution + not make global install fpc (not have global fpc.cfg any were).
« Last Edit: May 09, 2026, 02:51:44 pm by Thausand »
A docile goblin always follow HERMES.md

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: using make with a different fpc.cfg to build Lazarus
« Reply #6 on: May 10, 2026, 10:46:00 pm »
1. not install global fpc
2. make script that is launch fpc and is name fpc.bat/fpc.sh
3. use script for fpc= when is use make.
4. script have hardcode fpc.cfg

I'd suggest you might be better making you fpc.cfg work with all your versions of FPC.
This is more better solution + not make global install fpc (not have global fpc.cfg any were).

For now, the solution that is working is to transform /etc/fpc.cfg into a flexible symbolic link [easy to check and change] pointing to /etc/fpc-stable.cfg, /etc/fpc-fixes.cfg, and /etc/fpc-main.cfg to recompile Lazarus when necessary.

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: using make with a different fpc.cfg to build Lazarus
« Reply #7 on: May 11, 2026, 12:04:50 am »
For now, the solution that is working is to transform /etc/fpc.cfg into a flexible symbolic link [easy to check and change] pointing to /etc/fpc-stable.cfg, /etc/fpc-fixes.cfg, and /etc/fpc-main.cfg to recompile Lazarus when necessary.
Yes, this also solution if know how work but solution this have little small drawback:
When install fpc (use installer original, use installer 3th party, use installer distribute, have linux system update etc) then is possible for overwrite /etc/fpc.cfg and not know this (when is link then is overwrite link)

If want make solution for fpc.cfg then make include other .cfg and make use define for load different fpc-fixes.cfg/fpc-main.cfg then have automatic backup for important part.

manual: https://www.freepascal.org/docs-html/current/user/usersu17.html#x41-480005.2.1
A docile goblin always follow HERMES.md

 

TinyPortal © 2005-2018