Sign in Join

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

Mailing lists / fpc-pascal / 2010-06

From Lazarus-list: Exists a macro to FPC path to file?

12 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Marcos Douglas

I need use the sources of FPC/Lazarus in external HD. So, the FPC path is changed in differents computers.
Is possible to use a macro to point to FPC path (in variable of system) at fpc.cfg file?

eg:

Instead this:

-FuC:\freepascal\fpc/$FPCVERSION/units/$FPCTARGET/ -FuC:\freepascal\fpc/$FPCVERSION/units/$FPCTARGET/* -FuC:\freepascal\fpc/$FPCVERSION/units/$FPCTARGET/rtl

use this:

-Fu$FPCSOURCE/$FPCVERSION/units/$FPCTARGET/
-Fu$FPCSOURCE/$FPCVERSION/units/$FPCTARGET/*
-Fu$FPCSOURCE/$FPCVERSION/units/$FPCTARGET/rtl

I already use the PPC_CONFIG_PATH variable to fpc.cfg file. Would be a variable to FPC path...

Thanks,
Marcos Douglas

Reply by email

Jonas Maebe
to Marcos Douglas
Marcos Douglas wrote
I need use the sources of FPC/Lazarus in external HD. So, the FPC path is changed in differents computers. Is possible to use a macro to point to FPC path (in variable of system) at fpc.cfg file?

No. Furthermore, "the FPC path" would not make sense on non Dos- Windows-OS/2 systems, since there the installation is organised completely differently (and even if you would specify it relative to the location of the ppcXXX executable to make it more cross-platform, that would still not work because not all operating systems guarantee that you can get a correct/sensible path to the currently executing program under all circumstances).

Jonas

Reply by email

Marcos Douglas
to Jonas Maebe
Jonas Maebe wrote 14 lines
On 22 Jun 2010, at 17:28, Marcos Douglas wrote: > I need use the sources of FPC/Lazarus in external HD. So, the FPC path > is changed in differents computers. > Is possible to use a macro to point to FPC path (in variable of > system) at fpc.cfg file? No. Furthermore, "the FPC path" would not make sense on non Dos-Windows-OS/2 systems, since there the installation is organised completely differently (and even if you would specify it relative to the location of the ppcXXX executable to make it more cross-platform, that would still not work because not all operating systems guarantee that you can get a correct/sensible path to the currently executing program under all circumstances).

Okay Jonas, thank you for it.

BTW, about PPC_CONFIG_PATH is recommend to use it? I saw about it in some blog (I don't remember the link) but I haven't seen in FPC docs.

Marcos Douglas

Reply by email

Jonas Maebe
to Marcos Douglas
Marcos Douglas wrote
BTW, about PPC_CONFIG_PATH is recommend to use it? I saw about it in some blog (I don't remember the link) but I haven't seen in FPC docs.

On startup, the compiler looks for fpc.cfg in $PPC_CONFIG_PATH. This is documented in the manual: http://www.freepascal.org/docs-html/user/userse6.html

And actually, there you can see that there is another variable that may be useful to you: FPCDIR. Its functionality has not been maintained in the compiler though. If it is set, then a) if $FPCDIR/rtl exists, the compiler will also look for units in $FPCDIR/rtl/$FPCTARGET
b) if $FPCDIR/rtl does not exist but if $FPCDIR/units exists, then the compiler will also look for units in $FPCDIR/units/$FPCTARGET

It will not look in subdirectories of that directory, so this functionality not really useful anymore.

Jonas

Reply by email

Marcos Douglas
to Jonas Maebe
Jonas Maebe wrote 20 lines
On 22 Jun 2010, at 17:45, Marcos Douglas wrote: > BTW, about PPC_CONFIG_PATH is recommend to use it? I saw about it in > some blog (I don't remember the link) but I haven't seen in FPC docs. On startup, the compiler looks for fpc.cfg in $PPC_CONFIG_PATH. This is documented in the manual: http://www.freepascal.org/docs-html/user/userse6.html And actually, there you can see that there is another variable that may be useful to you: FPCDIR. Its functionality has not been maintained in the compiler though. If it is set, then a) if $FPCDIR/rtl exists, the compiler will also look for units in $FPCDIR/rtl/$FPCTARGET b) if $FPCDIR/rtl does not exist but if $FPCDIR/units exists, then the compiler will also look for units in $FPCDIR/units/$FPCTARGET It will not look in subdirectories of that directory, so this functionality not really useful anymore.

Did not work :/
Well, what you said ..."the FPC path" would not make sense on non Dos-Windows-OS/2 systems... is correct so, I will forget this but...

...if the FPC path have optional, in Windows system would be a great help, at least for me :)
I should configure FPC path different for each machines and use only one external HD with the sources. I would update FPC source on machine with the better Internet connection but could use it in another machine, without change the fpc.cfg.

Marcos Douglas

Reply by email

Jonas Maebe
to Marcos Douglas
Marcos Douglas wrote
I should configure FPC path different for each machines and use only one external HD with the sources. I would update FPC source on machine with the better Internet connection but could use it in another machine, without change the fpc.cfg.

I think the easiest is to create a separate fpc.cfg for each machine and then use PPC_CONFIG_PATH to point to the correct configuration file. Unless you have 100 different machines, that shouldn't be that much work.

Jonas

Reply by email

Marcos Douglas
to Jonas Maebe
Jonas Maebe wrote 11 lines
On 22 Jun 2010, at 18:34, Marcos Douglas wrote: > I should configure FPC path different for each machines and use only > one external HD with the sources. I would update FPC source on machine > with the better Internet connection but could use it in another > machine, without change the fpc.cfg. I think the easiest is to create a separate fpc.cfg for each machine and then use PPC_CONFIG_PATH to point to the correct configuration file. Unless you have 100 different machines, that shouldn't be that much work.

Yes, sure ;)
The only problem is have more than one fpc.cfg file, but for me that's OK.

Thank you
Marcos Douglas

Reply by email

Jonas Maebe
to Marcos Douglas
Marcos Douglas wrote
The only problem is have more than one fpc.cfg file, but for me that's OK.

You still put the common part in a single file and then include it in the separate config files using

#include fpccomm.cfg

Jonas

Reply by email

Marcos Douglas
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 22 Jun 2010, at 21:17, Marcos Douglas wrote: > The only problem is have more than one fpc.cfg file, but for me that's OK. You still put the common part in a single file and then include it in the separate config files using #include fpccomm.cfg

This can be done in a fpc.cfg file?!
There are another 'commands' for the config file?
There is a link to learn that?

Marcos Douglas

Reply by email

Marco van de Voort
to Marcos Douglas
Marcos Douglas wrote 13 lines
On Tue, Jun 22, 2010 at 4:19 PM, Jonas Maebe wrote: > > On 22 Jun 2010, at 21:17, Marcos Douglas wrote: > >> The only problem is have more than one fpc.cfg file, but for me that's OK. > > You still put the common part in a single file and then include it in the separate config files using > > #include fpccomm.cfg This can be done in a fpc.cfg file?! There are another 'commands' for the config file? There is a link to learn that?

Have you tried looking in the manuals?

Reply by email

Marcos Douglas
to Marco van de Voort
Marco van de Voort wrote 16 lines
On Tue, Jun 22, 2010 at 04:36:49PM -0300, Marcos Douglas wrote: > On Tue, Jun 22, 2010 at 4:19 PM, Jonas Maebe wrote: > > > > On 22 Jun 2010, at 21:17, Marcos Douglas wrote: > > > >> The only problem is have more than one fpc.cfg file, but for me that's OK. > > > > You still put the common part in a single file and then include it in the separate config files using > > > > #include fpccomm.cfg > > This can be done in a fpc.cfg file?! > There are another 'commands' for the config file? > There is a link to learn that? Have you tried looking in the manuals?

No, sorry. I will...
But I knew it FPC path not existed ;)
I try to learn only the necessary to work because the time is short (in this week).

I come of Delphi. Configurations files, paths, "compile the compiler", etc... all these things are news to me, but I will learn the major things about FPC/Lazarus and, maybe, could help the community.

I still looking the manuals, tips, etc...

Thanks Marco,
Marcos Douglas

Reply by email