[Scons-users] Integration with other build system

Dirk Bächle tshortik at gmx.de
Mon May 5 14:17:20 EDT 2014


Matthias,

On 05.05.2014 11:30, Matthias-Christian Ott wrote:

> [...]

> For example, I have Delphi 5 projects (.dpk) that reference source code

> files (.pas). The compiler (dcc32) produces object files (.dcu) for each

> source code file and the project file, moreover it produces a .dcp file

> and the a library file (.bpl).

thanks a lot for your clarifications.
But we're talking about Delphi 5 only, right? Not Delphi 6/7, or any
higher number...

I'm asking because I found

http://stackoverflow.com/questions/3118556/is-there-a-dcc32-exe-command-line-switch-to-make-it-use-create-dcu-files

at the other end of a web search. They're saying that unless you're
using the "-m" or "-b" option, "*.dcu"s are kept in-memory only. So, why
bother with intermediate files in your Emitter?

> I generically renamed the file extensions

> in the first email to make the problem more understandable.

Well, that didn't really work out... :)


> [...]

> No, I execute dcc32 on the .dpk file. dcc32 produces .dcu, .dcp and .bpl

> or .exe files. Depending on the settings in the .dof file of the project

> and settings from the Windows Registry, the files are placed in

> directories outside of the current directory.

>

> So I can't have a separate linking phase. I all I want is the following:

>

> If I call DelphiProject('filename.dpk') or DelphiProject('filename.dpr')

> in a SConstruct file, SCons reads filename.dpr/.dpk, extracts all

> dependencies (source files, resources, forms etc.) from the project

> files and recursively from the dependencies and also considers binaries

> (.dcu, .dcp .bpl, .exe) as dependencies.

That's what you would normally do in an Emitter. Can I have a look at
your current version?


> However, I don't know where and how to properly insert the dependencies.

> For .bpl and .exe I do this in the target_from_source method, but for

> other files I'm not sure. I could for example scan the project file for

> source files. But what if the source files depend on form files and so

> on? Where should I declare that dcc32 produces object files for each

> source file?

If you have to list your object files (see my comment at the top of this
mail), you would do this in your Emitter too.
Parsing your source files automatically, and adding implicit
dependencies would be a task for a Scanner instead.
Depending on how much functionality you want to implement, you might
need both.


> [...]



> My problem is that, I returned the .bpl/.exe, .dcu, .dcp files as

> targets in the emitter of the builder.


Actually, your problem is that the created targets are located outside
of your current folder structure, starting from your top-level
SConstruct and then going down recursively.
Like this, the default target ".", which is used when you call SCons
without any further arguments, won't do anything. SCons knows about the
targets in the distant build folder, but it won't select them...unless
you specify them explicitly on the command line or via the Default() method.


> If I call

> Default(DelphiProject('example.dpk')), the .dcu and .dcp don't appear in

> the output of “scons --tree=all”.

Do they appear when you call SCons with the full path to your resulting
executable as target:

scons --tree=all /full/path/to/build/dir/of/my.exe

?

Dirk



More information about the Scons-users mailing list