Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-10-03 Thread José Mejuto

El 03/10/2015 a las 20:24, Bo Berglund escribió:


Is there some way one can reset all unused sectors on the disk to only
contain 0xFF or Ox00?
That would make the image file compressible to a few GB and possible
to share.


Hello,

Just two links:

http://manpages.ubuntu.com/manpages/natty/man8/zerofree.8.html
https://www.raspberrypi.org/forums/viewtopic.php?t=97832&p=678959

--

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-10-03 Thread Paul Breneman

On 10/03/2015 02:24 PM, Bo Berglund wrote:
...

Is there some way one can reset all unused sectors on the disk to only
contain 0xFF or Ox00?
That would make the image file compressible to a few GB and possible
to share.


On this wiki page:
  http://wiki.freepascal.org/Small_Virtual_Machines

I show:
  sudo dd if=/dev/zero of=/mytempfile (this is very slow as it fills 
the entire partition)

  sudo rm -f /mytempfile

That last step is a little dangerous as my Linux student friends at Ohio 
State have a similar example that they like to point out.  :)


Also, I'm not sure what exactly it does so you should research it more 
before doing it!


Best Regards,
Paul
www.ControlPascal.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-10-03 Thread Bo Berglund
On Sat, 03 Oct 2015 17:29:28 +0800, Dennis
 wrote:

>
>Would you be kind enough to save your SD Card into an image file and 
>share with us?
>If you don't have the  web space needed, please kindly email me and I 
>shall give you an ftp account of my web site.

I made an image as soon as I was done, because I had used a different
card to install Wheezy from the one I bought for the purpose. So I had
to image the replacement card and then write it to the original
(Jessie) card.

It turns out that the SDcard image is gigantic! It holds 4-5 GB worth
of used space as reported on the command line:

pi@raspberrypi ~ $ sudo df -h
Filesystem  Size  Used Avail Use% Mounted on
rootfs   29G  4.8G   23G  18% /
/dev/root29G  4.8G   23G  18% /
devtmpfs460M 0  460M   0% /dev
tmpfs93M  232K   93M   1% /run
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs   186M 0  186M   0% /run/shm
/dev/mmcblk0p1   56M   19M   37M  34% /boot

But the image file is actually almost 30 GB in size and it seems
impossible to compress it any...

The spare MicroSDcard is one I used on my phone earlier but had to
change when I ran out of space and bought a 64 GB card instead.
So I guess it holds a lot of erased but not removed data (photos and
movies) that should be cleared first before I turn it over to anyone
else.

Is there some way one can reset all unused sectors on the disk to only
contain 0xFF or Ox00?
That would make the image file compressible to a few GB and possible
to share.


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-10-03 Thread Dennis



Bo Berglund wrote:



UPDATE:

Since advice was to not cross-compile but build on the final hardware
I have installed fpc and Lazarus on the Rpi2B.

I followed the tutorial for installing fpc and Lazarus from sources on
the Raspberry Pi2B fouund here:
http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2

Notice that it only works on Raspbian-Wheezy, not on Jessie! I lost a
day trying to get it run on Jessie then reinstalled Wheezy and the
tutorial worked exactly as written!
I now have fpc 3.1.1 and lazarus 1.5 installed on the Raspberry Pi2B
with GUI access via VNC. All described in the tutorial.

Recommended for those who want to use fpc/lazarus on the RPi2B.




Would you be kind enough to save your SD Card into an image file and 
share with us?
If you don't have the  web space needed, please kindly email me and I 
shall give you an ftp account of my web site.


Thanks a lot.

Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-10-03 Thread Bo Berglund
On Thu, 24 Sep 2015 09:48:32 -0400, Bo Berglund
 wrote:

>I want to check my options regarding Lazarus and FPC.
>
>If I develop a program on Windows Lazarus, move it to Debian Lazarus
>(x86) and then finally want to compile on ARM on for example Raspberry
>Pi but outside of Lazarus, how is that done?
>Does FPC recognize the Lazarus project file such that paths etc are
>observed?
>Or is thare a separate file for FPC I have to prepare in order to set
>the unit paths?

