Compiling for other OS's
Compiling for other OS's
Well, I have had purebasic for quite some time now, and I know very well that I can download the versions for other OS's, but im curious, do I need the version of purebasic for that operating system in order to compile them? Or can I use the windows version of the compiler for MacOS and Linux? If so, how can I?
-
Brice Manuel
-
Brice Manuel
-
merihevonen
- Enthusiast

- Posts: 326
- Joined: Mon Jan 01, 2007 7:20 pm
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
An i-mac can be bought for about £100 on ebay. Not an x86 version, but still able to compile PureBasic programs on.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
merihevonen
- Enthusiast

- Posts: 326
- Joined: Mon Jan 01, 2007 7:20 pm
But let's be realistic: It would be cool to "compile for all" from just one Operating System, so you wouldn't need to go through the hassle of creating an eBay account and buying stuff that you probably won't use much
But a Compile-To-Linux-From-PureBasic-For-Windows function would be very positive to build, because I don't see anything to come in way :roll:
But a Compile-To-Linux-From-PureBasic-For-Windows function would be very positive to build, because I don't see anything to come in way :roll:
-
DarkDragon
- Addict

- Posts: 2347
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Yes, afaik FASM can do it, but Fred can't as he said.merihevonen wrote:But let's be realistic: It would be cool to "compile for all" from just one Operating System, so you wouldn't need to go through the hassle of creating an eBay account and buying stuff that you probably won't use much![]()
But a Compile-To-Linux-From-PureBasic-For-Windows function would be very positive to build, because I don't see anything to come in way :roll:
bye,
Daniel
Daniel
To cross-compile, you need:
in the package, but also all OS libs. Now for windows this is easy, they are
included in the package anyway, but to compile on windows for linux for example, we would
have to include the libraries for the glibc, gtk (including all depencancies), sdl etc
in the windows version as well.
Apart from the fact that this is much to big a hassle for us to set up and maintain,
the next update would probably be about a hundred megs in size.
Cross-Compiling makes sense for languages who base their commands on their
own crossplatform toolkit, so there is only one big library to link in and thats it.
PureBasic uses directly the API of each OS, giving your program a native
look and feel on every OS with a very low executable size, but the price to pay are the dependencies on
the OS libraries (or on linux 3rd party toolkits like gtk) that make cross-compiling a nightmare (if not impossible)
Another effect of this is that the program might react a little different on each OS,
due to the usual differences between the OS.
(for example the default font size with gtk is usually much larger than the windows one)
So it is not a good idea to blindly compile a program for linux once it runs
on windows without even a single short test on the target OS.
Well, and if you need the OS for tests anyway, you can as well compile the program there.
This of course is different if a language uses its own toolkit
with the same font, same sizes etc on each OS and especially
with only minimal dependancies on other OS-specific libs.
That is where cross-compiling makes sense, but this is simply not what PB
is supposed to be.
To sum it up:
Due to the way PB is designed, cross-compiling does not really make sense.
- A cross-platform assembler (the smallest problem)
- A cross-platform linker
- All libraries needed to link for all OS (here it gets tough)
in the package, but also all OS libs. Now for windows this is easy, they are
included in the package anyway, but to compile on windows for linux for example, we would
have to include the libraries for the glibc, gtk (including all depencancies), sdl etc
in the windows version as well.
Apart from the fact that this is much to big a hassle for us to set up and maintain,
the next update would probably be about a hundred megs in size.
Cross-Compiling makes sense for languages who base their commands on their
own crossplatform toolkit, so there is only one big library to link in and thats it.
PureBasic uses directly the API of each OS, giving your program a native
look and feel on every OS with a very low executable size, but the price to pay are the dependencies on
the OS libraries (or on linux 3rd party toolkits like gtk) that make cross-compiling a nightmare (if not impossible)
Another effect of this is that the program might react a little different on each OS,
due to the usual differences between the OS.
(for example the default font size with gtk is usually much larger than the windows one)
So it is not a good idea to blindly compile a program for linux once it runs
on windows without even a single short test on the target OS.
Well, and if you need the OS for tests anyway, you can as well compile the program there.
This of course is different if a language uses its own toolkit
with the same font, same sizes etc on each OS and especially
with only minimal dependancies on other OS-specific libs.
That is where cross-compiling makes sense, but this is simply not what PB
is supposed to be.
To sum it up:
Due to the way PB is designed, cross-compiling does not really make sense.
quidquid Latine dictum sit altum videtur
Testing isnt an issue, I can send the compiled program with me to college and use the iBooks there, im running Ubuntu linux as it is so linux isnt an issue, but as I said im trying to compile for Mac, cant be done from windows = major problems. Can i emulate mac in any way if I can get my hands on a legal OS for it?
There is the pearpc emulator: http://pearpc.sourceforge.net/
Also qemu can emulate a ppc processor: http://fabrice.bellard.free.fr/qemu/index.html
I did not try any of them though.
Remember that OSX 10.2 is the minimum requirement for PB if you try to get a cheap old version.
Also qemu can emulate a ppc processor: http://fabrice.bellard.free.fr/qemu/index.html
I did not try any of them though.
Remember that OSX 10.2 is the minimum requirement for PB if you try to get a cheap old version.
quidquid Latine dictum sit altum videtur

