I have been trying to replace everything in xcode with stuff I can get from macports. So far, I installed xcode, then macports, then used macports to install gcc, gcc_select, gmake, elf-bintools, bintools, arm-bintools (just to be sure I replaced all the bintools), and then uninstalled all of xcode. I then linked /usr/bin/make开发者_如何学JAVA with /opt/local/bin/gmake and used gcc_select to select gcc44--the one from macports. I also exported all the bintool executable paths into the .profile path.
I was sure this would work (although I should have known better after working on it for 48 hours straight), but nothing will configure, and the log files all have the common error: :info:configure configure: error: C compiler cannot create executables
I have a feeling it has something to do with libraries, but I am really not sure.
I use a mac 10.5.8.
If this is truely 'impossible', what parts of xcode to I need for macports to work? For example, I can uninstall the xcode folder without a problem.
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!
You can't do this as macports needs Xcode.
There are some macports that use a macports gcc - but most use Apple tools.
One issue you may be running into is that OSX doesn't use ELF binaries, so elf-bintools is probably not helping much...
Another way would be to use Gentoo prefix as the port system. This tries to use only code from itself so you end up using less Apple code which seems to be what you want/
精彩评论