UPDATE:

Since advice was to not cross-compile but build on the final hardware
I have installed fpc and Lazarus on the Rpi2B.

I followed the tutorial for installing fpc and Lazarus from sources on
the Raspberry Pi2B fouund here:
http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2

Notice that it only works on Raspbian-Wheezy, not on Jessie! I lost a
day trying to get it run on Jessie then reinstalled Wheezy and the
tutorial worked exactly as written!
I now have fpc 3.1.1 and lazarus 1.5 installed on the Raspberry Pi2B
with GUI access via VNC. All described in the tutorial.

Recommended for those who want to use fpc/lazarus on the RPi2B.


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Jonas Maebe

On 25/09/15 19:42, Mark Morgan Lloyd wrote:

Lukasz Sokol wrote:

This seems like a nice tutorial on X over SSH:

http://elinux.org/RPi_Remote_Access

(not tried myself YMMV)


I'd have expected all necessary keys etc. to have been set up by
default. Certainly with Raspbian I didn't have to create them.

I'd also expect the SSH server (on Raspbian or other Debians) to have
been configured to accept X11 forwarding/tunneling. I can't remember
what the default state of the client is for this, which is where -X or
-Y comes into it.


Please move this part of the discussion to the fpc-other mailing list if 
you wish to continue it.


Thanks,


Jonas
FPC mailing lists admin

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Mark Morgan Lloyd

Lukasz Sokol wrote:

On 25/09/15 16:13, Bo Berglund wrote:

On Fri, 25 Sep 2015 08:30:10 +, Mark Morgan Lloyd
 wrote:


Bo Berglund wrote:

If absolutely necessary I will have to set up the RPi with a monitor,
keyboard and mouse and install Lazarus and compile from there. But RPi
is not as powerful a computer as the PC and it will probably be very
slow if at all working
You /do/ appreciate that you can tunnel the X11 user interface across 
SSH, and that most distreaux enable this by default, don't you?

I have no idea what you are talking about here
OTOH I have limited exposure to Linux, just installed a few virtual
machines to get an Apache webserver running for debugging website
development. And I have used a number of RPi units for specialized
tasks (media center, VPN and Print servers). The RPi:s are all
headless except the media center one, which is connected by HDMI to my
TV. And using a TV as the display does not really appeal to me...

My series of questions here are caused by me (while travelling) trying
to collect all info needed for creating a controller application on
the RPi2 using a half dozen units I earlier programmed in Delphi. Too
much to rewrite in another language.
I never programmed anything on a Linux system before.



This seems like a nice tutorial on X over SSH:

http://elinux.org/RPi_Remote_Access

(not tried myself YMMV)


I'd have expected all necessary keys etc. to have been set up by 
default. Certainly with Raspbian I didn't have to create them.


I'd also expect the SSH server (on Raspbian or other Debians) to have 
been configured to accept X11 forwarding/tunneling. I can't remember 
what the default state of the client is for this, which is where -X or 
-Y comes into it.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Mark Morgan Lloyd

Bo Berglund wrote:

On Fri, 25 Sep 2015 08:30:10 +, Mark Morgan Lloyd
 wrote:


Bo Berglund wrote:

If absolutely necessary I will have to set up the RPi with a monitor,
keyboard and mouse and install Lazarus and compile from there. But RPi
is not as powerful a computer as the PC and it will probably be very
slow if at all working
You /do/ appreciate that you can tunnel the X11 user interface across 
SSH, and that most distreaux enable this by default, don't you?


I have no idea what you are talking about here


You could have done with saying that earlier when several people were 
saying you could use it.


Assuming that the machine you're sitting in front of is running Linux, 
try this:


*  Use SSH to log into your RPi.

*  SSH gives you access to a shell.

