-----Message d'origine----- De : gpc-owner@gnu.de [mailto:gpc-owner@gnu.de] De la part de Frank Heckenbach Envoyé : November 30, 2005 11:48 À : gpc@gnu.de Objet : Re: gp vs --automake
Adriaan van Os wrote:
gp replaces --automake (and --automake will disappear in the future) so there is no point in passing --automake (and --no-automake is the default for gpc anyway).
More precisely, GPC's default is autolink, and --no-automake also implies --no-autolink, so it does make a little difference (though it should not with -c which gp usually passes).
I applied all the recent patches to gp but with no success on this particular problem.
I am puzzled. Is this reproducable somehow ? Or what does Frank say about it ?
I'd also need a reproducible case. All I can say is that I successfully compile with gp project that use {$L foo.c} directives.
I am working on that to give you a clear example of what happens. I made a simple test program using a module that contains the {$L } directive and gp worked perfectly, even recompiling the c source when necessary. But with the real life application it fails repeatedly. I am trying to find the pattern and will let you know.
BTW, you do use a different base name for Pascal and C files (e.g. foo.pas and fooc.c)? Using the same base name would result in object files of the same name, and so cannot work.
I hit this problem at the very beginning of the port from SUN Pascal. Now the Pascal anc C sources have distinct base names.
The "diff" command line tool produces diff files (type "man diff" for the manual), e.g.
diff -u gp.pas.orig gp.pas > gp.mypatch.diff
I'd like to stress the `-u' option. The default output format (without this option) is less well suited. `-c' instead of `-u' is also acceptable, though IMHO less readable, so we use it only when compatibility to various versions of patch is required (some of which don't understand `-u' format diffs).
Thanks. I have never used the diff "-u" option (nor patch either. I applied the patches by hand :-( ). Anyway, here is the diff:
--- gp.pas.orig 2005-11-30 12:47:37.000000000 -0500 +++ gp.pas 2005-11-30 10:49:29.000000000 -0500 @@ -649,9 +649,14 @@ e := 0; OptionCount := Compilers[PascalFlag].OptionCount[OptionSelection]; New (Parameters, e + OptionCount + n - m + 1); + { First, needed options } for i := 1 to e do Parameters^[i] := NeededOptions^[i]; - i := e; + { Then the list of dependencies } + for i := 1 to n - m + 1 do + Parameters^[e + i] := NewString (AdditionalParameters[i + m - 1]^); + { Then the options from command-line } + i := e + n - m + 1; p := Compilers[PascalFlag].Options[OptionSelection]; while p <> nil do begin @@ -659,9 +664,7 @@ Parameters^[i] := @p^.Option; p := p^.Next end; - Assert (i = e + OptionCount); - for i := 1 to n - m + 1 do - Parameters^[e + OptionCount + i] := NewString (AdditionalParameters[i + m - 1]^); + Assert (i = e + OptionCount + n - m + 1); if (Verbosity >= 1) or (@CmdLine <> nil) then begin l := Length (Compilers[PascalFlag].ProgName); @@ -679,7 +682,7 @@ Pipe (Null, OutputFile, StdErrFile, Compilers[PascalFlag].ProgName, Parameters^, GetCEnvironment, Process, nil); Status := 0; Process^.Status := @Status; - for i := e + OptionCount + 1 to Parameters^.Count do + for i := e + 1 to e + n - m + 1 do Dispose (Parameters^[i]); Dispose (Parameters); if (@OutputFile = nil) and (@StdErrFile = nil) then Discard (WaitPipeProcess (Process))
Regards
Pascal Viandier pascal@accovia.com