Is there a way to install gcc in OSX without installing Xcode?

后端 未结 9 1192
囚心锁ツ
囚心锁ツ 2020-11-28 06:54

I\'ve googled the hell out of it, and it seems like there is no way to install gcc on OS X without installing Xcode (which takes at leats 1.5GB of space). All I need is gcc

相关标签:
9条回答
  • 2020-11-28 07:25

    I'm fairly certain that this is not possible. However, I'm also not sure if you need the whole developer suite to get the developer tools installed. Quite a few tools get installed along with XCode that might be optional. However, I think you're out of luck for not needing to bite the bullet and use wget or DownThemAll or some other download manager that will let you slowly download the developer tools in chunks.

    Whenever I install OS X I install the developer tools as a rule, just because it opens up the world of available software tremendously. Perhaps you should consider doing this in the future as well.

    0 讨论(0)
  • 2020-11-28 07:28

    The first thing you want to try is called Pacifist - what Pacifist lets you do is to open a large package (such as XCode) and to access parts of it directly. I'm pretty sure you'll be able to find a smaller package inside the XCode package that just has gcc.

    HOWEVER it's not clear to me that this is the best route. If you are planning to do Cocoa or Carbon developing I strongly suggest installing the entire package because you will need all the documentation and headers. If you're only planning on doing command-line stuff, you still may find you need to poke around inside XCode to identify all the packages you will need - things such as libraries, headers, man pages and so on.

    All in all you're probably still better off installing the whole thing - if HD space is really tight (because you're on a tiny old iMac for example) then look at tools like Monolingual - Monolingual removes all the international support from all the various OS X applications, which can easily reduce the size of an application by 50%.

    0 讨论(0)
  • 2020-11-28 07:30

    Try the osx-gcc-installer on github.

    0 讨论(0)
  • 2020-11-28 07:37

    I found this googling around that appears to install it without XCode.

    0 讨论(0)
  • 2020-11-28 07:39

    I've been doing this for a long time, and I've done things like this, and I've concluded it's simply never worth doing. :-(

    The reason is that no one expects you to do such things, so there are assumptions all over the system that "everything" is there. You might not run into this today - or worse, you might not even realize later that this is the cause of your issues.

    Instead of wasting your smart time on things like this which don't actually produce any working code you can use, following the approved method, run the download overnight, and spend your time instead on planning and writing the top-level code (you shouldn't need a compiler for that anyway!)

    0 讨论(0)
  • 2020-11-28 07:39

    There's fink and MacPorts, if you want an easy installer/updater.

    0 讨论(0)
提交回复
热议问题