Sign in Join

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

Mailing lists / fpc-devel / 2007-11

fpmkunit

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Darius Blaszijk

I've been playing around with fpmake again and came to the conclusion that it exhibits some strange behavior (at least I think so)

The -v option gave me the following fFCl command that was executed;

fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* myexample.pp

1. What strikes me is that the command line has the option -n in it. It appears that this command line option is hard coded in TBuildEngine.GetCompilerCommand. I strongly believe it should become a property named DefaultConfigFile which is by default set to True ie no '-n'.

2. -Fuunits\i386-win32\* I did not explicitly added this path. fpmake just takes this path by default. Is this desired behavior? I tend to believe not.

If agreed upon, I will prepare a patch.

Darius

Reply by email

Darius Blaszijk
to Darius Blaszijk

After reconsidering the -n option. It should depend on the "-f / --config=" option.

Darius

Darius Blaszijk wrote 29 lines
I've been playing around with fpmake again and came to the conclusion that it exhibits some strange behavior (at least I think so) The -v option gave me the following fFCl command that was executed; fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* myexample.pp 1. What strikes me is that the command line has the option -n in it. It appears that this command line option is hard coded in TBuildEngine.GetCompilerCommand. I strongly believe it should become a property named DefaultConfigFile which is by default set to True ie no '-n'. 2. -Fuunits\i386-win32\* I did not explicitly added this path. fpmake just takes this path by default. Is this desired behavior? I tend to believe not. If agreed upon, I will prepare a patch. Darius _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Peter Vreman
After reconsidering the -n option. It should depend on the "-f / --config=" option.

The --config and -n are indepdenent. The --config can be used to supply a configuration for fpmake. The -n is for the compiler configuration.

Show quoted text 13 lines
> I've been playing around with fpmake again and came to the conclusion > that it exhibits some strange behavior (at least I think so) > > The -v option gave me the following fFCl command that was executed; > > fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* > myexample.pp > > 1. What strikes me is that the command line has the option -n in it. > It appears that this command line option is hard coded in > TBuildEngine.GetCompilerCommand. I strongly believe it should become a > property named DefaultConfigFile which is by default set to True ie no > '-n'.

This is by design to prevent dependening on local configuration when building and installing packages. It forces the user to add all options and dependencies to fpmake.pp

> 2. -Fuunits\i386-win32\* I did not explicitly added this path. fpmake > just takes this path by default. Is this desired behavior? I tend to > believe not.

I guess this is a wrong default setting for either LocalUnitDir or GlobalUnitDir. Code for that is not tested yet under win32.

Reply by email

Mattias Gaertner
to Peter Vreman
Show quoted text 13 lines
[...] >> fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* >> myexample.pp >> >> 1. What strikes me is that the command line has the option -n in >> it. It appears that this command line option is hard coded in >> TBuildEngine.GetCompilerCommand. I strongly believe it should >> become a property named DefaultConfigFile which is by default set >> to True ie no '-n'. This is by design to prevent dependening on local configuration when building and installing packages. It forces the user to add all options and dependencies to fpmake.pp

Can fpmake be used for programs/libraries too?
They need the linker options of fpc.cfg.

Mattias

Reply by email

Peter Vreman
Show quoted text 19 lines
On Tue, 13 Nov 2007 09:21:36 +0100 (CET) "Peter Vreman" wrote: >[...] > >> fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* > >> myexample.pp > >> > >> 1. What strikes me is that the command line has the option -n in > >> it. It appears that this command line option is hard coded in > >> TBuildEngine.GetCompilerCommand. I strongly believe it should > >> become a property named DefaultConfigFile which is by default set > >> to True ie no '-n'. > > This is by design to prevent dependening on local configuration when > building and installing packages. It forces the user to add all > options and dependencies to fpmake.pp Can fpmake be used for programs/libraries too? They need the linker options of fpc.cfg.

For fpmake we can use the same algorithm as currently used in the generated Makefiles.

Depending on a fpc.cfg is not an option for installing packages from a repository. That will give more problems than it solves. E.g. people having -Mdelphi in the fpc.cfg and the package expects -Mfpc, because that it the compiler default.

Peter

Reply by email

Mattias Gaertner
to Peter Vreman
Show quoted text 27 lines
> On Tue, 13 Nov 2007 09:21:36 +0100 (CET) > "Peter Vreman" wrote: > >>[...] >> >> fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* >> >> myexample.pp >> >> >> >> 1. What strikes me is that the command line has the option -n in >> >> it. It appears that this command line option is hard coded in >> >> TBuildEngine.GetCompilerCommand. I strongly believe it should >> >> become a property named DefaultConfigFile which is by default >> >> set to True ie no '-n'. >> >> This is by design to prevent dependening on local configuration >> when building and installing packages. It forces the user to add >> all options and dependencies to fpmake.pp > > Can fpmake be used for programs/libraries too? > They need the linker options of fpc.cfg. For fpmake we can use the same algorithm as currently used in the generated Makefiles. Depending on a fpc.cfg is not an option for installing packages from a repository. That will give more problems than it solves. E.g. people having -Mdelphi in the fpc.cfg and the package expects -Mfpc, because that it the compiler default.

