The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,978 other subscribers

Archive for August 25th, 2016

Why sometimes you *want* to to have your DFM files stored as binary

Posted by jpluimers on 2016/08/25

Delphi Component/Tool vendors have to support a truckload of Delphi and C++ Builder versions which can be a pain: they have to work around problems in Delphi and C++ Builder versions that have long been abandoned by Borland/CodeGear/Embarcadero/Idera/…

This means that sometimes the Delphi Component/Tool vendors have to work around stuff in a way normal applications vendors would never do.

Recently I learned that sometimes this can be a painful thing: keeping DFM files in binary state.

I’m not kidding about either the DFM file format nor about supporting old versions:

  • Delphi has supported text based DFM files since like Delphi 2 for most of the features (yes, ‘most’ is the crucial word here) and by default stored DFM files in text format since Delphi 5.
  • For the Component/Tool Vendors, even Delphi 7 makes money though usually less than Delphi 2007 or the C++ Builder side of things.

The ‘most’ applies to this nice ARM compiler bug in Delphi 19.0.13856.4978 (for mere mortals, that’s Update 1 for RAD Studio XE5, Delphi XE5 and C++Builder XE5; I wish vendors would list those numbers/products in a central place):

  • [Android] MsBuild (dccAarm) error when compile FireMonkeyMobile projects with fmx forms
  • Project:  Delphi
  • Build #:  19.0.13856.4978

Source: [WayBack] QualityCentral

That’s why TeeChart still has most DFM files stored as binary files (again the ‘most’ word).

For version control and searching this is a pain, so normal application developers (the ones not using Delphi XE5 Update 1 for Android work) should run convert.exe with the -t (target=text) switch on DFM binary files.

Oh: this is fixed in version 19.0.13856.4978 (yes, that’s XE5 Update 2).




Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Kylix, QC, Software Development | Leave a Comment »

Perl: checking if makedepend is available without using File::Which

Posted by jpluimers on 2016/08/25

Long lasting open source projects often use makedepend to amend Makefiles with C header dependencies.

However, makedepend is old, not available on some systems (like Mac OS X or Windows) and can have different behaviour than the C compiler on those systems. The alternative usually is the -M switch on the C compiler.

In practice, either makedepend, or the alternative is available, so when prepping for a build you have to choose which one to use.

Some of those open source projects use Perl as a bootstrapper. I’ll write more about those boots trappers in the future, but first lets go back to the post title:

First detecting the availability of makedepend from Perl without relying on File::Which which isn’t installed by default on systems having Perl so a gated check-in build like this Travis build fails.

The trick I use is Perl backticks (aka qx) to try and execute makedepend merging the output of both stdout and stderr (using 2>&1 which is available on most shells). If there is no output, then the result is undef which means makedepend is not available.

# ensure to take the stdout and stderror so we get output like this:
# 'makedepend: error: cannot open "Makefile.makedepend"
my $makedepend_output = `makedepend -f Makefile.makedepend 2>&1`;
if (!$makedepend_output)
print "No makedepend executable found on your path.\n";
print "Output of makedepend: '$makedepend_output'.\n";



Posted in Development, Perl, Scripting, Software Development | 1 Comment »

%d bloggers like this: