0

Background: as D7 is now officially unsupported, I'm trying to create a definitive stable and fast D7 Pro development environment, with all fixes applied directly to the source code instead of complicated patching or adding units to every project.

Borland did provide a makefile for the RTL dcu files, but even that does not produce the same size files as the official ones.

I'm wondering whether something is wrong with my setup. As an aside, what is the recommended way of creating the initial development environment now? I thought the best option would be to start afresh by downloading D7Pro and the update 7.1 from cc.embarcadero.com.

dougwoodrow
  • 1,111
  • 12
  • 22
  • It's impossible for us to know how to answer your question without being able to see your screen, read your mind, or download and analyze your entire project. – Jerry Dodge Feb 21 '14 at 00:03
  • @JerryDodge, there is nothing unique on the OP's screen. His project is Delphi7's library sources as it been distributed by Broland a decade ago. – Free Consulting Feb 21 '14 at 03:17
  • By and large they used default settings. If you are building, you can use whatever settings you like. – David Heffernan Feb 21 '14 at 04:12
  • @JerryDodge: This is a fresh installation of D7Pro with update 7.1, sorry if that wasn't clear. – dougwoodrow Feb 21 '14 at 07:39
  • @DavidHeffernan: But why do the default settings produce larger DCU files than the official ones? Isn't that what you see too when you run their makefile? – dougwoodrow Feb 21 '14 at 07:42
  • Why do you care? Do the .dcu files that you compile work? – David Heffernan Feb 21 '14 at 07:44
  • @DavidHeffernan: What I want to do next is incorporate fixes and enhancements to the original libraries, then rebuild the DCU, DCP, BPL files before adding third party components. I'm hoping to avoid any "unit compiled with different version" errors this way. – dougwoodrow Feb 21 '14 at 07:55
  • Since you'll build the entire VCL, you won't encounter that problem. – David Heffernan Feb 21 '14 at 07:57

1 Answers1

1

To the very best of my knowledge, the VCL is expected to be compiled with default compiler settings. Any variations to that are specified explicitly in the source code.

Of course there are debug and release versions. The former does not have optimizations enabled, the latter does.

There are some special requirements for the very low level RTL units but judging from what you say in the question, you are on top of that.

You are concerned that you will encounter the unit compiled against different version of XXX errors. But that will not occur since, as I understand it, you will be compiling the entire RTL and VCL.

Even if you re-compile piecemeal just the units that you modify, you will have no problems so long as you use default compiler options. Of course, you would have to refrain from making changes to the interface section of any unit in that case.

And even if you compile piecemeal you have to understand that there are some compiler options that have no influence on whether or not the .dcu files are compatible with others. A good example is optimisation.

I do wonder whether or not you are doing this needlessly. It sounds like you have a working solution. And nothing has changed recently. Delphi 7 updates dried up a decade ago. Why do you feel compelled to change now?

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Well, let's take a specific example: Classes.dcu - what size do you get when you rebuild it? And which specific compiler settings do you use? Another thing I'm puzzled by is that it's dependent on system.dcu (among other files) according to the makefile, and yet Borland did not rebuild it for the 7.1 update. – dougwoodrow Feb 21 '14 at 08:14
  • I don't have D7 at hand right now. What does it matter the size of the .dcu? Many things can influence that. The default settings are the ones the apply when you call dcc32 and specify no compiler options. – David Heffernan Feb 21 '14 at 08:19
  • My main concern was that the compiler settings themselves might cause incompatibility issues with third-party components I install later. I wanted to avoid having to re-install anything just because of some initial compiler settings. I take it from your reply that that is unlikely, thanks for reassuring me. – dougwoodrow Feb 21 '14 at 09:42
  • You mention optimisation - that is one of the reasons I want to change things (the other is to fix the many outstanding bugs) - do you know where the compiler optimisation options are documented? I found a [utility called DCCShell](http://dcc32shell.tripod.com/cgi-bin/dcc32shell.pl) which indicates dcc32 has specific support for i386, i486, Pentium and Pentium Pro CPU instructions (compiler options -O3 to -O6). I've also seen the option -O+ on [Arnaud Bouchez's Synopse site](http://synopse.info). But I haven't been able to find any documentation about these switches. – dougwoodrow Feb 21 '14 at 10:12
  • You asked what options are needed to compile the VCL. You now seem to be asking a different question. – David Heffernan Feb 21 '14 at 10:24
  • You're right, that is really a separate question. I would still like to know how to re-create the official DCU files first. Somebody who used to work for Borland must surely be around still. – dougwoodrow Feb 21 '14 at 16:59
  • As well as the size, one obvious difference in the classes.dcu created by the Borland-supplied makefile in the source\rtl directory is that the relative path to the unit file appears at the top of the .dcu file: **common\classes.pas**. The only way I know to achieve that is by putting a makefile in the same directory as each source file. Or is there a compiler directive that will do that? – dougwoodrow Feb 23 '14 at 09:58
  • It doesn't seem to me as though what you are trying to do serves any real purpose. – David Heffernan Feb 23 '14 at 10:01
  • You may well be right, David. May I ask how you personally patch the VCL? In [SO9922103](http://stackoverflow.com/questions/9922103/how-to-change-vcl-code) you said: _my customised VCL units have to include a bunch of compiler options at the top of the unit._ Would you mind providing the compiler options you use in your customised VCL units? – dougwoodrow Feb 23 '14 at 14:36
  • That's just because I compile with non-default options. The options I add in my customised units simply restore the defaults. – David Heffernan Feb 23 '14 at 16:18