Yes, of course.
Maybe my question was misleading. I want to know if fpmake is a tool for building packages or if it is a general tool to build all type of pascal code. I know, I can hack it to build everything, but is this supported or is there another tool?

Mattias

Reply by email

Unknown author
to Mattias Gaertner
Show quoted text 36 lines
On Tue, 13 Nov 2007 13:28:47 +0100 (CET) "Peter Vreman" wrote: > > On Tue, 13 Nov 2007 09:21:36 +0100 (CET) > > "Peter Vreman" wrote: > > > >>[...] > >> >> fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* > >> >> myexample.pp > >> >> > >> >> 1. What strikes me is that the command line has the option -n in > >> >> it. It appears that this command line option is hard coded in > >> >> TBuildEngine.GetCompilerCommand. I strongly believe it should > >> >> become a property named DefaultConfigFile which is by default > >> >> set to True ie no '-n'. > >> > >> This is by design to prevent dependening on local configuration > >> when building and installing packages. It forces the user to add > >> all options and dependencies to fpmake.pp > > > > Can fpmake be used for programs/libraries too? > > They need the linker options of fpc.cfg. > > For fpmake we can use the same algorithm as currently used in the > generated Makefiles. > > Depending on a fpc.cfg is not an option for installing packages from > a repository. That will give more problems than it solves. E.g. > people having -Mdelphi in the fpc.cfg and the package expects -Mfpc, > because that it the compiler default. Yes, of course. Maybe my question was misleading. I want to know if fpmake is a tool for building packages or if it is a general tool to build all type of pascal code. I know, I can hack it to build everything, but is this supported or is there another tool?

That is why I propose to make the -n option passed to fpc optional. I'm trying to implement fpmake for a non FPC "compiler" project and extending asability as I come along.

Darius

Reply by email

Peter Vreman
Show quoted text 36 lines
> On Tue, 13 Nov 2007 13:28:47 +0100 (CET) > "Peter Vreman" wrote: > >> > On Tue, 13 Nov 2007 09:21:36 +0100 (CET) >> > "Peter Vreman" wrote: >> > >> >>[...] >> >> >> fpc -n -FUunits\i386-win32\ -Fu..\..\src\ -Fuunits\i386-win32\* >> >> >> myexample.pp >> >> >> >> >> >> 1. What strikes me is that the command line has the option -n in >> >> >> it. It appears that this command line option is hard coded in >> >> >> TBuildEngine.GetCompilerCommand. I strongly believe it should >> >> >> become a property named DefaultConfigFile which is by default >> >> >> set to True ie no '-n'. >> >> >> >> This is by design to prevent dependening on local configuration >> >> when building and installing packages. It forces the user to add >> >> all options and dependencies to fpmake.pp >> > >> > Can fpmake be used for programs/libraries too? >> > They need the linker options of fpc.cfg. >> >> For fpmake we can use the same algorithm as currently used in the >> generated Makefiles. >> >> Depending on a fpc.cfg is not an option for installing packages from >> a repository. That will give more problems than it solves. E.g. >> people having -Mdelphi in the fpc.cfg and the package expects -Mfpc, >> because that it the compiler default. > > Yes, of course. > Maybe my question was misleading. I want to know if fpmake is a tool > for building packages or if it is a general tool to build all type > of pascal code. I know, I can hack it to build everything, but is this > supported or is there another tool?

- fpmake is generic layer to compile programs and units.
* basic knowledge where units need to be installed (same as Makefiles have and fpc binary without fpc.cfg)
* knowledge for a local and system wide units directory, the default is only a system wide directory. Only fppkg has knowledge about a local directory atm.
* ability to override settings on the commandline or config file where to find the compiler and units

- fppkg has the knowledge for:
* installed/available packages per cpu-os-version combination
* info where to install units (for normal users locally in ~/.fppkg/ or system wide /usr/local/fpc/)
* remote repository information where to retrieve packages

That is why I propose to make the -n option passed to fpc optional. I'm trying to implement fpmake for a non FPC "compiler" project and extending asability as I come along.

ok, i see the problem now. when not using fppkg then fpmake has no knowledge where to find the unit directories and you need fpc.cfg for it. I'll add a --nofpccfg option that will always be set when fppkg is used to call fpmake.

Peter

Reply by email