Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-12-2014, 04:45 AM
|
#1
|
Member
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Linux Mint
Posts: 45
Rep:
|
Cross-compiling for OS X
I've recently started using x86_64 Linux Mint 17, and decided to try building some of my software (games and little things) on there. I quickly got my x86_64 Linux builds working. I then decided (WHY) to try to figure out how to build for other OSes from here, with the thought of only having to build on one machine in the back of my mind.
My engine currently builds for Windows (x86 and x86_64), Linux (x86 and x86_64), OS X (x86_64), and Android (arm, armv7a, x86). Until today, I had a 64-bit Windows install, a 32-bit Linux install, a 64-bit Linux install, and a 64-bit OS X install used for building. I use gcc for Linux, mingw for Windows, clang for OS X, and gcc (via the NDK) for Android.
So naturally, being able to build all from one place would be AWESOME. I had zero experience with building for different platforms or architectures (excepting Android, which is done through the NDK and so I didn't really have to do anything there) before today.
I have so far managed:
gcc compiles x86_64 and x86 Linux binaries
gcc-mingw-w64 compiles x86_64 and x86 Windows binaries
I am now trying to figure out if there is any way to compile OS X binaries on Linux. I was hoping to discover some sort of gcc-apple-darwin or something along those lines. Is there anything like this that I've just missed?
|
|
|
10-13-2014, 03:09 PM
|
#2
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
|
|
|
10-17-2014, 05:17 AM
|
#3
|
Member
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Linux Mint
Posts: 45
Original Poster
Rep:
|
Quote:
Originally Posted by knudfl
|
Well, of cours I'd Googled it before I came here! The link you posted appears to be for pascal (I may have forgotten to specify what language I'm working in, but it's c++), and it doesn't support recent/x86_64 OS X it seems.
I did however discover this: https://github.com/tpoechtrager/osxcross
You download that project, package an OS X SDK (on OS X), bring it over to Linux, and run a script that the project comes with. It builds a full compiler setup for you that works in Linux. It is amazing, and its creator is my hero.
It took hours of playing around with build options (Mainly boost, holy crap it did not want to build with this compiler. I ended up having to dig deep into the .jam files. Most of my libraries built fine without issue), but I was able to build an OS X binary, and it ran on my OS X machine! Woo!
|
|
|
All times are GMT -5. The time now is 09:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|