Discussion:
Build/Rebuild lazarus with components
Kjow
2010-01-17 23:17:34 UTC
Permalink
Hi all,

I need to compile lazarus in terminal (or command prompt) including
all components already installed.
I mean that I made a simple batch script on windows startup that
download fpc svn, lazarus svn, recompile fpc and finally recompile
lazarus, but every time I run Lazarus (after relative "make clean
all") I haven't any extra component. I need to click in "build" voice
in IDE menu.

How can I include all packages (extra and not) in command line compiling?

I noticed also that lazarus.exe hasn't the icon, how to associate it to the exe?

Finally, how to automatically strip lazarus.exe? It is 119Mb... :)

Many thanks!

--
Mattias Gaertner
2010-01-18 10:08:26 UTC
Permalink
On Mon, 18 Jan 2010 00:17:34 +0100
Post by Kjow
Hi all,
I need to compile lazarus in terminal (or command prompt) including
all components already installed.
I mean that I made a simple batch script on windows startup that
download fpc svn, lazarus svn, recompile fpc and finally recompile
lazarus, but every time I run Lazarus (after relative "make clean
all") I haven't any extra component. I need to click in "build" voice
in IDE menu.
How can I include all packages (extra and not) in command line compiling?
See
http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling_and_running
Post by Kjow
I noticed also that lazarus.exe hasn't the icon, how to associate it to the exe?
It is already compiled in.
Maybe Paul can answer this?
Post by Kjow
Finally, how to automatically strip lazarus.exe? It is 119Mb... :)
Add to your script:
strip --strip-all lazarus.exe


Mattias

--
Paul Ishenin
2010-01-18 10:18:43 UTC
Permalink
Post by Mattias Gaertner
Post by Kjow
I noticed also that lazarus.exe hasn't the icon, how to associate it to the exe?
It is already compiled in.
Maybe Paul can answer this?
Windows uses built-in icon automatically. On linux you need to assign
project ico file to desktop shortcut manually. I don't know if this can
be automated since even kde and gnome requires different actions for that.

On OSX we are thinking about the possibility to automatically generate a
bundle with .icns inside - then OSX will show application using that icon.
Post by Mattias Gaertner
Post by Kjow
Finally, how to automatically strip lazarus.exe? It is 119Mb... :)
strip --strip-all lazarus.exe
There are other possibilities too. Compiler can strip if -Xs is passed
but I remember some conflicts with -g options. You can also ask fpc to
separate debug info from the executable using -Xg switch. I can be wrong
but as I remember -Xg works correctly starting from fpc 2.4.0

Best regards,
Paul Ishenin.


--
Kjow
2010-01-18 11:19:17 UTC
Permalink
Post by Paul Ishenin
Windows uses built-in icon automatically. On linux you need to assign
project ico file to desktop shortcut manually. I don't know if this can be
automated since even kde and gnome requires different actions for that.
On OSX we are thinking about the possibility to automatically generate a
bundle with .icns inside - then OSX will show application using that icon.
As just worte, startlazarus.exe and lazbuild.exe have both the icon,
but lazarus.exe hasn't.
Post by Paul Ishenin
There are other possibilities too. Compiler can strip if -Xs is passed but I
remember some conflicts with -g options. You can also ask fpc to separate
debug info from the executable using -Xg switch. I can be wrong but as I
remember -Xg works correctly starting from fpc 2.4.0
So can I add -Xs or -Xg to the "make" for lazarus compile?
e.g. c:\develop\lazarus\> make -Xs

Thanks
Kjow

--
Mattias Gaertner
2010-01-18 11:24:32 UTC
Permalink
On Mon, 18 Jan 2010 12:19:17 +0100
Post by Kjow
Post by Paul Ishenin
Windows uses built-in icon automatically. On linux you need to assign
project ico file to desktop shortcut manually. I don't know if this can be
automated since even kde and gnome requires different actions for that.
On OSX we are thinking about the possibility to automatically generate a
bundle with .icns inside - then OSX will show application using that icon.
As just worte, startlazarus.exe and lazbuild.exe have both the icon,
but lazarus.exe hasn't.
Post by Paul Ishenin
There are other possibilities too. Compiler can strip if -Xs is passed but I
remember some conflicts with -g options. You can also ask fpc to separate
debug info from the executable using -Xg switch. I can be wrong but as I
remember -Xg works correctly starting from fpc 2.4.0
So can I add -Xs or -Xg to the "make" for lazarus compile?
e.g. c:\develop\lazarus\> make -Xs
No,
the syntax is:

