Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-07 Thread Henry Vermaak
On 7 June 2010 17:27, Mark Morgan Lloyd
 wrote:
> Henry Vermaak wrote:
>
>> Luckily, someone else has built mingw cross tools here:
>
> I was wondering. I abandoned Cygwin years ago- far too flaky.

Cygwin and mingw have different goals, if you don't need the unix
emulation, then you can get rid of the extra dependency by using
mingw.

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


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-07 Thread Mark Morgan Lloyd

Henry Vermaak wrote:


Luckily, someone else has built mingw cross tools here:


I was wondering. I abandoned Cygwin years ago- far too flaky.

--
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/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-07 Thread Andreas Berger

Sven Barth wrote:
Someone on Delphi-PRAXiS has prepared Linux VMs with OpenSUSE and a 
preinstalled Lazarus (and thus FPC). You need either VMWare (the 
Player is free) or VirtualBox (which can run such disks) to use it. 
Also its language is German, so you might need to change the language 
settings if you don't speak German (judging by your name only, I'd say 
yes, but names aren't everything ^^).


You can download them from here: 
http://bis-programmierung.de/downloads.php?cat=5&id=16
Thanks Sven, I will try this with VMPlayer. And, as you thought, German 
is no problem.


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


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-07 Thread Andreas Berger

Henry Vermaak wrote:

Luckily, someone else has built mingw cross tools here:

ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw

Thanks, I downloaded the package. However, I will try Sven's approach first.

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


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-06 Thread Sven Barth

Hi!

Am 04.06.2010 18:55, schrieb Andreas Berger:

I have a stable cgi program running in windows (no libraries - simple
writeln). However, our web host is in linux. Is there a simple way for
me to cross-compile the app? or is it easier to learn how to use linux
and do it there? I saw a page how to crosscompile lazarus, but it seamed
very complex.

P.S. fp.exe lets you select a linux output, but it doesn't work.



Someone on Delphi-PRAXiS has prepared Linux VMs with OpenSUSE and a 
preinstalled Lazarus (and thus FPC). You need either VMWare (the Player 
is free) or VirtualBox (which can run such disks) to use it. Also its 
language is German, so you might need to change the language settings if 
you don't speak German (judging by your name only, I'd say yes, but 
names aren't everything ^^).


You can download them from here: 
http://bis-programmierung.de/downloads.php?cat=5&id=16


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


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-05 Thread Henry Vermaak
On 5 June 2010 00:47, Henry Vermaak  wrote:
>
> It may be better building the whole compiler for the latest version of
> cygwin, but I'll see if I can scrape together the necessary files you
> can drop into your fpc bin directory for this to work (not that many).
>  I managed to get a simple writeln app to cross compile and run on
> linux.

Luckily, someone else has built mingw cross tools here:

ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/

You can download binutils-2.15-win32-i386-linux.zip and extract it
into your fpc bin directory.  After that it's just a matter of
recompiling your rtl and packages (if needed).  Let me know if you
need help with doing this.

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


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-04 Thread Henry Vermaak
On 4 June 2010 17:55, Andreas Berger  wrote:
> I have a stable cgi program running in windows (no libraries - simple
> writeln). However, our web host is in linux. Is there a simple way for me to
> cross-compile the app? or is it easier to learn how to use linux and do it
> there? I saw a page how to crosscompile lazarus, but it seamed very complex.
>
> P.S. fp.exe lets you select a linux output, but it doesn't work.

It's possible, but it's not really simple.  Some steps:

get cygwin
install some stuff like gcc, flex, bison, binutils-source, iconv
configure binutils with --target i386-linux and --prefix ~/somewhere
open bottle of wine
build binutils
drink bottle of wine (essential step)
binutils will be finished building now and you should have
i386-linux-* in prefix/bin
build fpc rtl and packages with OS_TARGET=linux, making sure you your
new cross binutils are on the path
(learn that fpc cygwin.dll isn't compatible with i386-linux-ld, copy
dll around and shuffle path)
???
profit!

It may be better building the whole compiler for the latest version of
cygwin, but I'll see if I can scrape together the necessary files you
can drop into your fpc bin directory for this to work (not that many).
 I managed to get a simple writeln app to cross compile and run on
linux.

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


Re: [fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-04 Thread David Emerson
Andreas Berger wrote:
> I have a stable cgi program running in windows (no libraries - simple 
> writeln). However, our web host is in linux. Is there a simple way for 
> me to cross-compile the app?

I haven't ever cross-compiled anything, but here's a start...

Looking here:
http://wiki.lazarus.freepascal.org/Cross_compiling
http://wiki.lazarus.freepascal.org/Cross_compiling#To_Linux_2

...it looks like it may be tricky to do win->linux. I am guessing it is 
possible... hopefully someone more knowledgeable will give you some tips on 
this list... and perhaps the wiki will get fleshed out some day.

> or is it easier to learn how to use linux and do it there?

honestly, this may be the easiest option.

If you have ssh access to the web host and an fp compiler is (or can be) 
installed there, then you could just upload your sources to the host and 
compile them there. Check out putty or ttssh.

Alternately you could just install linux on a machine somewhere, or if that's 
tricky, install virtualbox with a linux guest and use that.

> I saw a page how to crosscompile lazarus, but it seamed very complex.

Well, lazarus is very complex, so cross compiling it will be complex. Your 
program will probably be easier to cross compile if it does not use so many of 
fpc's and LCL's capabilities and libraries.

> P.S. fp.exe lets you select a linux output, but it doesn't work.

probably because some other stuff needs to be configured, some of which is 
noted 
in the cross compiling wiki instructions above.

~David.

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


[fpc-pascal] Crosscompile FPC from Win32 to Linux

2010-06-04 Thread Andreas Berger
I have a stable cgi program running in windows (no libraries - simple 
writeln). However, our web host is in linux. Is there a simple way for 
me to cross-compile the app? or is it easier to learn how to use linux 
and do it there? I saw a page how to crosscompile lazarus, but it seamed 
very complex.


P.S. fp.exe lets you select a linux output, but it doesn't work.

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