*  Enter the name of an application program that uses the X11 user 
interface, e.g. kinfocenter.


*  That program will run on the RPi, but the user interface will be 
tunneled over the SSH connection so the window will appear on your 
desktop machine.


You can run Lazarus in the same way, but there's various improvements 
you can make to the crude sequence I've described.


You can also install VNC or run X11 remotely, but that's not quite as 
resource-effective.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Lukasz Sokol
On 25/09/15 16:13, Bo Berglund wrote:
> On Fri, 25 Sep 2015 08:30:10 +, Mark Morgan Lloyd
>  wrote:
> 
>> Bo Berglund wrote:
>>> If absolutely necessary I will have to set up the RPi with a monitor,
>>> keyboard and mouse and install Lazarus and compile from there. But RPi
>>> is not as powerful a computer as the PC and it will probably be very
>>> slow if at all working
>>
>> You /do/ appreciate that you can tunnel the X11 user interface across 
>> SSH, and that most distreaux enable this by default, don't you?
> 
> I have no idea what you are talking about here
> OTOH I have limited exposure to Linux, just installed a few virtual
> machines to get an Apache webserver running for debugging website
> development. And I have used a number of RPi units for specialized
> tasks (media center, VPN and Print servers). The RPi:s are all
> headless except the media center one, which is connected by HDMI to my
> TV. And using a TV as the display does not really appeal to me...
> 
> My series of questions here are caused by me (while travelling) trying
> to collect all info needed for creating a controller application on
> the RPi2 using a half dozen units I earlier programmed in Delphi. Too
> much to rewrite in another language.
> I never programmed anything on a Linux system before.
> 
> 
This seems like a nice tutorial on X over SSH:

http://elinux.org/RPi_Remote_Access

(not tried myself YMMV)

el es

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Bo Berglund
On Fri, 25 Sep 2015 08:30:10 +, Mark Morgan Lloyd
 wrote:

>Bo Berglund wrote:
>> If absolutely necessary I will have to set up the RPi with a monitor,
>> keyboard and mouse and install Lazarus and compile from there. But RPi
>> is not as powerful a computer as the PC and it will probably be very
>> slow if at all working
>
>You /do/ appreciate that you can tunnel the X11 user interface across 
>SSH, and that most distreaux enable this by default, don't you?

I have no idea what you are talking about here
OTOH I have limited exposure to Linux, just installed a few virtual
machines to get an Apache webserver running for debugging website
development. And I have used a number of RPi units for specialized
tasks (media center, VPN and Print servers). The RPi:s are all
headless except the media center one, which is connected by HDMI to my
TV. And using a TV as the display does not really appeal to me...

My series of questions here are caused by me (while travelling) trying
to collect all info needed for creating a controller application on
the RPi2 using a half dozen units I earlier programmed in Delphi. Too
much to rewrite in another language.
I never programmed anything on a Linux system before.


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Luiz Americo Pereira Camara
Em 24/09/2015 18:02, "Mattias Gaertner" 
escreveu:
>
> On Thu, 24 Sep 2015 16:21:31 +0100
> Graeme Geldenhuys  wrote:
>
> > On 2015-09-24 16:14, Michael Van Canneyt wrote:
> > Is lazbuild a pure console application?
>
> Yes.
>
> > If so, no problem, but my guess
> > is that it still uses the LCL somewhere (ie: NoGUI widget type).
>
> Yes, it (still) needs some LCL units, but no gui libs.
>

Good to know

One issue i found while trying to use lazbuild in a headless server is that
there's no standalone lazbuild debian package.

To use it i have to install the complete lazarus package that depends on
gtk lib which is not needed / undesirable in this setting

Btw the enviroment i needed lazbuild is cloud9 IDE.

Luiz
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Dennis




If absolutely necessary I will have to set up the RPi with a monitor,
keyboard and mouse and install Lazarus and compile from there. But RPi
is not as powerful a computer as the PC and it will probably be very
slow if at all working
  

