Pascal Viandier wrote:
I try to use gp to build my programs and have trouble with Pascal sources using c parts. When invoked by gp, gpc stops where I put {$L source.c} saying "error: file 'source.c' must be compiled.
I thought this was solved by Peter's patch (my and your message of the day before) ?
I remarked that gpc is called with --no-automake in its options list, even if I put --automake on gp command-line. This prevents the compilation of the c sources prior the Pascal module. My question is: Is the --no-automake passed to gpc causing the problem or is it because gp should compile the c sources before the Pascal module?
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).
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 ?
A workaround might be to compile the C stuff through a Makefile and then link the produced .o files (or the one .a file) to the gpc program (see e.g. http://gpwiki.org/index.php/Make for an excellent tutorial on Makefiles).
Also, I solved the problem of link with external libraries with gp by processing the dependencies list before the command-line options in routine StartPipe(). This works well. If you are interested by the modification I can send it. Although I don't know which tool you use to make your diffs, I an ready to learn it. Let me know.
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
and the "patch" comand line tool applies them (type "man patch" for the manual) e.g.
patch -p0 < gp.mypatch.diff
Regards,
Adriaan van Os