make OPT='-Xs'

But this won't work. See my other mail.

Mattias

--
Vincent Snijders
2010-01-18 15:02:29 UTC
Permalink
Post by Mattias Gaertner
No,
make OPT='-Xs'
You can do OPT="-g- -Xs", but you don't have debug info in compiled
units either.

Vincent

--
Kjow
2010-01-18 11:06:28 UTC
Permalink
Post by Mattias Gaertner
See
http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling_and_running
Oh, OK.
So to upgrade svn revisions I need to do "make" instead "make clean all".
Post by Mattias Gaertner
Post by Kjow
I noticed also that lazarus.exe hasn't the icon, how to associate it to the exe?
It is already compiled in.
Maybe Paul can answer this?
startlazarus.exe and lazbuild.exe have both the icon, but lazarus.exe hasn't.
Post by Mattias Gaertner
Post by Kjow
Finally, how to automatically strip lazarus.exe? It is 119Mb... :)
strip --strip-all lazarus.exe
Whops, I mean directly in "make" string... but it isn't a problem to
add a row in the script ;)

Thanks!

--
Mattias Gaertner
2010-01-18 11:24:46 UTC
Permalink
On Mon, 18 Jan 2010 12:06:28 +0100
Post by Kjow
Post by Mattias Gaertner
See
http://wiki.lazarus.freepascal.org/Installing_Lazarus#Compiling_and_running
Oh, OK.
So to upgrade svn revisions I need to do "make" instead "make clean all".
I guess you mean you have to use
"make clean all"
Post by Kjow
Post by Mattias Gaertner
Post by Kjow
I noticed also that lazarus.exe hasn't the icon, how to associate it to the exe?
It is already compiled in.
Maybe Paul can answer this?
startlazarus.exe and lazbuild.exe have both the icon, but lazarus.exe hasn't.
Paul?
Post by Kjow
Post by Mattias Gaertner
Post by Kjow
Finally, how to automatically strip lazarus.exe? It is 119Mb... :)
strip --strip-all lazarus.exe
Whops, I mean directly in "make" string... but it isn't a problem to
add a row in the script ;)
AFAIK this is not possible, because you can not disable the -g options
that are always passed by the makefile.

Mattias

--
Kjow
2010-01-18 11:39:06 UTC
Permalink
Post by Mattias Gaertner
I guess you mean you have to use
"make clean all"
Umm... I do "make clean all", then it compile right, but without
installed extra packages.
Then if I try to do "lazbuild --build-all" or "lazbuild -B", I get:

c:\Develop\Lazarus>lazbuild --build-all
Error: missing file

lazbuild [options] <project or package-filename>

Parametri:

--help or -? questo messaggio di aiuto

-B or --build-all fai il build di tutti i file del progetto/pacchetto/ID
E
-r or --recursive apply build flags (-B) to dependencies too
-d or --skip-dependencies Non compilare le dipendenze
--build-ide=<options> fai il build dell'IDE con i pacchetti
-v or --version Mostra versione ed esci

--primary-config-path=<path>
or --pcp=<path>
directory di configurazione primaria, dove Lazarus
salva i suoi file di configurazione. Per default è C:\User
s\Kjow\AppData\Local\lazarus

--secondary-config-path=<path>
or --scp=<path>
directory di configurazione secondaria, dove
Lazarus cerca i modelli di file di configurazione.
Per default è C:\Develop\Lazarus

--operating-system=<operating-system>
or --os=<operating-system>
override the project operating system. e.g. win32
linux. default: win32

--widgetset=<widgetset>
or --ws=<widgetset>
override the project widgetset. e.g. gtk gtk2 qt
win32 carbon. default: win32

--cpu=<cpu>
override the project cpu. e.g. i386 x86_64 powerpc
powerpc_64 etc. default: i386

--compiler=<ppcXXX>
override the default compiler. e.g. ppc386 ppcx64
ppcppc etc. default is stored in
environmentoptions.xml

--language=
Override del linguaggo. Per esempio --language=de.
Per i possibili valori vedi i files nella directory
languages.

c:\Develop\Lazarus>

But If I click on Tools->build lazarus I get lazarus compiled with all
packages I installed before the re-build.
Other thing I just noticed is that making lazarus by command line I
lose language setting and it returns to system language, but building
lazarus by IDE it returns to english (language I choose to use).
Post by Mattias Gaertner
AFAIK this is not possible, because you can not disable the -g options
that are always passed by the makefile.
Ok, thanks you!