You can VNC to the RPi. The Pi 2 is much faster and with more RAM then 
the old Pi. It should be ok for using Lazarus.
Even it is slow, you only do the compilation once, after you completely 
finish coding the project on Linux PC. The speed is not an issue.


There is also another option:
You buy a much more powerful ARM computer to do your interactive 
development.
I bought an Odroid U3  from http://www.hardkernel.com a few years ago to 
do my Linux-ARM Lazarus development.
After the project is compiled into a binary executable, I just moved it 
to the RPi to run without any modification or change at all.


Now they have even more powerful ARM embedded computers already and the 
speed should be close to a Windows PC.


Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Sven Barth
Am 25.09.2015 11:04 schrieb "Michael Schnell" :
>
> On 09/25/2015 03:52 AM, Bo Berglund wrote:
>>
>> If absolutely necessary I will have to set up the RPi with a monitor,
keyboard and mouse and install Lazarus and compile from there. But RPi is
not as powerful a computer as the PC and it will probably be very slow if
at all working
>
> "Lazarus" is the name for two completely different things
>
> 1) the IDE
> 2) the LCL library.

"Lazarus" is not the name of the LCL. "Lazarus" might be part of the name
"Lazarus Component Library", but it's not /the/ name. So please don't
introduce confusion where there is none.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Michael Schnell

On 09/25/2015 03:52 AM, Bo Berglund wrote:
If absolutely necessary I will have to set up the RPi with a monitor, 
keyboard and mouse and install Lazarus and compile from there. But RPi 
is not as powerful a computer as the PC and it will probably be very 
slow if at all working 

"Lazarus" is the name for two completely different things

1) the IDE
2) the LCL library.

If you just want to compile a project that needs the LCL, you don't need 
to start the IDE, but you can compile the project from the command line 
using just fpc.


-Michael
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Mark Morgan Lloyd

Bo Berglund wrote:

On Thu, 24 Sep 2015 09:48:32 -0400, Bo Berglund
 wrote:


I want to check my options regarding Lazarus and FPC.

If I develop a program on Windows Lazarus, move it to Debian Lazarus
(x86) and then finally want to compile on ARM on for example Raspberry
Pi but outside of Lazarus, how is that done?
Does FPC recognize the Lazarus project file such that paths etc are
observed?
Or is thare a separate file for FPC I have to prepare in order to set
the unit paths?


I see from some replies that I was not complete in my formulations...
What I wanted to ask was what steps I need to take in order to do the
final compilation on a *headless* ARM platform such as RaspBerry Pi2
where FPC has been installed but nothing else.
The development itself would be done in Lazarus (on Windows and
LinuxMint x86) in order to get the IDE help.
The application itself is a completely GUI-less program (the original
on Windows is a service application). It only needs the TCP/IP socket
functionality apart from the built-in processing of the application.
For this I am sure I also need threads.

So for clarity:
- Present code sits in Delphi on Windows
- I will first port it over to Lazarus/FPC on Windows as a console
program
- Then the next move is to go to Linux on the same platform (x86)
- Finally, when all is working I will need to compile on a headless
platform that does not have Lazarus installed (RPi2). THe only access
is SSH using PuTTY.


Does the program use any Lazarus or LCL (Lazarus Class Libraries) 
facilities? if not then you can simply use FPC from the command line, if 
necessary getting library paths etc. using Lazarus's "Show Options" button.



If absolutely necessary I will have to set up the RPi with a monitor,
keyboard and mouse and install Lazarus and compile from there. But RPi
is not as powerful a computer as the PC and it will probably be very
slow if at all working


Absolute rubbish. I've not tried logging into an RPi using VNC or 
(remote) X11 (i.e. XDMCP etc.) but it's entirely feasible to tunnel the 
IDE over SSH, or to do a command-line build (lazbuild) over SSH- I do 
this as routine. The only requirement is that the RPi must have enough 
RAM+swap set up if the program is of significant size... you'll know if 
you need it since you'll see messages about being unable to invoke the 
external assembler or linker.


