Recent

Author Topic: [SOLVED] How to rebuild lazarus after changing fpc sources? (Windows only)  (Read 6715 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
   Hi!
   After modifying files in the c:\lazarus\fpc\version\source\ directory how can Lazarus be recompiled to apply these changes. Simply rebuilding it doesn't make a difference. I think the first step needed might be rebuilding fpc and after that, as a second step, rebuilding Lazarus.
   Please provide a step by step command series in order to rebuild lazarus(installed in the default windows directory c:\lazarus) after changing files within the distributed fpc directory(found in the default directory c:\lazarus\fpc\version).

   I'm interested only for official windows releases of Lazarus. I've searched the wiki but it didn't helped me enough.
Thank You!
« Last Edit: August 24, 2014, 06:50:50 pm by lagprogramming »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #1 on: August 19, 2014, 08:05:27 pm »
Rather than asking for step by step instructions I would suggest you
try indicating what you tried and what exactly failed. See first link in my signature.

This way people can actually help you.... and perhaps the wiki needs to be updated (what part of the wiki did you follow? Was something unclear? What happened)

Edit: I assume you've got the fpc source and have tried recompiling the compiler?
« Last Edit: August 19, 2014, 08:09:49 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #2 on: August 19, 2014, 09:18:22 pm »
   What I want is to modify some files in c:\lazarus\fpc\version\source\ directory, and after that recompile the programs(including lazarus) to follow the changes made within those files. The "c:\lazarus" directory contains version 1.2.4 for example, not an unknown svn snapshot, and "c:\lazarus\fpc" contains fpc shipped for Lazarus 1.2.4, not an undetermined svn snapshot.
   I've read the article at http://wiki.lazarus.freepascal.org/Installing_Lazarus as I think it's closest to what I want to do.
   The differences are as follows.
   I would like to modify the original distributed files found within the c:\lazarus\fpc directory, I'm not interested in a different or separated fpc install. This makes "STEP #2: Create a BAT file to compile FPC"(found  at the above link) not precisely accurate to my needs.
   For example, even if I would modify the line "set myroot=c:\freepascal" to "set myroot=c:\lazarus\fpc" I would still have a problem with the following line "set mybinutils=%myroot%\binutils" as there is no "c:\lazarus\fpc\2.6.4\binutils" directory.
   Also, the following line "make clean all install INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe" refers to a file "data2inc.exe" that can be found within "c:\lazarus\fpc\2.6.4\bin\i386-win32" directory but not in a "utils" directory.

kapibara

  • Hero Member
  • *****
  • Posts: 610
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #3 on: August 20, 2014, 12:43:37 am »
Why not make a second FPC installation with source?

Change the source as you like, and then recompile it with your original FPC. Then recompile Lazarus.

The thread below is probably more involved than you need, but could be helpful anyway:

http://forum.lazarus.freepascal.org/index.php/topic,24045.msg144389.html#msg144389

Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #4 on: August 20, 2014, 08:43:32 am »
Thanks for the clear post!

"c:\lazarus\fpc" contains fpc shipped for Lazarus 1.2.4, not an undetermined svn snapshot.
That would be an "undertermined snapshot" (the latest revision) in the FPC 2.6.4 SVN branch (as Laz 1.2.4 was released with FPC 2.6.4) instead of say, the latest revision in SVN trunk which the instructions probably assume.
Not much difference (in fact, none at all except for the SVN commands needed to get the source).

   I would like to modify the original distributed files found within the c:\lazarus\fpc directory, I'm not interested in a different or separated fpc install. This makes "STEP #2: Create a BAT file to compile FPC"(found  at the above link) not precisely accurate to my needs.
   For example, even if I would modify the line "set myroot=c:\freepascal" to "set myroot=c:\lazarus\fpc" I would still have a problem with the following line "set mybinutils=%myroot%\binutils" as there is no "c:\lazarus\fpc\2.6.4\binutils" directory.
So yes, you'd need to adapt it to the directory where the binutils (make.exe) are.
That's why kapibara suggested you make a new copy of the installation.
Also, his suggestion to keep the original install is very useful because you can always repeat the process.

   Also, the following line "make clean all install INSTALL_PREFIX=%myFPC% PP=%mybinutils%\ppc386.exe DATA2INC=%myFPC%\utils\data2inc.exe" refers to a file "data2inc.exe" that can be found within "c:\lazarus\fpc\2.6.4\bin\i386-win32" directory but not in a "utils" directory.
So change it; it is indeed the same utility...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #5 on: August 20, 2014, 11:25:51 am »
Code: [Select]
make clean
make bigide
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #6 on: August 24, 2014, 06:50:27 pm »
   Thank you for your support.
   It appears you can't build Lazarus(1.2.4 windows version) with any noticeable changes after changing distributed fpc(2.6.4) files.
   To be more precise. If you install lazarus 1.2.4 in Windows and you start changing fpc sources (found in the fpc\2.6.4\ subdirectory) you can't apply the changes because apparently in order to rebuild, you need make.exe version 3.80. FPC 2.6.4 is shipped with version 3.82.
   This means that even if you rebuild lazarus any changes of the source files found inside the fpc subdirectory will be ignored.

   Just as a reference..."make clean all" inside the source rtl and packages subdirectories should fail using make 3.82 and work using 3.80(file which should be downloaded separately).

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
OK, this is not the reason why it does not work.

When you change the fc souces and want to apply these changes, you will have to rebuild fpc itself first in order to apply these changes to the compiler/rtl/packages (in effect to fpc itself).
If you have the required sources it's something like:
Code: [Select]
cd \fpcsourcedir
make clean
make all
make install
But see the build-faq (see:http://wiki.freepascal.org/buildfaq) for better instructions.
After that you can rebuild Lazarus with the newly build fpc, and now your changes will be applied.

Rebuilding Lazarus is just that.
It only rebuilds Lazarus from the Lazarus sources, using the fpc binaries (you can throw away the fpc sources, it would not matter to the compiler. Lazarus just needs them for the CodeTools to work properly).

Bart

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: How to rebuild lazarus after changing fpc sources? (Windows only)
« Reply #8 on: September 14, 2014, 01:28:26 pm »
   To be more precise. If you install lazarus 1.2.4 in Windows and you start changing fpc sources (found in the fpc\2.6.4\ subdirectory) you can't apply the changes because apparently in order to rebuild, you need make.exe version 3.80. FPC 2.6.4 is shipped with version 3.82.
Yes, this is correct: you cannot rebuild fpc trunk with make 3.80.

See also
http://wiki.lazarus.freepascal.org/fpcup#Strange_errors_running_clean.2Fdistclean
and the bug reports about this in the bug tracker
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018