Sign in Join

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

Mailing lists / fpc-devel / 2019-03

fpcmkcfg and fpc.cfg questions

22 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Bart

Hi,

First problem:

I tried to build lazarus trunk with fpc trunk.
Lazarus r60747, fresh checkout
Fpc r41788, installed from source in C:\PP

It failed with:
C:\devel\laztrunktrunk\packager\registration\fcllaz.pas(11,3) Fatal: (10022) Can't find unit db used by fcllaz

I took a look at my fpc.cfg files.

Extract from fpc.cfg from 3.0.4 (created by offcial installer) # searchpath for units and other system dependent things -FuC:\devel\fpc\3.0.4/units/$fpctarget
-FuC:\devel\fpc\3.0.4/units/$fpctarget/*
-FuC:\devel\fpc\3.0.4/units/$fpctarget/rtl

Extract from fpc.cfg from fpc trunk: created with fpcmkcfg.exe (from trunk) # searchpath for units and other system dependent things -Fu/units/$fpctarget
-Fu/units/$fpctarget/*
-Fu/units/$fpctarget/rtl

Notice all paths are relative (to what?)
How does fpc know that, in relation to fpc.exe this must be translated to: ..\..\units\$fpctarget ?

=== output of make ===
make distclean
make bigide OPT="-vut"

make -C packager/registration
make[1]: Entering directory `C:/devel/laztrunktrunk/packager/registration' C:/devel/fpc/3.0.4/bin/i386-win32/rm.exe -f ../units/i386-win32/fcllaz.ppu C:/pp/bin/i386-win32/ppc386.exe -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Fu. -Fuc:/pp/units/i386-win32/rtl -FE.
-FU../units/i386-win32 -g -gl -vut -di386 fcllaz.pas Configfile search: fpc.cfg
Configfile search: C:\Users\Bart\fpc.cfg
Configfile search: C:\ProgramData\fpc.cfg
Configfile search: C:\pp\bin\i386-win32\fpc.cfg
(11026) Reading options from file C:\pp\bin\i386-win32\fpc.cfg Hint: (11030) Start of reading config file C:\pp\bin\i386-win32\fpc.cfg Path "C:\units\i386-win32\" not found
Path "C:\units\i386-win32\*\" not found
Path "C:\units\i386-win32\rtl\" not found
Path "C:\units\i386-win32\httpd22\" not found
Path "C:\Users\Bart\AppData\Local\FreePascal\fppkg\units\i386-win32\*\" not found
Path "C:\lib\i386-win32\" not found
Hint: (11031) End of reading config file C:\pp\bin\i386-win32\fpc.cfg Free Pascal Compiler version 3.3.1 [2019/03/17] for i386 Copyright (c) 1993-2018 by Florian Klaempfl and others (1000) Compiler: C:\pp\bin\i386-win32\ppc386.exe
(1002) Target OS: Win32 for i386
(1003) Using executable path: C:\pp\bin\i386-win32\ (1004) Using unit path: .\
(1004) Using unit path: C:\pp\units\i386-win32\rtl\ (1004) Using unit path: C:\pp\bin\i386-win32\
(1006) Using library path: .\
(1006) Using library path: C:\pp\units\i386-win32\rtl\ (1006) Using library path: C:\pp\bin\i386-win32\
(1007) Using object path: .\
(1007) Using object path: C:\pp\units\i386-win32\rtl\ (1007) Using object path: C:\pp\bin\i386-win32\
(3104) Compiling fcllaz.pas
Searching file fcllaz.pas... found
(PROGRAM) (10057) Registering new unit SYSTEM
(PROGRAM) (10027) Load from FCLLAZ (interface) unit SYSTEM (SYSTEM) (10055) Loading unit SYSTEM
(10000) Unitsearch: system.ppu
(10000) Unitsearch: ..\units\i386-win32\system.ppu (10000) Unitsearch: system.pp
(10000) Unitsearch: system.pas
(10000) Unitsearch: system.ppu
(10000) Unitsearch: system.pp
(10000) Unitsearch: system.pas
(10000) Unitsearch: C:\pp\units\i386-win32\rtl\system.ppu (10001) PPU Loading C:\pp\units\i386-win32\rtl\system.ppu (SYSTEM) (10002) PPU Name: C:\pp\units\i386-win32\rtl\system.ppu (SYSTEM) (10005) PPU Time: 2019/03/17 12:28:14
(SYSTEM) (10003) PPU Flags: 225409
(SYSTEM) (10004) PPU Crc: D0EC42A2
(SYSTEM) (10004) PPU Crc: 5CA0AD90 (intfc)
(SYSTEM) (10004) PPU Crc: 5B736799 (indc)
(SYSTEM) Number of definitions: 2746
(SYSTEM) Number of symbols: 8557
(SYSTEM) (10011) PPU Source: system.pp not available (SYSTEM) (10011) PPU Source: systemh.inc not available (SYSTEM) (10011) PPU Source: sysosh.inc not available (SYSTEM) (10011) PPU Source: rtldefs.inc not available (SYSTEM) (10011) PPU Source: filerec.inc not available (SYSTEM) (10011) PPU Source: textrec.inc not available (SYSTEM) (10011) PPU Source: innr.inc not available (SYSTEM) (10011) PPU Source: cpuh.inc not available (SYSTEM) (10011) PPU Source: cpuinnr.inc not available (SYSTEM) (10011) PPU Source: mathh.inc not available (SYSTEM) (10011) PPU Source: currh.inc not available (SYSTEM) (10011) PPU Source: ustringh.inc not available (SYSTEM) (10011) PPU Source: wstringh.inc not available (SYSTEM) (10011) PPU Source: setjumph.inc not available (SYSTEM) (10011) PPU Source: rttih.inc not available (SYSTEM) (10011) PPU Source: objpash.inc not available (SYSTEM) (10011) PPU Source: varianth.inc not available (SYSTEM) (10011) PPU Source: dynarrh.inc not available (SYSTEM) (10011) PPU Source: compproc.inc not available (SYSTEM) (10011) PPU Source: heaph.inc not available (SYSTEM) (10011) PPU Source: threadh.inc not available (SYSTEM) (10011) PPU Source: dynlibh.inc not available (SYSTEM) (10011) PPU Source: sysdlh.inc not available (SYSTEM) (10011) PPU Source: resh.inc not available (SYSTEM) (10011) PPU Source: excepth.inc not available (SYSTEM) (10011) PPU Source: system.inc not available (SYSTEM) (10011) PPU Source: sysos.inc not available (SYSTEM) (10011) PPU Source: i386.inc not available (SYSTEM) (10011) PPU Source: fastmove.inc not available (SYSTEM) (10011) PPU Source: generic.inc not available (SYSTEM) (10011) PPU Source: set.inc not available (SYSTEM) (10011) PPU Source: genset.inc not available (SYSTEM) (10011) PPU Source: math.inc not available (SYSTEM) (10011) PPU Source: genmath.inc not available (SYSTEM) (10011) PPU Source: gencurr.inc not available (SYSTEM) (10011) PPU Source: sstrings.inc not available (SYSTEM) (10011) PPU Source: flt_conv.inc not available (SYSTEM) (10011) PPU Source: flt_core.inc not available (SYSTEM) (10011) PPU Source: flt_pack.inc not available (SYSTEM) (10011) PPU Source: flt_pack.inc not available (SYSTEM) (10011) PPU Source: int64p.inc not available (SYSTEM) (10011) PPU Source: int64.inc not available (SYSTEM) (10011) PPU Source: astrings.inc not available (SYSTEM) (10011) PPU Source: wstrings.inc not available (SYSTEM) (10011) PPU Source: ustrings.inc not available (SYSTEM) (10011) PPU Source: aliases.inc not available (SYSTEM) (10011) PPU Source: rttidecl.inc not available (SYSTEM) (10011) PPU Source: dynarr.inc not available (SYSTEM) (10011) PPU Source: objpas.inc not available (SYSTEM) (10011) PPU Source: except.inc not available (SYSTEM) (10011) PPU Source: variant.inc not available (SYSTEM) (10011) PPU Source: rtti.inc not available (SYSTEM) (10011) PPU Source: setjump.inc not available (SYSTEM) (10011) PPU Source: sysheap.inc not available (SYSTEM) (10011) PPU Source: heap.inc not available (SYSTEM) (10011) PPU Source: thread.inc not available (SYSTEM) (10011) PPU Source: threadvr.inc not available (SYSTEM) (10011) PPU Source: systhrd.inc not available (SYSTEM) (10011) PPU Source: dynlib.inc not available (SYSTEM) (10011) PPU Source: sysdl.inc not available (SYSTEM) (10011) PPU Source: sysfile.inc not available (SYSTEM) (10011) PPU Source: text.inc not available (SYSTEM) (10011) PPU Source: file.inc not available (SYSTEM) (10011) PPU Source: typefile.inc not available (SYSTEM) (10011) PPU Source: isotmp.inc not available (SYSTEM) (10011) PPU Source: sysdir.inc not available (SYSTEM) (10011) PPU Source: sysres.inc not available (SYSTEM) (10011) PPU Source: syswin.inc not available (SYSTEM) (10011) PPU Source: seh32.inc not available (SYSTEM) (10056) Finished loading unit SYSTEM
Searching file fcllaz.pas... found
(FCLLAZ) (10048) Adding dependency: FCLLAZ depends on SYSTEM Searching file fcllaz.pas... found
(FCLLAZ) (10043) Loading interface units from FCLLAZ (fcllaz) (10057) Registering new unit OBJPAS
(fcllaz) (10027) Load from FCLLAZ (interface) unit OBJPAS (OBJPAS) (10055) Loading unit OBJPAS
(10000) Unitsearch: objpas.ppu
(10000) Unitsearch: ..\units\i386-win32\objpas.ppu (10000) Unitsearch: objpas.pp
(10000) Unitsearch: objpas.pas
(10000) Unitsearch: objpas.ppu
(10000) Unitsearch: objpas.pp
(10000) Unitsearch: objpas.pas
(10000) Unitsearch: C:\pp\units\i386-win32\rtl\objpas.ppu (10001) PPU Loading C:\pp\units\i386-win32\rtl\objpas.ppu (OBJPAS) (10002) PPU Name: C:\pp\units\i386-win32\rtl\objpas.ppu (OBJPAS) (10005) PPU Time: 2019/03/17 12:28:14
(OBJPAS) (10003) PPU Flags: 209026
(OBJPAS) (10004) PPU Crc: B80613D6
(OBJPAS) (10004) PPU Crc: 23905B15 (intfc)
(OBJPAS) (10004) PPU Crc: B3768EC8 (indc)
(OBJPAS) Number of definitions: 68
(OBJPAS) Number of symbols: 149
(OBJPAS) (10011) PPU Source: objpas.pp not available (OBJPAS) (10027) Load from OBJPAS (interface) unit SYSTEM (OBJPAS) (10048) Adding dependency: OBJPAS depends on SYSTEM (OBJPAS) (10056) Finished loading unit OBJPAS
Searching file fcllaz.pas... found
(FCLLAZ) (10048) Adding dependency: FCLLAZ depends on OBJPAS (FCLLAZ) (10057) Registering new unit DB
(FCLLAZ) (10057) Registering new unit PROCESS
(FCLLAZ) (10057) Registering new unit SIMPLEIPC
(FCLLAZ) (10057) Registering new unit EVENTLOG
(FCLLAZ) (10057) Registering new unit XMLCONF
(FCLLAZ) (10057) Registering new unit SQLDB
(FCLLAZ) (10057) Registering new unit LAZARUSPACKAGEINTF (FCLLAZ) (10027) Load from FCLLAZ (interface) unit DB (DB) (10055) Loading unit DB
(10000) Unitsearch: db.ppu
(10000) Unitsearch: ..\units\i386-win32\db.ppu
(10000) Unitsearch: db.pp
(10000) Unitsearch: db.pas
(10000) Unitsearch: db.ppu
(10000) Unitsearch: db.pp
(10000) Unitsearch: db.pas
(10000) Unitsearch: C:\pp\units\i386-win32\rtl\db.ppu (10000) Unitsearch: C:\pp\units\i386-win32\rtl\db.pp (10000) Unitsearch: C:\pp\units\i386-win32\rtl\db.pas (10000) Unitsearch: C:\pp\bin\i386-win32\db.ppu
(10000) Unitsearch: C:\pp\bin\i386-win32\db.pp
(10000) Unitsearch: C:\pp\bin\i386-win32\db.pas
(10000) Unitsearch: db.pp
(10000) Unitsearch: db.pas
(10000) Unitsearch: db.pp
(10000) Unitsearch: db.pas
(10000) Unitsearch: C:\pp\units\i386-win32\rtl\db.pp (10000) Unitsearch: C:\pp\units\i386-win32\rtl\db.pas (10000) Unitsearch: C:\pp\bin\i386-win32\db.pp
(10000) Unitsearch: C:\pp\bin\i386-win32\db.pas
C:\devel\laztrunktrunk\packager\registration\fcllaz.pas(11,3) Fatal: (10022) Can't find unit db used by fcllaz
Fatal: (1018) Compilation aborted
make[1]: *** [fcllaz.ppu] Error 1
make[1]: Leaving directory `C:/devel/laztrunktrunk/packager/registration' make: *** [registration] Error 2
======= end of make output =====

db.ppu resides in C:\pp\units\i386-win32\fcl-db

I changed the paths in fpc.cfg to include the full paths: # searchpath for units and other system dependent things -Fuc:/pp/units/$fpctarget
-Fuc:/pp/units/$fpctarget/*
-Fuc:/pp/units/$fpctarget/rtl

Now it builds OK.

Q1: How come? Why does it find C:\pp\units\i386-win32\fcl-db\db.ppu now? Q2: why did the installer from 3.0.4 use fully qualified paths and fpcmkcfg does not?

Second problem:

Is this supposed to happen?

C:\pp\bin\i386-win32>dir fpc.cfg
...
24-03-2019 00:31 7.572 fpc.cfg

C:\pp\bin\i386-win32>fpcmkcfg -o fpc.cfg
Saved old "fpc.cfg" to "fpc.bak"
Error: Directory of file "fpc.cfg" does not exists. User -p to force creation.

C:\pp\bin\i386-win32>dir fpc.cfg
...
Directory of C:\pp\bin\i386-win32
File Not Found

It just killed my fpc.cfg!
(Yes there is a backup)

This works however:
fpcmkcfg -o .\fpc.cfg

I would say that fpc.cfg as commandline parameter should point to the same file as .\fpc.cfg (as it would do in almost any other program).

Q3: is this a bug or "by design"?

Bart

Reply by email

Unknown author
to Bart
Bart wrote 13 lines
Extract from fpc.cfg from 3.0.4 (created by offcial installer) # searchpath for units and other system dependent things -FuC:\devel\fpc\3.0.4/units/$fpctarget -FuC:\devel\fpc\3.0.4/units/$fpctarget/* -FuC:\devel\fpc\3.0.4/units/$fpctarget/rtl Extract from fpc.cfg from fpc trunk: created with fpcmkcfg.exe (from trunk) # searchpath for units and other system dependent things -Fu/units/$fpctarget -Fu/units/$fpctarget/* -Fu/units/$fpctarget/rtl Notice all paths are relative (to what?)

none of the paths listed above are relative... they all start with a drive letter and backslash or a slash...

relative paths do not start with a drive letter or slash but they may start with ".."

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list unless* *a signed and pre-paid contract is in effect with us.*

Reply by email

Sven Barth
to Unknown author

schrieb am Mo., 25. März 2019, 03:31:

Show quoted text 23 lines
On 3/24/19 6:21 PM, Bart wrote: > Extract from fpc.cfg from 3.0.4 (created by offcial installer) > # searchpath for units and other system dependent things > -FuC:\devel\fpc\3.0.4/units/$fpctarget > -FuC:\devel\fpc\3.0.4/units/$fpctarget/* > -FuC:\devel\fpc\3.0.4/units/$fpctarget/rtl > > Extract from fpc.cfg from fpc trunk: created with fpcmkcfg.exe (from trunk) > # searchpath for units and other system dependent things > -Fu/units/$fpctarget > -Fu/units/$fpctarget/* > -Fu/units/$fpctarget/rtl > > Notice all paths are relative (to what?) none of the paths listed above are relative... they all start with a drive letter and backslash or a slash... relative paths do not start with a drive letter or slash but they may start with ".."

Well, to be fair, the "\bla" ones are called "drive relative paths" as they're always relative to the root drive of the current directory.

Regards,
Sven

Reply by email

Joost van der Sluis
to Bart: First problem: I tried to build lazarus trunk with fpc trunk. Lazarus r60747, fresh…

Op 24-03-19 om 23:21 schreef Bart:

Show quoted text 11 lines
Extract from fpc.cfg from 3.0.4 (created by offcial installer) # searchpath for units and other system dependent things -FuC:\devel\fpc\3.0.4/units/$fpctarget -FuC:\devel\fpc\3.0.4/units/$fpctarget/* -FuC:\devel\fpc\3.0.4/units/$fpctarget/rtl Extract from fpc.cfg from fpc trunk: created with fpcmkcfg.exe (from trunk) # searchpath for units and other system dependent things -Fu/units/$fpctarget -Fu/units/$fpctarget/* -Fu/units/$fpctarget/rtl

You have to give fpcmkcfg some parameters. The installer does that (or, on unices, samplecfg does this for you.)

fpcmkcfg is just a simple template-processor, with a few templates build in. For example, you can see the template for fpc.cfg when you run fpcmkcfg as follows: 'fpcmkcfg -0 -b'

It contains the following part:

# searchpath for units and other system dependent things -Fu%basepath%/units/$fpctarget
-Fu%basepath%/units/$fpctarget/*
-Fu%basepath%/units/$fpctarget/rtl

To create a working fpc.cfg, you have to provide the %basepath% on the command-line. (There are a few build-in macro's, you can see them using 'fpcmkcfg -m')

So in your case the command to generate fpc.cfg would be:

fpcmkcfg -0 -d basepath=C:\devel\fpc\3.3.1

Or, what I would do, to be able to support multiple versions with the same fpc.cfg:

fpcmkcfg -0 -d basepath=C:\devel\fpc\$fpcversion

Notice all paths are relative (to what?) How does fpc know that, in relation to fpc.exe this must be translated to: ..\..\units\$fpctarget ?

No, that won't work. (At least, it is not how it is designed, might work, though. Never tested)

Q1: How come? Why does it find C:\pp\units\i386-win32\fcl-db\db.ppu now? Q2: why did the installer from 3.0.4 use fully qualified paths and fpcmkcfg does not?

I think that these questions are answered now?

Show quoted text 27 lines
Second problem: Is this supposed to happen? C:\pp\bin\i386-win32>dir fpc.cfg ... 24-03-2019 00:31 7.572 fpc.cfg C:\pp\bin\i386-win32>fpcmkcfg -o fpc.cfg Saved old "fpc.cfg" to "fpc.bak" Error: Directory of file "fpc.cfg" does not exists. User -p to force creation. C:\pp\bin\i386-win32>dir fpc.cfg ... Directory of C:\pp\bin\i386-win32 File Not Found It just killed my fpc.cfg! (Yes there is a backup) This works however: fpcmkcfg -o .\fpc.cfg I would say that fpc.cfg as commandline parameter should point to the same file as .\fpc.cfg (as it would do in almost any other program). Q3: is this a bug or "by design"?

ERhm... I can not think of any design that makes this logical. I'm not the one who builds and maintains the windows installers, though. So it's a bug, I would say.

Regards,

Joost.

http://lazarussupport.com - Your donation helps to push Free Pascal and Lazarus forwards.

Reply by email

Bart
to Sven Barth: schrieb am Mo., 25. März 2019, 03:31: Well, to be fair, the "\bla" ones are called…
AM Sven Barth wrote
Well, to be fair, the "\bla" ones are called "drive relative paths" as they're always relative to the root drive of the current directory.

Well if fpc treats -Fu/bla as drive relative paths, it makes even less sense that:
1. fpcmkcfg creates it that way
2. fpc is able to find rather was hoping for a more substantive answer ;-(

Why the difference between the 2 fpc.cfg's (3.0.4 vs trunk; I assume both used fpcmkcfg tool)?
More important: why does builing Lazarus only succeed if I put in fully qualified paths?
(If it cannot find db.ppu, why can it find system.ppu?)

-
Bart

Reply by email

Sven Barth
to Bart: On Mon, Mar 25, 2019 at 7:50 AM Sven Barth via fpc-devel Well if fpc treats -Fu/bla as…

Bart schrieb am Mo., 25. März 2019, 10:46:

Show quoted text 13 lines
On Mon, Mar 25, 2019 at 7:50 AM Sven Barth via fpc-devel wrote: > Well, to be fair, the "\bla" ones are called "drive relative paths" as they're always relative to the root drive of the current directory. Well if fpc treats -Fu/bla as drive relative paths, it makes even less sense that: 1. fpcmkcfg creates it that way 2. fpc is able to find anything at all. I rather was hoping for a more substantive answer ;-(

I replied to wkitty42's statement regarding relative paths, not your problem per se.

Also its not FPC that would handle such paths as drive relative, but Windows itself.

Regards,
Sven

Reply by email

Bart
to Sven Barth
AM Sven Barth wrote
I replied to wkitty42's statement regarding relative paths, not your problem per se.

I know, but the discussion gets side-tracked this way.

The main questions are:
1. Why can fpc find all rtl files if -Fu parameters are like /bla
2. Why cannot find fpc db.ppu if -Fu parameters are like /bla (they need to be c:\actual\path\to\units\)

Bart

Reply by email

Bart
to Joost van der Sluis: Op 24-03-19 om 23:21 schreef Bart: You have to give fpcmkcfg some parameters. The…
AM Joost van der Sluis wrote
To create a working fpc.cfg, you have to provide the %basepath% on the command-line. (There are a few build-in macro's, you can see them using 'fpcmkcfg -m')

fpcmkcfg -d does not show the existence of a build-in BASPEPATH though.

C:\pp\bin\i386-win32>fpcmkcfg -m
BUILDDATE=25-3-2019
BUILDTIME=11:45:25
COMPILERCONFIGDIR={LocalRepository}config/
FPCBIN=fpc
FPCTARGET=i386
FPCTARGETOS=Win32
FPCVERSION=3.3.1
LOCALBASEPATH=$LOCAL_APPDATA\FreePascal\fppkg //odd name for fppkg specific folder?
LOCALREPOSITORY={AppConfigDir}
NEEDCROSSBINUTILSIFDEF=#IFNDEF CPUI386
#IFNDEF CPUAMD64
#DEFINE NEEDCROSSBINUTILS
#ENDIF
#ENDIF

#IFNDEF Win32
#DEFINE NEEDCROSSBINUTILS
#ENDIF
PWD=C:\pp\bin\i386-win32

Bart

Reply by email

Joost van der Sluis
to Bart: fpcmkcfg -d does not show the existence of a build-in BASPEPATH though.…

Op 25-03-19 om 11:48 schreef Bart:

Show quoted text 7 lines
On Mon, Mar 25, 2019 at 10:45 AM Joost van der Sluis wrote: > To create a working fpc.cfg, you have to provide the %basepath% on the > command-line. (There are a few build-in macro's, you can see them using > 'fpcmkcfg -m') fpcmkcfg -d does not show the existence of a build-in BASPEPATH though.

That's correct. That's why it should be provided on the command-line.

fpcmkcfg only shows the values of all defined macro's. For example, try 'fpcmkcfg -d foo=jojo -m'.

The built-in macro's are there because they need some sort of logic. Like the BUILDDATE and BUILDTIME which will contain the current date/time. FPCTARGET the processor fpcmkcfg is compiled for etc.

Show quoted text 10 lines
C:\pp\bin\i386-win32>fpcmkcfg -m BUILDDATE=25-3-2019 BUILDTIME=11:45:25 COMPILERCONFIGDIR={LocalRepository}config/ FPCBIN=fpc FPCTARGET=i386 FPCTARGETOS=Win32 FPCVERSION=3.3.1 LOCALBASEPATH=$LOCAL_APPDATA\FreePascal\fppkg //odd name for fppkg specific folder?

It's being used for ages... You mean the 'FreePascal' part?

Regards,

Joost.

http://lazarussupport.com - Your donation helps to push Free Pascal and Lazarus forwards.

Reply by email

Martok
to Bart: First problem: I tried to build lazarus trunk with fpc trunk. Lazarus r60747, fresh…

Hi,

this is what I supply with the snapshot builds:

https://pastebin.com/KseAwBAM

The multicall binary lives in
$(LazarusDir)\fpc\$FPCVer\bin\$TargetCPU-$TargetOS\fpc.exe This script is in
$(LazarusDir)\makeconfig.cmd

You'll notice this is the default Windows Installer path structure and *will not currently work with fppkg*. But you will get a working compiler.

I used '-o "%CD%\fpc.cfg"' exactly because fpcmkcfg does not handle relative paths well.

Regards, Martok

Reply by email

Joost van der Sluis
to Martok

Op 25-03-19 om 14:07 schreef Martok:

I used '-o "%CD%\fpc.cfg"' exactly because fpcmkcfg does not handle relative paths well.

When you discover things like this, it's better to report it. That way you avoid double work for others with the same problem.

Regards,

Joost.

http://lazarussupport.com - Your donation helps to push Free Pascal and Lazarus forwards.

Reply by email

Martok
to Joost van der Sluis
Joost van der Sluis wrote
When you discover things like this, it's better to report it. That way you avoid double work for others with the same problem.

That piece was from way back when the footnote statement of "Don’t write about Laz/FPC-Bugs, I’m not involved in development there." was actually true and I haven't looked at it since, because it "just works" ;-)

Although, that *is* true again, so it's 50/50 if I would report it today.

Regards, Martok

Reply by email

Bart
to Joost van der Sluis: Op 25-03-19 om 11:48 schreef Bart: That's correct. That's why it should be provided on…
PM Joost van der Sluis wrote
That's correct. That's why it should be provided on the command-line. fpcmkcfg only shows the values of all defined macro's. For example, try 'fpcmkcfg -d foo=jojo -m'.

As an end user howvere I do not even know that such a thing like BASEPATH can be only way to know is to study the sourcecode (fpccfg.inc). IMO to should show all macro's it uses, even if it is empty: eg.: BASEPATH=

> LOCALBASEPATH=$LOCAL_APPDATA\FreePascal\fppkg //odd name for fppkg > specific folder? It's being used for ages... You mean the 'FreePascal' part?

I meant that LOCALFPPKGBASEPATH would have made more sense to me. LOCALBASEPATH to me suggests what BASEPATH seems to be... (I really hop I make myself clear.)

Bart

Reply by email

Ben Grasset
to Bart: First problem: I tried to build lazarus trunk with fpc trunk. Lazarus r60747, fresh…
PM Bart wrote 12 lines
Extract from fpc.cfg from 3.0.4 (created by offcial installer) # searchpath for units and other system dependent things -FuC:\devel\fpc\3.0.4/units/$fpctarget -FuC:\devel\fpc\3.0.4/units/$fpctarget/* -FuC:\devel\fpc\3.0.4/units/$fpctarget/rtl Extract from fpc.cfg from fpc trunk: created with fpcmkcfg.exe (from trunk) # searchpath for units and other system dependent things -Fu/units/$fpctarget -Fu/units/$fpctarget/* -Fu/units/$fpctarget/rtl

The fpc.cfg created by the installer is correct. The one created by default by fpcmkcfg is not (for Windows), as the relative-but-not-really paths like that have no meaning on Windows.

To be properly cross-platform, it should really generate something like "-Fu..\..\units\$fpctarget" and such, if the assumption is that it's being invoked from the "bin\$fpctarget" directory.

Reply by email

Ben Grasset
to Ben Grasset
PM Ben Grasset wrote
To be properly cross-platform, it should really generate something like "-Fu..\..\units\$fpctarget"

I meant to say, "generate something like that specifically for Windows." Perhaps just have an IFDEF UNIX .... ELSE .... ENDIF block to cover everything.

Reply by email

Sven Barth
to Ben Grasset
Ben Grasset wrote 10 lines
On Mon, Mar 25, 2019 at 5:34 PM Ben Grasset < > wrote: To be properly cross-platform, it should really generate something like "-Fu..\..\units\$fpctarget" I meant to say, "generate something like that specifically for Windows." Perhaps just have an IFDEF UNIX .... ELSE .... ENDIF block to cover everything.

Those paths are not handled relative to the compiler binary, they are handled relative to the current directory when calling the compiler. The compiler does not differentiate whether a parameter is passed in by the configuration or by command line argument, they are handled the same (except for macro expansion). So using relative paths in the configuration is more often than not a bad idea (TM).

Regards,
Sven

Reply by email

Ben Grasset
to Sven Barth

On Tue, Mar 26, 2019 at 2:33 AM Sven Barth via fpc-devel <

Show quoted text 9 lines
wrote: Those paths are not handled relative to the compiler binary, they are handled relative to the current directory when calling the compiler. The compiler does not differentiate whether a parameter is passed in by the configuration or by command line argument, they are handled the same (except for macro expansion). So using relative paths in the configuration is more often than not a bad idea (TM).

Well, be that as it may, the fact is that stuff like this, with unprefixed forward-slashes:

-Fu/units/$fpctarget

simply doesn't work on Windows. Where is the %basepath% environment variable the configuration template sources refer to expected to be set, exactly? As far as I can tell it evaluates to an empty string pretty much 100% of the time.

Reply by email

Sven Barth
to Ben Grasset

Ben Grasset schrieb am Di., 26. März 2019, 13:47:

Show quoted text 21 lines
On Tue, Mar 26, 2019 at 2:33 AM Sven Barth via fpc-devel < > wrote: > Those paths are not handled relative to the compiler binary, they are > handled relative to the current directory when calling the compiler. The > compiler does not differentiate whether a parameter is passed in by the > configuration or by command line argument, they are handled the same > (except for macro expansion). So using relative paths in the configuration > is more often than not a bad idea (TM). > Well, be that as it may, the fact is that stuff like this, with unprefixed forward-slashes: -Fu/units/$fpctarget simply doesn't work on Windows. Where is the %basepath% environment variable the configuration template sources refer to expected to be set, exactly? As far as I can tell it evaluates to an empty string pretty much 100% of the time.

Did you read what Joost wrote earlier in this thread? Namely here: http://lists.freepascal.org/pipermail/fpc-devel/2019-March/040542.html

Regards,
Sven

Reply by email

Joost van der Sluis
to Bart: As an end user howvere I do not even know that such a thing like BASEPATH can be only…
Bart wrote 12 lines
On Mon, Mar 25, 2019 at 1:55 PM Joost van der Sluis wrote: > That's correct. That's why it should be provided on the command-line. > > fpcmkcfg only shows the values of all defined macro's. For example, try > 'fpcmkcfg -d foo=jojo -m'. As an end user howvere I do not even know that such a thing like BASEPATH can be set at all. The only way to know is to study the sourcecode (fpccfg.inc). IMO to should show all macro's it uses, even if it is empty: eg.: BASEPATH=

Fpcmkcfg can not know what macro's are used in a template? (You can also use your own template)

Yeah, it could parse the template. But it's just a simple tool.

Show quoted text 8 lines
>> LOCALBASEPATH=$LOCAL_APPDATA\FreePascal\fppkg //odd name for fppkg >> specific folder? > > It's being used for ages... You mean the 'FreePascal' part? I meant that LOCALFPPKGBASEPATH would have made more sense to me. LOCALBASEPATH to me suggests what BASEPATH seems to be... (I really hop I make myself clear.)

You mean that it is strange, because in the fpc.cfg template the same name is used for the fpc-prefix. While here it is used as fppkg prefix?

Well, in fpc.cfg -> fpc prefix, in fppkg.cfg -> fppkg prefix. I can live with that.

Regards,

Joost.

Reply by email