| Description | The fpmake.inc / fpmake.pp files inside fpprofiler SVN repository (http://svn.freepascal.org/svn/fpcprojects/fpprofiler/trunk [^] ) seem to use old fpmake identifiers, from old FPC versions.
Attached patch fixes them all, so that one can run "fpc fpmake.pp && ./fpmake" to compile everything inside fpprofiler/trunk from command-line, with pure FPC (without the need to have Lazarus LCL).
- Many small changes to fpmake.* files: "Installer" instead of "Installer(TBasicInstaller)", use "P: TPackage", HomepageURL instead of ExternalURL, slash instead of backslash (will work both on Unix and Windows), add extensions to AddProgram calls, T.Options is now a TStrings list.
- Added compilation of fppinsert.pp and fppremove.pp to fpp/ package, they were missing.
- The examples/insert/ and examples/revert/ do not compile --- their compilation is broken, as they depend on global InsertProfilingCode / RemoveProfilingCode. Looks like they should be changed to use TfppInsertCode / TfppRemoveCode classes, I didn't attempt this for now.
- Removed {$R *.res} to allow compiling fppremove.pp with FPC.
- test/runtests.pp required the FileUtil unit, which is only part of Lazarus LCL. I removed this dependency --- it only used trivial GetExeExt function. This way you can use bare FPC installation to compile it. |
| Attached Files | fpprofiler.patch [^] (14,881 bytes) 2012-05-09 03:20 [Show Content] [Hide Content]Index: test/fpmake.pp
===================================================================
--- test/fpmake.pp (revision 2587)
+++ test/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: test/runtests.pp
===================================================================
--- test/runtests.pp (revision 2587)
+++ test/runtests.pp (working copy)
@@ -18,9 +18,17 @@
uses
Process,
SysUtils,
- Crt,
- FileUtil;
+ Crt;
+function GetExeExt: string;
+begin
+ {$IFDEF WINDOWS}
+ Result:='.exe';
+ {$ELSE}
+ Result:='';
+ {$ENDIF}
+end;
+
const
{$IFDEF MSWINDOWS}
FPPROFDIR = '-Fu..\fpprof';
Index: test/fpmake.inc
===================================================================
--- test/fpmake.inc (revision 2587)
+++ test/fpmake.inc (working copy)
@@ -1,25 +1,24 @@
- StartPackage('test');
+ P := AddPackage('test');
{$IF defined(ALLPACKAGES)}
- Directory:='test';
- BaseInstallDir := '.';
+ P.Directory:='test';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T := Targets.AddProgram('passrctest');
+ T := P.Targets.AddProgram('runtests.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
T.Mode := cmObjFPC;
- T.UnitPath.Add('..\fcl-passrc\');
- T.UnitPath.Add('..\fpprof\');
-
- EndPackage;
+ T.UnitPath.Add('../fcl-passrc/src');
+ T.UnitPath.Add('../fpprof');
Index: fppview/fpmake.pp
===================================================================
--- fppview/fpmake.pp (revision 2587)
+++ fppview/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: fppview/fpmake.inc
===================================================================
--- fppview/fpmake.inc (revision 2587)
+++ fppview/fpmake.inc (working copy)
@@ -1,31 +1,30 @@
- StartPackage('fppview');
+ P := AddPackage('fppview');
{$IF defined(ALLPACKAGES)}
- Directory:='fppview';
- BaseInstallDir := '.';
+ P.Directory:='fppview';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T := Targets.AddProgram('fppview');
+ T := P.Targets.AddProgram('fppview.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
T.Mode := cmObjFPC;
- T.UnitPath.Add('..\fcl-passrc\');
- T.UnitPath.Add('..\fpprof\');
+ T.UnitPath.Add('../fcl-passrc/src');
+ T.UnitPath.Add('../fpprof');
- Targets.AddImplicitUnit('fpcallgraph', False);
- Targets.AddImplicitUnit('fpcallgraph', False);
- Targets.AddImplicitUnit('fpplogreader', False);
- Targets.AddImplicitUnit('fppreport', False);
- Targets.AddImplicitUnit('fppstats', False);
-
- EndPackage;
+ P.Targets.AddImplicitUnit('fpcallgraph', False);
+ P.Targets.AddImplicitUnit('fpcallgraph', False);
+ P.Targets.AddImplicitUnit('fpplogreader', False);
+ P.Targets.AddImplicitUnit('fppreport', False);
+ P.Targets.AddImplicitUnit('fppstats', False);
Index: fpmake.pp
===================================================================
--- fpmake.pp (revision 2587)
+++ fpmake.pp (working copy)
@@ -7,18 +7,19 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
- {$i examples\insert\fpmake.inc}
- { $i examples\revert\fpmake.inc}
- { $i examples\passrc\fpmake.inc}
- { $i fpp\fpmake.inc}
- { $i fpprof\fpmake.inc}
- { $i fppview\fpmake.inc}
- { $i test\fpmake.inc}
+ { $i examples\insert\fpmake.inc} // compilation broken - no global InsertProfilingCode procedure
+ { $i examples\revert\fpmake.inc} // compilation broken - no global RemoveProfilingCode procedure
+ {$i examples\passrc\fpmake.inc}
+ {$i fpp\fpmake.inc}
+ {$i fpprof\fpmake.inc}
+ {$i fppview\fpmake.inc}
+ {$i test\fpmake.inc}
Run;
end;
end.
Index: fpp/fpmake.pp
===================================================================
--- fpp/fpmake.pp (revision 2587)
+++ fpp/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: fpp/fppremove.pp
===================================================================
--- fpp/fppremove.pp (revision 2587)
+++ fpp/fppremove.pp (working copy)
@@ -78,8 +78,6 @@
end;
end;
-{$R *.res}
-
begin
Application := TFPPRemoveApp.Create(nil);
Application.Run;
Index: fpp/fpmake.inc
===================================================================
--- fpp/fpmake.inc (revision 2587)
+++ fpp/fpmake.inc (working copy)
@@ -1,24 +1,26 @@
- StartPackage('fpp');
+ P := AddPackage('fpp');
{$IF defined(ALLPACKAGES)}
- Directory:='fpp';
- BaseInstallDir := '.';
+ P.Directory:='fpp';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T:=Targets.AddProgram('fpp');
+ T:=P.Targets.AddProgram('fpp.pp');
+ T:=P.Targets.AddProgram('fppinsert.pp');
+ T:=P.Targets.AddProgram('fppremove.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
T.Mode := cmObjFPC;
- T.UnitPath.Add('..\fcl-passrc\');
- T.UnitPath.Add('..\fpprof\');
- EndPackage;
+ T.UnitPath.Add('../fcl-passrc/src');
+ T.UnitPath.Add('../fpprof');
Index: fpprof/fpmake.pp
===================================================================
--- fpprof/fpmake.pp (revision 2587)
+++ fpprof/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: fpprof/fpmake.inc
===================================================================
--- fpprof/fpmake.inc (revision 2587)
+++ fpprof/fpmake.inc (working copy)
@@ -1,31 +1,26 @@
- StartPackage('fpprof');
+ P := AddPackage('fpprof');
{$IF defined(ALLPACKAGES)}
- Directory:='fpprof';
- BaseInstallDir := '.';
+ P.Directory:='fpprof';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T := Targets.AddUnit('pscanner.pp');
+ T := P.Targets.AddUnit('pscanner.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
- {$IF defined(ALLPACKAGES)}
- T.Directory := '..\..\fcl-passrc\';
- {$ELSE}
- T.Directory := '..\fcl-passrc\';
- {$ENDIF}
+ T.Directory := '../fcl-passrc/src';
T.ResourceStrings := True;
- Targets.AddUnit('fpprof.pp');
- Targets.AddUnit('fpputils.pas');
-
- EndPackage;
+ P.Targets.AddUnit('fpprof.pp');
+ P.Targets.AddUnit('fpputils.pas');
Index: examples/insert/fpmake.pp
===================================================================
--- examples/insert/fpmake.pp (revision 2587)
+++ examples/insert/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: examples/insert/fpmake.inc
===================================================================
--- examples/insert/fpmake.inc (revision 2587)
+++ examples/insert/fpmake.inc (working copy)
@@ -1,25 +1,25 @@
- StartPackage('insert');
+ P := AddPackage('insert');
{$IF defined(ALLPACKAGES)}
- Directory:='examples\insert';
- BaseInstallDir := '.';
+ P.Directory:='examples/insert';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T := Targets.AddProgram('insert');
+ T := P.Targets.AddProgram('insert.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
T.Mode := cmObjFPC;
- T.UnitPath.Add('..\..\fcl-passrc\');
- T.UnitPath.Add('..\..\fpprof\');
-
- EndPackage;
+ T.UnitPath.Add('../../fcl-passrc/src');
+ T.UnitPath.Add('../../fpprof');
+
\ No newline at end of file
Index: examples/revert/fpmake.pp
===================================================================
--- examples/revert/fpmake.pp (revision 2587)
+++ examples/revert/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: examples/revert/fpmake.inc
===================================================================
--- examples/revert/fpmake.inc (revision 2587)
+++ examples/revert/fpmake.inc (working copy)
@@ -1,25 +1,25 @@
- StartPackage('revert');
+ P := AddPackage('revert');
{$IF defined(ALLPACKAGES)}
- Directory:='examples\revert';
- BaseInstallDir := '.';
+ P.Directory:='examples/revert';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T := Targets.AddProgram('revert');
+ T := P.Targets.AddProgram('revert.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
T.Mode := cmObjFPC;
- T.UnitPath.Add('..\..\fcl-passrc\');
- T.UnitPath.Add('..\..\fpprof\');
+ T.UnitPath.Add('../../fcl-passrc/src');
+ T.UnitPath.Add('../../fpprof');
- EndPackage;
Index: examples/passrc/fpmake.pp
===================================================================
--- examples/passrc/fpmake.pp (revision 2587)
+++ examples/passrc/fpmake.pp (working copy)
@@ -6,10 +6,11 @@
fpmkunit;
var
+ P : TPackage;
T : TTarget;
begin
- with Installer(TBasicInstaller) do
+ with Installer do
begin
{$i fpmake.inc}
Run;
Index: examples/passrc/fpmake.inc
===================================================================
--- examples/passrc/fpmake.inc (revision 2587)
+++ examples/passrc/fpmake.inc (working copy)
@@ -1,25 +1,24 @@
- StartPackage('passrc');
+ P := AddPackage('passrc');
{$IF defined(ALLPACKAGES)}
- Directory:='examples\passrc';
- BaseInstallDir := '.';
+ P.Directory:='examples/passrc';
+ Defaults.BaseInstallDir := '.';
{$ELSE}
- BaseInstallDir := '..';
+ Defaults.BaseInstallDir := '..';
{$ENDIF}
- Author := 'Darius Blaszyk';
- License := 'GPL';
- ExternalURL := 'www.freepascal.org';
- Email := 'dhkblaszyk@zeelandnet.nl';
- Description := 'this package is part of the fpprofiler project';
- Version := '0.1.0';
+ P.Author := 'Darius Blaszyk';
+ P.License := 'GPL';
+ P.HomepageURL := 'www.freepascal.org';
+ P.Email := 'dhkblaszyk@zeelandnet.nl';
+ P.Description := 'this package is part of the fpprofiler project';
+ P.Version := '0.1.0';
- T := Targets.AddProgram('passrc');
+ T := P.Targets.AddProgram('passrc.pp');
{$IF defined(HEAPTRC)}
- T.Options := '-gh -gl';
+ T.Options.Add('-gh');
+ T.Options.Add('-gl');
{$ENDIF}
T.Mode := cmObjFPC;
- T.UnitPath.Add('..\..\fcl-passrc\');
- T.UnitPath.Add('..\..\fpprof\');
-
- EndPackage;
+ T.UnitPath.Add('../../fcl-passrc/src');
+ T.UnitPath.Add('../../fpprof');
|