If you really mean "everything in Xcode", it's not possible. However, if you're just talking about the command-line tools (which is more likely) it may be possible, but it sounds like a terrible idea. If you're not writing Mac or iOS applications, the Xcode application itself may not be of interest to you.
Clarifying what you're actually hoping to accomplish with the minimal set of tools you plan to end up with would help us provide a better answer. The fact that you mention arm-bintools
leads me to guess you may be hoping to develop iOS apps — and I'll echo the warnings from the comments that you'd be asking for pain and not gaining anything appreciable. I understand wanting to reduce disk usage, but shelling out for a larger hard drive will be much less expensive than the extra time you'd spend just trying to do what Xcode does. (Not just the setup cost, but loss of productivity in daily usage.)
BTW, one reason that the gcc version in Xcode may lag behind the one in MacPorts is because Apple is extremely invested in replacing gcc
with clang-llvm
, which you'll find is vastly faster and under more active development.
Edit in response to OP:
Given the clarification that the intent is to only develop scientific computing code, there's another option. You still want to install Xcode to get all the command-line tools, but you may be able to get rid of Xcode and the other GUI apps you don't care to use.
When running the Xcode installer, pause on the Installation Type screen — check "UNIX Development" and uncheck everything else you can. This will install components into /System/Library
and /usr
. (You can see the full list of files by selecting File > Show Files within the installer and expanding the UNIX Development sub-package.) The Essentials package (which is a required install) will install into a location of your choosing (default is /Developer
) which can be deleted after the install completes. The extra Mac-related stuff installed in /System/Library
is small enough (an order of magnitutde smaller than the Essentials package) that I'd recommend just leaving /System
alone altogether.
This should leave you with the Xcode-provided artifacts in /usr/bin
, /usr/lib
, /usr/include
, /usr/share/man
, etc. and allow you to build whatever custom tools you need. I recommend building them into /usr/local/*
to keep them from conflicting with existing tools. Good luck!