You /do/ appreciate that you can tunnel the X11 user interface across 
SSH, and that most distreaux enable this by default, don't you?


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-25 Thread Graeme Geldenhuys
On 2015-09-25 02:52, Bo Berglund wrote:
> If absolutely necessary I will have to set up the RPi with a monitor,
> keyboard and mouse and install Lazarus and compile from there.

No need. Simply follow my instructions from my first reply in this
thread. Use the "show options" on your Linux system. Save those to a
file, tweak some paths to match your RPi, make the file executable on
the RPi and run.

Threads support under Unix-like systems is enabled by including the
cthreads unit as the first unit in your program.

uses
  {$IFDEF UNIX}
  cthreads,
  {$ENDIF}
  Classes,
  SysUtils,
  ...snip...


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Martin Schreiber
On Friday 25 September 2015 03:52:25 Bo Berglund wrote:
> On Thu, 24 Sep 2015 09:48:32 -0400, Bo Berglund
>
>  wrote:
> >I want to check my options regarding Lazarus and FPC.
> >
> >If I develop a program on Windows Lazarus, move it to Debian Lazarus
> >(x86) and then finally want to compile on ARM on for example Raspberry
> >Pi but outside of Lazarus, how is that done?
> >Does FPC recognize the Lazarus project file such that paths etc are
> >observed?
> >Or is thare a separate file for FPC I have to prepare in order to set
> >the unit paths?
>
> I see from some replies that I was not complete in my formulations...
> What I wanted to ask was what steps I need to take in order to do the
> final compilation on a *headless* ARM platform such as RaspBerry Pi2
> where FPC has been installed but nothing else.
> The development itself would be done in Lazarus (on Windows and
> LinuxMint x86) in order to get the IDE help.

Please remember my recommendation of cross development and debugging Linux X86 
PC -> Raspberry Pi with MSEide and cross FPC.

http://www.mail-archive.com/lazarus%40lists.lazarus.freepascal.org/msg50406.html

Martin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Bo Berglund
On Thu, 24 Sep 2015 09:48:32 -0400, Bo Berglund
 wrote:

>I want to check my options regarding Lazarus and FPC.
>
>If I develop a program on Windows Lazarus, move it to Debian Lazarus
>(x86) and then finally want to compile on ARM on for example Raspberry
>Pi but outside of Lazarus, how is that done?
>Does FPC recognize the Lazarus project file such that paths etc are
>observed?
>Or is thare a separate file for FPC I have to prepare in order to set
>the unit paths?

I see from some replies that I was not complete in my formulations...
What I wanted to ask was what steps I need to take in order to do the
final compilation on a *headless* ARM platform such as RaspBerry Pi2
where FPC has been installed but nothing else.
The development itself would be done in Lazarus (on Windows and
LinuxMint x86) in order to get the IDE help.
The application itself is a completely GUI-less program (the original
on Windows is a service application). It only needs the TCP/IP socket
functionality apart from the built-in processing of the application.
For this I am sure I also need threads.

So for clarity:
- Present code sits in Delphi on Windows
- I will first port it over to Lazarus/FPC on Windows as a console
program
- Then the next move is to go to Linux on the same platform (x86)
- Finally, when all is working I will need to compile on a headless
platform that does not have Lazarus installed (RPi2). THe only access
is SSH using PuTTY.

If absolutely necessary I will have to set up the RPi with a monitor,
keyboard and mouse and install Lazarus and compile from there. But RPi
is not as powerful a computer as the PC and it will probably be very
slow if at all working
 

-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Mattias Gaertner
On Thu, 24 Sep 2015 16:21:31 +0100
Graeme Geldenhuys  wrote:

