Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-07

Cosscompiling

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andreas K. Foerster

Hello,

is it possible to set up FPC as Cosscompiler?

I mainly use Linux, but I also want to write Apps for Linux AND Windows. At the moment I always copy the pas code from the Linux partition to the Win partion, reboot under Windows and compile it there... And when it doesn't work, I have to reboot Linux again. (Linux progs don't run from a Win partition - so I can't simply do anything on the Win partition)

So, can I compile Win Apps under Linux? - Of course it should still be possible to compile for native Linux.

And how can I get Windows Apps to start up in fullscreen-mode?

Ulrich Floer
to Andreas K. Foerster
"Andreas K. Foerster" wrote 13 lines
Hello, is it possible to set up FPC as Cosscompiler? I mainly use Linux, but I also want to write Apps for Linux AND Windows. At the moment I always copy the pas code from the Linux partition to the Win partion, reboot under Windows and compile it there... And when it doesn't work, I have to reboot Linux again. (Linux progs don't run from a Win partition - so I can't simply do anything on the Win partition) So, can I compile Win Apps under Linux? - Of course it should still be possible to compile for native Linux.

Hi Andreas..

I use Linux in comination with Samba and VmWare !
The win-emulation is quite slowly, but is works fine. I use the same source tree in Samba.
Uli

Andreas K. Foerster
to Ulrich Floer
Ulrich Floer wrote
I use Linux in comination with Samba and VmWare !

Hmmm, my computer is much too weak for that.
And I didn't want to use perhaps I'll try FPC with wine.

Tschuess Andreas
Arne Hanssen
to Andreas K. Foerster: is it possible to set up FPC as Cosscompiler? I mainly use Linux, but I also want to…

Thus spoke Andreas K. Foerster ():

Is it possible to set up FPC as Crosscompiler? I mainly use Linux, but I also want to write Apps for Linux AND Windows.

It should be possible, but I don't know how to set it up... I have exactly the same needs as you, so an "ultimate" answer to this is indeed appreciated! :-)

Vennlig hilsen / Best regards |\ ___,,--, _ Arne Hanssen, Senja, Norway /,`--'' \-,,__,'/ http://home.enitel.no/ahh |,4 ) )_ ) /~-----' http://home.c2i.net/bkgras -----'---^~(_/-_)--(_/_)-------
Peter Vreman
Show quoted text 8 lines
Thus spoke Andreas K. Foerster (): > Is it possible to set up FPC as Crosscompiler? > I mainly use Linux, but I also want to write Apps for Linux AND Windows. It should be possible, but I don't know how to set it up... I have exactly the same needs as you, so an "ultimate" answer to this is indeed appreciated! :-)

You need a cross-assembler and cross-linker. You can place those in a new directory and the use -FD<directory where the crosstools are>

Marco van de Voort
to Andreas K. Foerster: Hmmm, my computer is much too weak for that. And I didn't want to use perhaps I'll try…
Show quoted text 8 lines
Ulrich Floer wrote: > I use Linux in comination with Samba and VmWare ! Hmmm, my computer is much too weak for that. And I didn't want to use Windows at all. But perhaps I'll try FPC with wine.

I uploaded static Linux <-> Cygwin binutils to the contrib directory on the main FTP site.

Be warned, it is big though (4.7 MB bzip2'ed), because it is static.

OTOH, it works on all distro's then. Even libc ones.

The only problem is that they are for cygwin, so it is possible they default link in cygwin32.dll.

I tried to make i586-pc-win32, but configure didn't know it.

Andreas K. Foerster

Hello,
sorry for posting in german.

[making Win32 programs under Linux]

Sebastian Günther wrote 34 lines
(sorry, ich kann derzeit nicht direkt an die Mailing-Liste schreiben, wegen etwas bescheuerter Anti-Spam-Filterregeln dort. Hat aber auch den Vorteil daß ich nicht auf Englisch schreiben brauche ;) ) Cross-Compiling ist durchaus möglich, erfordert aber etwas Handarbeit. Zunächst muß man die binutils für das Zielsystem kompilieren: Also binutils-Sources installieren, und dann folgendermaßen konfigurieren: ./configure --target=i686-pc-cygwin dann entsprechend 'make' und so weiter aufrufen. (aber nicht "make install"!) Es entstehen ein paar Binaries im Source-Verzeichnis, die man dann umbenennen muß. Folgende Tools werden von FPC benötigt: gas/as-new -> asw ld/ld-new -> ldw binutils/dlltool -> dlltool binutils/strip-new -> stripw binutils/ar -> arw windres -> (bleibt "windres") asw, ldw, dlltool, stripw, arw und windres würde ich dann nach /usr/local/bin kopieren. Der FPC-Compiler selbst kann in der Linux-Version standardmäßig keine Windoof-Programme erstellen, dazu muß er mit den Optionen "-uNOAG386INT -uNOAG386BIN" kompiliert werden. (evtl. ist auch "-dnotargetsolaris" noch immer notwendig, einfach mal ausprobieren...). Das wäre es dann auch fast: Um nun von Linux aus Windows-Programme zu erzeugen, muß man bei direkten ppc386-Aufruf die Option "-TWin32" angeben, oder bei Verwendung von Makefiles "OS_TARGET=win32". So, das sollte doch erstmal ausreichen. Das Erstellen eines eigenen Compilers ist vielleicht etwas mühselig, wenn man das noch nie vorher gemacht hat, aber da muß man durch ;)

Uff, das ist doch wesentlich komplizierter, als ich dachte. Da bleib ich lieber beim neu booten.

P.S.: Auch mein Versuch mit wine war zum weinen. Der Compiler lief zwar, aber der Linker war das "missing link".