Forum > General

[SOLVED] How to make changes to included units and have the compiler see them



I have Lazarus 2.0.12 installed on openSuSE tumbleweed via the package manager (Yast). I would like to make a few changes to which is located in /usr/share/fpcsrc/packages/fcl-db/mysql. I can sudo to root and change the file, but when I compile my project it does not pick up the changes. I even went as far as changing the ownership of the file to my userid and still it does not pick up my change. Even a "Clean up and Build" does not pick up the changes.
What is the correct way to make changes to a file included with the distribution ? Once I am sure my change works I would like to submit a patch to have it included in the next release.
I basically want to add a property to TConnectionName for the mysql library file name and then have TConnectionName.DoInternalConnect call InitialiseMysql with the library name as parameter.


Default the compiler only reuses the precompiled units for speed. Mixing the precompiled units and the source is not recommended, specially for beginners.

So that practically means rebuilding the FPC distribution, and update(**) the binary files in $prefix/lib/fpc/$FPCVERSION/units/$FPCTARGET/* and then recompile lazarus.

When done properly, on linux FPC rebuilds in about a fat minute, maybe one and an half minute on a average quadcore or more machine, even if a bit older (like a i5-2500)

(**)Best is actually to remove/move away the old files, and put the new ones instead.

I ended up installing freepascal and Lazarus from source in my home dir. Then I could edit the freepascal units, recompile fpc and then the changes were active in Lazarus. I did not need to recompile Lazarus.

Thanx for the pointer


[0] Message Index

Go to full version