Recent

Author Topic: [SOLVED] Why does $fpctarget not work in fpc.cfg?  (Read 6386 times)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1353
  • Professional amateur ;-P
Re: Why does $fpctarget not work in fpc.cfg?
« Reply #15 on: July 16, 2025, 03:18:16 am »
Hey Davo,

Gus, like I said, in verbose mode, you should see (a whole lot of stuff including) the compiler parsing the config file and then searching, in what it thinks is the right place for eg units. If you have replaceable parameters in the cfg file you will see it looking in the place it derived by putting that parameter into the config line in question.  Here is an example (64bit linux of course) 

Code: [Select]
dbannon@dell:~/Pascal/CLI$ fpc -va tsetdemo.pas > dump.txt
dbannon@dell:~/Pascal/CLI$ ls -l dump.txt
-rw-r--r-- 1 dbannon dbannon 462519 Jul 16 10:30 dump.txt
dbannon@dell:~/Pascal/CLI$

Some interesting lines from dump.txt , note number on left is a line number added by my view utility, you may not see that -

Code: [Select]
42 [0.004] Configfile search: /home/dbannon/.fpc.cfg
43 [0.004] Reading options from file /home/dbannon/.fpc.cfg
44 [0.004] Hint: Start of reading config file /home/dbannon/.fpc.cfg

342 [0.027] Using unit path: /home/dbannon/fpc-3.2.4/lib/fpc/3.2.4/units/x86_64-linux/rtl/
743 [0.035] Unitsearch: /home/dbannon/fpc-3.2.4/lib/fpc/3.2.4/units/x86_64-linux/httpd22/system.ppu

752 [0.035] Unitsearch: /home/dbannon/fpc-3.2.4/lib/fpc/3.2.4/units/x86_64-linux/rtl/system.ppu
753 [0.035] Searching file /home/dbannon/fpc-3.2.4/lib/fpc/3.2.4/units/x86_64-linux/rtl/system.ppu... found

OH CRAP!!!

I was doing:
Code: Bash  [Select][+][-]
  1. fpc -va dummy.pas | grep -i 'fpctarget'

It never occurred to me, to look for the resolved paths DOH !!!!!!!!!! :hard-facepalm: :hard-table-headbut:

Now I have to redo all my effing tests!!!

Many thanks for the hint, will test and come back to apologise for wasting so many people's time due to my own very high stoooooooopidity !!!!!!!!!

Jesus Gus!!! Get a bloody grip !!! :D

Cheers,
Gus

n7800

  • Hero Member
  • *****
  • Posts: 710
  • Lazarus IDE contributor
    • GitLab profile
Re: Why does $fpctarget not work in fpc.cfg?
« Reply #16 on: July 16, 2025, 07:13:24 pm »
The documentation for the fpc.cfg configuration file lists a "#WRITE" directive that can be used to get the value:

Code: [Select]
#WRITE TARGET=$fpctarget

You will see this in the output (or in the Lazarus "Messages" window) during compilation.
« Last Edit: July 16, 2025, 07:16:34 pm by n7800 »

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1353
  • Professional amateur ;-P
Re: Why does $fpctarget not work in fpc.cfg?
« Reply #17 on: July 17, 2025, 05:35:14 am »
Hey n7800,

Code: [Select]
#WRITE TARGET=$fpctarget

Thank you soooo, soooo much for this tip !!!
This is exactly the debugging nifty trick that I needed for my niche case!!!
Cannot thank you enough, seriously!!

Cheers,
Gus

dbannon

  • Hero Member
  • *****
  • Posts: 3826
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Why does $fpctarget not work in fpc.cfg?
« Reply #18 on: July 17, 2025, 12:06:41 pm »
Code: [Select]
#WRITE TARGET=$fpctarget
wow, n7800, that is so useful !  Thanks !

Davo
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

PascalDragon

  • Hero Member
  • *****
  • Posts: 6398
  • Compiler Developer
Re: Why does $fpctarget not work in fpc.cfg?
« Reply #19 on: July 17, 2025, 08:56:23 pm »
Nice, PascalDragon has filled in the missing information (my guess was pretty bad). PD, how do you know those parameters ?  Is it doc'ed somewhere or you looked (or wrote) in the code ?

I looked at the code. Was quicker considering I have Lazarus with the compiler open anyway.

 

TinyPortal © 2005-2018