Kjow

--
Mattias Gaertner
2010-01-18 11:57:23 UTC
Permalink
On Mon, 18 Jan 2010 12:39:06 +0100
Post by Kjow
Post by Mattias Gaertner
I guess you mean you have to use
"make clean all"
Umm... I do "make clean all", then it compile right, but without
installed extra packages.
c:\Develop\Lazarus>lazbuild --build-all
Error: missing file
lazbuild --build-ide=
Post by Kjow
[...]
But If I click on Tools->build lazarus I get lazarus compiled with all
packages I installed before the re-build.
yes
Post by Kjow
Other thing I just noticed is that making lazarus by command line I
lose language setting and it returns to system language, but building
lazarus by IDE it returns to english (language I choose to use).
The language settings are not compiled in. They are fetched from the
environment variables.
Maybe it didn't found the lazarus source directory?
Post by Kjow
Post by Mattias Gaertner
AFAIK this is not possible, because you can not disable the -g options
that are always passed by the makefile.
Ok, thanks you!
Mattias

--
Luca Olivetti
2010-01-18 11:54:56 UTC
Permalink
Post by Kjow
Post by Mattias Gaertner
I guess you mean you have to use
"make clean all"
Umm... I do "make clean all", then it compile right, but without
installed extra packages.
c:\Develop\Lazarus>lazbuild --build-all
Error: missing file
You need to specify the "--build-ide=" option as well

Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004 (Ext.133) Fax +34 93 5883007

--
Kjow
2010-01-18 14:54:42 UTC
Permalink
Post by Luca Olivetti
You need to specify the "--build-ide=" option as well
Do you mean "lazbuild --build-all --build-ide="?

Thanks,
Kjow

--
Paul Ishenin
2010-01-18 12:42:46 UTC
Permalink
Post by Mattias Gaertner
Post by Kjow
startlazarus.exe and lazbuild.exe have both the icon, but lazarus.exe hasn't.
Paul?
No idea. Lazarus.exe has the same icon as startlazarus and lazbuild here.
Post by Mattias Gaertner
Post by Kjow
Whops, I mean directly in "make" string... but it isn't a problem to
add a row in the script ;)
AFAIK this is not possible, because you can not disable the -g options
that are always passed by the makefile.
I think OPT=-Xg will work but -Xs will not.

Best regards,
Paul Ishenin.

--
Kjow
2010-01-18 14:50:15 UTC
Permalink
Post by Paul Ishenin
No idea. Lazarus.exe has the same icon as startlazarus and lazbuild here.
Can I force to link the icon? (e.g windres in my own script, but which syntax?)

Thanks,
Kjow

--
Paul Ishenin
2010-01-18 14:58:23 UTC
Permalink
Post by Kjow
Post by Paul Ishenin
No idea. Lazarus.exe has the same icon as startlazarus and lazbuild here.
Can I force to link the icon? (e.g windres in my own script, but which syntax?)
Can you tell me what lazarus version do you have?

If 0.9.28 then look at lazarus.rc which must contain a manifest and an icon.
If 0.9.29 then lazarus.res must be in the ide folder which contains an icon.

Best regards,
Paul Ishenin.

