Page 1 of 1

Reduce size.

Posted: 10.09.2006, 07:10
by dhongu
If you don't use any type of protocol set zeos.inc with protocols are you need.

:idea: For reducing more size of bpl and application make modification in file ZPlain.dpk in section (contains ... end ) and recompile.

[syntax="delphi"]

contains
ZPlainDriver in '..\..\src\plain\ZPlainDriver.pas',

{$ifdef ENABLE_DBLIB}
ZPlainDbLibDriver in '..\..\src\plain\ZPlainDbLibDriver.pas',
ZPlainDbLibMsSql7 in '..\..\src\plain\ZPlainDbLibMsSql7.pas',
ZPlainDbLibSybaseAse125 in '..\..\src\plain\ZPlainDbLibSybaseAse125.pas',
{$endif}



{$ifdef ENABLE_MYSQL}
ZPlainMySql320 in '..\..\src\plain\ZPlainMySql320.pas',
ZPlainMySql323 in '..\..\src\plain\ZPlainMySql323.pas',
ZPlainMySql40 in '..\..\src\plain\ZPlainMySql40.pas',
ZPlainMySql41 in '..\..\src\plain\ZPlainMySql41.pas',
ZPlainMySql5 in '..\..\src\plain\ZPlainMySql5.pas',
ZPlainMySqlDriver in '..\..\src\plain\ZPlainMySqlDriver.pas',
ZPlainMysqlConstants in '..\..\src\plain\ZPlainMysqlConstants.pas',
{$endif}

{$ifdef ENABLE_POSTGRESQL}
ZPlainPostgreSqlDriver in '..\..\src\plain\ZPlainPostgreSqlDriver.pas',
ZPlainPostgreSql7 in '..\..\src\plain\ZPlainPostgreSql7.pas',
ZPlainPostgreSql8 in '..\..\src\plain\ZPlainPostgreSql8.pas',
{$endif}

ZPlainDb2 in '..\..\src\plain\ZPlainDb2.pas',
ZPlainDb2Driver in '..\..\src\plain\ZPlainDb2Driver.pas',

{$ifdef ENABLE_INTERBASE}
ZPlainInterbase5 in '..\..\src\plain\ZPlainInterbase5.pas',
ZPlainInterbase6 in '..\..\src\plain\ZPlainInterbase6.pas',
ZPlainInterbaseDriver in '..\..\src\plain\ZPlainInterbaseDriver.pas',
ZPlainFirebird10 in '..\..\src\plain\ZPlainFirebird10.pas',
ZPlainFirebird15 in '..\..\src\plain\ZPlainFirebird15.pas',
ZPlainFirebird20 in '..\..\src\plain\ZPlainFirebird20.pas',
{$endif}

{$ifdef ENABLE_ADO}
ZPlainAdoDriver in '..\..\src\plain\ZPlainAdoDriver.pas',
ZPlainAdo in '..\..\src\plain\ZPlainAdo.pas',
{$endif}


{$ifdef ENABLE_ORACLE}
ZPlainOracleDriver in '..\..\src\plain\ZPlainOracleDriver.pas',
ZPlainOracle9i in '..\..\src\plain\ZPlainOracle9i.pas',
{$endif}


{$ifdef ENABLE_SQLITE}
ZPlainSqLite28 in '..\..\src\plain\ZPlainSqLite28.pas',
ZPlainSqLite3 in '..\..\src\plain\ZPlainSqLite3.pas',
ZPlainSqLiteDriver in '..\..\src\plain\ZPlainSqLiteDriver.pas',
{$endif}

{$ifdef ENABLE_ASA}
ZPlainASADriver in '..\..\src\plain\ZPlainASADriver.pas',
ZPlainASA9 in '..\..\src\plain\ZPlainASA9.pas',
ZPlainASA8 in '..\..\src\plain\ZPlainASA8.pas',
ZPlainASA7 in '..\..\src\plain\ZPlainASA7.pas',
{$endif}



ZPlainLoader in '..\..\src\plain\ZPlainLoader.pas';


end.
[/syntax]

mdaems it is correct? If is correct please make this modification to SVN

Posted: 11.09.2006, 08:00
by mdaems
Hi Dorin,

Did you check this? It's a good proposal. Problem is finding the time to do it. For another month my home PC will be locked away during the evening as my kids sleep in the same room. (House renewal works going on).

If you send the changes as a patch (for all packages, please) I can do it a little quicker.
I write it to the todo list I'm keeping.

Mark

Posted: 11.09.2006, 10:43
by dhongu
I check this. With tools make diff file for send you changes as a patch.

Posted: 11.09.2006, 12:31
by mdaems
Dorin,

I just did the changes for D7. Maybe you better wait a little until I commit this change.

Mark

Posted: 15.09.2006, 15:33
by martinalex
Dorin,


>>For reducing more size of bpl and application make modification in file ZPlain.dpk in section (contains ... end ) and recompile.


I have already changed zeos.inc to use Firebird only. This has reduced my exe size by around 1MB. :)

After applying your changes to the ZPlain.dpk the resulting ZPlain.bpl is much smaller, off cause since only Interbase / Firebird related files are included.

BUT my re-compiled exe (build) has still the same size - up to the last byte.
I think the Delphi linker links only the required functions to the exe, so your change has no effect. :(


I use Zeos 6.5.1 with Delphi 7 pro

Martin

Posted: 17.09.2006, 08:47
by mdaems
Well, I did not check that... Nice you tell us.

But for those who follow the changes we're doing : For D7 we have split the components packages into a designtime package and a runtime package as someusers want to use the bpl's to distribute with their apps. For those people those changes are a nice thing to have, of course.

Also, I'm not sure the fpc compiler and linker are so smart they can do this trick of linking only the necessary functions.

I did change those two thing (split+ this threads proposal) to the D7 packages. (revisions 100 and 101) Who wants to do this for the other compilers? Please drop a notehere when you start for yours... and include the patch (SVN diff, please) afterwards. It could be a nice copy-paste job, I think.
I just don't have the compilers and time to do it myself.

Mark

Posted: 17.09.2006, 11:30
by mdaems
Hello again,

I had a look at the lazarus packages, but there I don't know how I can put the different units in the package between {$IFDEF} directives.
Is that possible or should we change all units with these IFDEFs at the second line and the ENDIFs before the 'END.' line? A lot of work, but that way we would not have to change all packages anymore.
Who knows more about it?

Mark