> On 2015-09-24 16:14, Michael Van Canneyt wrote:
> > Since the projects in question are lazarus projects to begin with, this is 
> > a non-issue.
> 
> Yes for LCL based apps. If I had to be technical... Lazarus IDE can
> "manage" other non-LCL apps too, and those can include packages etc etc.
> So you still have a project file and such.  The original message in this
> thread never said it was a LCL application.  ;-) So Waldo's concern is
> still a valid point.
> 
> Is lazbuild a pure console application?

Yes.

> If so, no problem, but my guess
> is that it still uses the LCL somewhere (ie: NoGUI widget type).

Yes, it (still) needs some LCL units, but no gui libs.

> I've never used lazbuild personally, so I don't actually know.

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Sven Barth
Am 24.09.2015 18:00 schrieb "Tony Whyman" :
>
> Rather than going down the lazbuild path as others have suggested, you
might want to think about fpcmake and creating a "Makefile.fpc" for your
project. That should be the standard way of building a lazarus project just
using fpc.

In that case I'd suggest fpmake instead (especially since we've reduced the
dependency on fpcmake in 3.0.0 in favor of fpmake). The build script is a
Pascal program and no need for make, etc. at all.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Tony Whyman
Rather than going down the lazbuild path as others have suggested, you 
might want to think about fpcmake and creating a "Makefile.fpc" for your 
project. That should be the standard way of building a lazarus project 
just using fpc.


You will need to write a Makefile.fpc that does the same job as the 
lazarus .lpi file and include the LCL and components you use in the 
search paths but once you have done it once, its very easy to copy and 
paste to then next project. Here's a snippet that I often use:


[compiler]
options= -Scghi -O3 -CX -Xs -vewnhi -l -dUseCThreads -dLCL 
-dLCL$(INTERFACE)

unittargetdir=units/$(CPU_TARGET)-$(OS_TARGET)
unitdir= $(LZSOURCE) .

[target]
programs=myprogram

where I have defined under [prerules}

SRCDIR=/my/path/to/lazarus

LZSOURCE=\
$(SRCDIR)/lazarus/components/cairocanvas/lib/$(CPU_TARGET)-$(OS_TARGET)/$(INTERFACE) 
\
$(SRCDIR)/lazarus/components/lazcontrols/lib/$(CPU_TARGET)-$(OS_TARGET)/$(INTERFACE) 
\
$(SRCDIR)/lazarus/components/ideintf/units/$(CPU_TARGET)-$(OS_TARGET)/$(INTERFACE) 
\

$(SRCDIR)/lazarus/packager/units/$(CPU_TARGET)-$(OS_TARGET)/ \
$(SRCDIR)/lazarus/lcl/units/$(CPU_TARGET)-$(OS_TARGET)/ \
$(SRCDIR)/lazarus/components/lazutils/lib/$(CPU_TARGET)-$(OS_TARGET)/ \
$(SRCDIR)/lazarus/lcl/units/$(CPU_TARGET)-$(OS_TARGET)/$(INTERFACE) \
$(SRCDIR)/lazarus/components/memds/lib/$(CPU_TARGET)-$(OS_TARGET)/$(INTERFACE) 
\
$(SRCDIR)/lazarus/components/printers/lib/$(CPU_TARGET)-$(OS_TARGET)/$(INTERFACE) 



Note that this includes a few common components. You need to include the 
path to each component you are using which may vary from the above. The 
above also assumes that the components have already been compiled - 
which should be true if they are included in the IDE.


To build for a GTK2 target, you will then need to run:

export FPCDIR=/usr/lib/fpc/`fpc -iV`
fpcmake  Makefile.fpc
make INTERFACE=gtk2

If you are running on Windows then you will do something like:
FPCDIR=
fpcmake  Makefile.fpc
make INTERFACE=win32

I tend to perform Windows builds using a cross compiler on Linux, 
because its so much easier to script. The you will call something like:


export FPCDIR=/usr/lib/fpc/`fpc -iV`
fpcmake -r -Ti386-win32 Makefile.fpc
make OS_TARGET=win32 CPU_TARGET=i386 BINUTILSPREFIX=amd64-mingw32msvc- 
INTERFACE=win32