--
Kjow
2010-01-18 15:01:59 UTC
Permalink
Post by Paul Ishenin
Can you tell me what lazarus version do you have?
If 0.9.28 then look at lazarus.rc which must contain a manifest and an icon.
If 0.9.29 then lazarus.res must be in the ide folder which contains an icon.
As I said on first message, I made a simple batch script on windows
startup that download fpc svn, lazarus svn, recompile fpc and finally
recompile lazarus, but every time I run Lazarus (after relative "make
clean all") I haven't any extra component. I need to click in "build"
voice in IDE menu."

So, I'm using latest revisions of SVN trunk (both lazarus and fpc)

--
Paul Ishenin
2010-01-18 23:11:04 UTC
Permalink
Post by Kjow
As I said on first message, I made a simple batch script on windows
startup that download fpc svn, lazarus svn, recompile fpc and finally
recompile lazarus, but every time I run Lazarus (after relative "make
clean all") I haven't any extra component. I need to click in "build"
voice in IDE menu."
So, I'm using latest revisions of SVN trunk (both lazarus and fpc)
Good to know - we have similar environment.

Lazarus trunk has a lazarus.res file:
http://svn.freepascal.org/svn/lazarus/trunk/ide/lazarus.res
Do you have one?

Ide using here: http://svn.freepascal.org/svn/lazarus/trunk/ide/lazarus.pp

[part of lazarus.pp]
MainBase, compiler_conditionals_options;

{$I revision.inc}
{$R lazarus.res}

begin

[/part of lazarus.pp]

This adds a manifest and an icon to the lazarus.exe. No idea why it is
not so for you.

Best regards,
Paul Ishenin.

--
Kjow
2010-01-19 08:28:46 UTC
Permalink
Post by Paul Ishenin
Good to know - we have similar environment.
http://svn.freepascal.org/svn/lazarus/trunk/ide/lazarus.res
Do you have one?
Ide using here: http://svn.freepascal.org/svn/lazarus/trunk/ide/lazarus.pp
[part of lazarus.pp]
 MainBase, compiler_conditionals_options;
{$I revision.inc}
{$R lazarus.res}
begin
[/part of lazarus.pp]
This adds a manifest and an icon to the lazarus.exe. No idea why it is not
so for you.
Oh! Now I understand, it is a my "mistake"... I edited lazarus.pp from
{$R lazarus.res} to { $R lazarus.res} because I use glscene that makes
a lot of graphical glitches with windows manifest, so I need to
disable this functions in lazarus IDE (otherwise, there is no way to
use design time editor).

How can I make my own lazarus.res that include all resources, but
without Windows manifest?

Thanks,
Kjow

--
Paul Ishenin
2010-01-19 08:33:19 UTC
Permalink
Post by Kjow
Oh! Now I understand, it is a my "mistake"... I edited lazarus.pp from
{$R lazarus.res} to { $R lazarus.res} because I use glscene that makes
a lot of graphical glitches with windows manifest, so I need to
disable this functions in lazarus IDE (otherwise, there is no way to
use design time editor).
How can I make my own lazarus.res that include all resources, but
without Windows manifest?
You can open lazarus.lpi in lazarus and edit the project options.

Best regards,
Paul Ishenin.


--
Kjow
2010-01-19 09:36:01 UTC
Permalink
Post by Paul Ishenin
You can open lazarus.lpi in lazarus and edit the project options.
Thank you very much, now it is almost perfect :)

I noticed that if I want associate lazarus to open .lpi file, the icon
in file exploer isn't beauty (the real icon is at the center of a
white "box"), so I searched for the regedit key and I found that when
I want to associate a program to open a file Windows (seven in my
case) doesn't create the right key after windows "association":

HKEY_CLASSES_ROOT\lpi_auto_file\DefaultIcon

then I edited the string value with:
C:\Develop\Lazarus\ide\lazarus.ico

Now it is ok, lpi files have the right and beautiful icon! In
attachment my exported .reg to doubleclick for future (editing with
right path needed).

It would be nice if will be in lazarus IDE a function to automatically
associate the right things in each OS (like with the installer
version).

Thank you very much for help,
Lazarus community is fantastic!

Regards,
Kjow
Hans-Peter Diettrich
2010-01-19 12:40:22 UTC
Permalink
Post by Kjow
As I said on first message, I made a simple batch script on windows
startup that download fpc svn, lazarus svn, recompile fpc and finally
recompile lazarus, but every time I run Lazarus (after relative "make
clean all") I haven't any extra component. I need to click in "build"
voice in IDE menu."
AFAIK there is something like "make bigide", that includes the
previously installed packages.

DoDi


--
Mattias Gaertner
2010-01-19 17:28:41 UTC
Permalink
On Tue, 19 Jan 2010 13:40:22 +0100
Post by Hans-Peter Diettrich
Post by Kjow
As I said on first message, I made a simple batch script on windows
startup that download fpc svn, lazarus svn, recompile fpc and finally
recompile lazarus, but every time I run Lazarus (after relative "make
clean all") I haven't any extra component. I need to click in "build"
voice in IDE menu."
AFAIK there is something like "make bigide", that includes the
previously installed packages.
make bigide compiles an IDE as found in the windows installer.
To compile an IDE with your current set of installed packages, use

lazbuild --build-ide=


Mattias

--
Kjow
2010-01-20 09:53:31 UTC
Permalink
Post by Mattias Gaertner
make bigide compiles an IDE as found in the windows installer.
To compile an IDE with your current set of installed packages, use
lazbuild --build-ide=
After an svn update, it is better to do:

make clean all
lazbuild --build-all --build-ide=

or just:

lazbuild --build-all --build-ide=

Thanks!
Kjow

--

Loading...