Cross compiling

Discussion in 'Mac Programming' started by DenBeke, May 3, 2013.

  1. macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #1
    Can I compile apps for FreeBSD on my Mac?
    What do I need to do that?
     
  2. macrumors 6502a

    Joined:
    Sep 17, 2007
    #2
    You're better off setting up a FreeBSD virtual machine, in VirtualBox or something, and compiling directly on FreeBSD.
     
  3. thread starter macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
  4. macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #4
    For the most part, configuring, building, and installing open-source software is almost exactly the same.

    That being said, you most likely will run into dependancies, and that can cause headaches.

    The best way to install open-source software is to use a package manager, like MacPorts. There's also Homebrew, which I haven't tried, and Fink, which I don't know if it supports 64-bit builds in most of their packages.
     
  5. thread starter macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #5
    of course, but I need(ed) to compile for FreeBSD...
     
  6. macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #6
    What, specifically, did you need from FreeBSD? OS X does have some BSD code in it.
     
  7. macrumors 6502a

    Joined:
    Jun 2, 2008
    #7
    It sounds like you want to do the compile on your Mac, and then have a binary come out that will run on FreeBSD. Right?

    That IS possible. Last time I did it (Linux compiling for AIX) it took building GCC from source and then the various libraries. It was not a small effort. Today, I would agree with the suggestion earlier to install FreeBSD on a vm and compile there. Much more straightforward and fewer headaches.
     
  8. thread starter macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #8
    It's for a server, in the datacenter...

    Indeed...
     
  9. macrumors 6502

    Joined:
    Mar 8, 2004
    #9
    Cross compiling from OS X is popular with Raspberry Pi hackers (though typically cross compiling Linux/Linux executables). You might want to check their forum.
     

Share This Page