Tony Whyman
MWA



On 24/09/15 14:48, Bo Berglund wrote:

I want to check my options regarding Lazarus and FPC.

If I develop a program on Windows Lazarus, move it to Debian Lazarus
(x86) and then finally want to compile on ARM on for example Raspberry
Pi but outside of Lazarus, how is that done?
Does FPC recognize the Lazarus project file such that paths etc are
observed?
Or is thare a separate file for FPC I have to prepare in order to set
the unit paths?




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread waldo kitty

On 09/24/2015 11:14 AM, Michael Van Canneyt wrote:

On Thu, 24 Sep 2015, waldo kitty wrote:

On 09/24/2015 10:03 AM, Marco van de Voort wrote:

Lazarus has lazbuild to simply compile a project from the commandline.


but you have to have lazarus which is not available for all environments...

eg: OS/2


Since the projects in question are lazarus projects to begin with, this is a
non-issue.


one might think that but it is not always the case... i generally start a 
project in lazarus on winwhatever or *nix... even when it is destined solely for 
the OS/2 environment... are my projects started this way not "lazarus projects"? ;)


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Graeme Geldenhuys
On 2015-09-24 16:14, Michael Van Canneyt wrote:
> Since the projects in question are lazarus projects to begin with, this is a 
> non-issue.

Yes for LCL based apps. If I had to be technical... Lazarus IDE can
"manage" other non-LCL apps too, and those can include packages etc etc.
So you still have a project file and such.  The original message in this
thread never said it was a LCL application.  ;-) So Waldo's concern is
still a valid point.

Is lazbuild a pure console application? If so, no problem, but my guess
is that it still uses the LCL somewhere (ie: NoGUI widget type).  I've
never used lazbuild personally, so I don't actually know.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Michael Van Canneyt



On Thu, 24 Sep 2015, waldo kitty wrote:


On 09/24/2015 10:03 AM, Marco van de Voort wrote:

In our previous episode, Graeme Geldenhuys said:

No, FPC knows nothing about Lazarus project files. In Lazarus IDE you
can go to Project Options, and then click on the "Show Options" button
and the bottom of that dialog.  Copy and paste that into a shell script
which you can then run.

You would obviously have to adjust some paths.

Maximus IDE and MSEide makes this slightly easier than Lazarus. They
both have a similar "show options" button, but don't use "packages". So
the results they generate include every single Unit Path and Include
Path and other compiler settings you need to compile your project.


Lazarus has lazbuild to simply compile a project from the commandline.


but you have to have lazarus which is not available for all environments...

eg: OS/2


Since the projects in question are lazarus projects to begin with, this is a 
non-issue.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread waldo kitty

On 09/24/2015 10:03 AM, Marco van de Voort wrote:

In our previous episode, Graeme Geldenhuys said:

No, FPC knows nothing about Lazarus project files. In Lazarus IDE you
can go to Project Options, and then click on the "Show Options" button
and the bottom of that dialog.  Copy and paste that into a shell script
which you can then run.

You would obviously have to adjust some paths.

Maximus IDE and MSEide makes this slightly easier than Lazarus. They
both have a similar "show options" button, but don't use "packages". So
the results they generate include every single Unit Path and Include
Path and other compiler settings you need to compile your project.


Lazarus has lazbuild to simply compile a project from the commandline.


but you have to have lazarus which is not available for all environments...

eg: OS/2

--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread waldo kitty

On 09/24/2015 09:48 AM, Bo Berglund wrote:

I want to check my options regarding Lazarus and FPC.

If I develop a program on Windows Lazarus, move it to Debian Lazarus
(x86) and then finally want to compile on ARM on for example Raspberry
Pi but outside of Lazarus, how is that done?


the lpr file contains the initial pascal code for the project...


Does FPC recognize the Lazarus project file such that paths etc are
observed?


