[Pkg-pascal-devel] Bug#845504: Bug#845504: /usr/bin/ppdep-3.0.0: Claims to understand conditional defines, but doesn't handle {$ELSE}

Michalis Kamburelis michalis.kambi at gmail.com
Fri Nov 25 05:45:21 UTC 2016


2016-11-24 3:14 GMT+01:00 Ben Longbons <brlongbons at gmail.com>:
> In the `gearhead` package, `ppdep gharena.pas` produces almost no
> output, whereas `ppdep -dSDLMODE gharena.pas` produces plenty.
>

I took a look at ppdep sources, and the fix was fortunately very
easy:) There was indeed a trivial error when recognizing the "{$else}"
directive. I'm attaching a patch.

Note: The patch was done and tested against the utils/ppdep.pp file
from upstream FPC SVN sources. Not against the FPC 3.0.0 sources from
Debian. But I suspect that the patch will apply and fix the problem
for 3.0.0 too, since the "ppdep" utility is quite old and probably
didn't change significantly in the recent years.

I'll take care of submitting this patch upstream too.

BTW, I would advice against using "ppdep" in general. Reasons:

1. It will fail to understand various other Pascal constructions.
Looking briefly at ppdep sources, it will not understand modern "{$if
xxx}" directive, it doesn't understand "{$include xxx.inc}", it
doesn't understand macros, it doesn't support "{$define xxx}" or
"{$undef xxx}"... So it will fail on various valid Pascal code anyway.

  Fixing all these issues within the current (somewhat old) ppdep code
would be uneasy. It would be probably better to rewrite ppdep using
e.g. fcl-passrc units, that take care of parsing Pascal code.

2. The utility of "ppdep" for Pascal is limited anyway. Unlike in C,
in Pascal the compiler already handles the dependencies (what unit
should be recompiled when and in what order). So generating Makefiles
with dependencies per-unit is usually not needed.

Regards,
Michalis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppdep-fix-else-handling.patch
Type: text/x-patch
Size: 454 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-pascal-devel/attachments/20161125/91ee4701/attachment-0001.bin>


More information about the Pkg-pascal-devel mailing list