do you mean those in the lpi xml file? not as far as i know... it is extraneous 
outside of lazarus...



Or is thare a separate file for FPC I have to prepare in order to set
the unit paths?


i specify them on the command line or add them to the "local to the project" 
fpc.cfg file...


i have a few projects that i copy from winwhatever and *nix lazarus to OS/2 for 
compiling in that environment so i'm familiar with the situation because lazarus 
is not available for OS/2... i copy the lpr and any other code files... then 
possibly adjust a local fpc.cfg unless the system-wide one works for this 
project, and finally compile...


fpc -B myproject.lpr


i actually have a script that i build with so as to get a log if/when i need 
it...

= 4OS2 cmd script =

@echo off
if exist *.o   del /q *.o
if exist *.ppu del /q *.ppu
set fpcopts=-vehinw -B -CF64 -Fulibs\neededlib -omyprojectp.exe
iff '%1' eq '' .or. %@lower['%1'] eq 'debug' then
  set fpcopts=%fpcopts -ghl -dDEBUG
else
  set fpcopts=%fpcopts -dRELEASE
endiff
rem echo compiling command line to log file... '^' is escape in 4OS2 for literal 
chars

echo fpc %fpcopts myproject.lpr ^|^& tee /a builditp.log | tee builditp.log
echo. | tee /a builditp.log
echo on
rem execute compiling command line
fpc %fpcopts myproject.lpr |& tee /a builditp.log
@unset fpcopts

= /4OS2 cmd script =

--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Michael Van Canneyt



On Thu, 24 Sep 2015, Graeme Geldenhuys wrote:


On 2015-09-24 15:03, Marco van de Voort wrote:

Lazarus has lazbuild to simply compile a project from the commandline.



How is it going to know where to find packages if you haven't run the
Lazarus IDE and loaded those packages at least once? I'm thinking in
terms of a headless build-server.


Easy:

You just need to compile all packages once using lazbuild. That is enough.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread gabor

lazbuild has option "--add-package"

W dniu 2015-09-24 o 16:09, Graeme Geldenhuys pisze:

On 2015-09-24 15:03, Marco van de Voort wrote:

Lazarus has lazbuild to simply compile a project from the commandline.



How is it going to know where to find packages if you haven't run the
Lazarus IDE and loaded those packages at least once? I'm thinking in
terms of a headless build-server.


Regards,
   - Graeme -


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Graeme Geldenhuys
On 2015-09-24 15:03, Marco van de Voort wrote:
> Lazarus has lazbuild to simply compile a project from the commandline.


How is it going to know where to find packages if you haven't run the
Lazarus IDE and loaded those packages at least once? I'm thinking in
terms of a headless build-server.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> No, FPC knows nothing about Lazarus project files. In Lazarus IDE you
> can go to Project Options, and then click on the "Show Options" button
> and the bottom of that dialog.  Copy and paste that into a shell script
> which you can then run.
> 
> You would obviously have to adjust some paths.
> 
> Maximus IDE and MSEide makes this slightly easier than Lazarus. They
> both have a similar "show options" button, but don't use "packages". So
> the results they generate include every single Unit Path and Include
> Path and other compiler settings you need to compile your project.

Lazarus has lazbuild to simply compile a project from the commandline.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to compile Lazarus program using only FPC?

2015-09-24 Thread Graeme Geldenhuys
On 2015-09-24 14:48, Bo Berglund wrote:
> Does FPC recognize the Lazarus project file such that paths etc are
> observed?

No, FPC knows nothing about Lazarus project files. In Lazarus IDE you
can go to Project Options, and then click on the "Show Options" button
and the bottom of that dialog.  Copy and paste that into a shell script
which you can then run.

You would obviously have to adjust some paths.

Maximus IDE and MSEide makes this slightly easier than Lazarus. They
both have a similar "show options" button, but don't use "packages". So
the results they generate include every single Unit Path and Include
Path and other compiler settings you need to compile your project.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal