PDA

View Full Version : Installing GCC Without All of Xcode




akindo
Nov 7, 2008, 06:53 PM
Hi fellow programmers on OS X. I just got a new Leopard install up and running on my 76GB HD. I need gcc and gdb plus all libraries for C and C++ programming, but am not keen on installing all of Xcode because, a. it takes up about 2.5GB on my small HD, b. I will use Emacs and gdb instead of the Xcode IDE.

I read here http://forums.macrumors.com/showthread.php?t=374259 about a guy who modified the Xcode installer to just install gcc. Does anyone know how I can do a similar modification to get gcc and gdb plus the libraries? Is it simply a matter of deleting packages from the diskimage? And if so, which package contains gdb and the libraries?

Thanks a lot for any help. :apple:



bdoyle
Nov 7, 2008, 07:17 PM
I was able to install gcc 4.2 (no xcode) from the 'dmg' found on the "apple developers connection" "developers tools" download page. I could not find 'ddd' so I downloaded the source code and built it myself. No problem. Works good.

Here is a link to the software:
http://adcdownload.apple.com/Developer_Tools/gcc_4.2_developer_preview_1/gcc42preview1.dmg

NeoMayhem
Nov 7, 2008, 10:13 PM
Do a custom install and uncheck everything but the compilers. This was not an option before Leopard, and I was very excited to see it added.

akindo
Nov 8, 2008, 08:22 AM
Thanks for the help guys.

bdoyle: Thanks for that, had a look at the Developer Tools download page on Apple dev. I found gcc, also thanks to your link, but not gdb. I have previously tried to compile the gdb sources on OS X without success and was told on the gdb IRC channel that those sources are not for OS X/powerpc. Is there any other way to get gdb?

NeoMayhem: I had a second look at the install for Xcode 3.1.1 and cannot find a custom install option. There is a page where you can uncheck some options, but it is not possible to uncheck the core Xcode tools, which take up 2GB.

NeoMayhem
Nov 8, 2008, 03:08 PM
Did you download xcode or are you installing it off the DVD that came with your mac?

I am positive I was able to just install the compilers. I was surprised to see it an option, because it never was in the past.

What I used to do was just install the whole thing, and then delete the /Developer Folder. GCC and everything else is installed in system folders, so this just removes xcode and the documentation.

akindo
Nov 10, 2008, 09:40 AM
I installed it from the downloaded dmg, as this is the newest version.

Good tip regarding installing everything and then removing the /Developer dir, think I will do that then.

hunter3740
Mar 9, 2009, 09:27 AM
I installed it from the downloaded dmg, as this is the newest version.

Good tip regarding installing everything and then removing the /Developer dir, think I will do that then.


Uninstall xcode and remove the /Developer directory in one command (i.e. don't just delete the folder; and note, this is referenced in the aboutxcodetools.pdf inside the xcode312.dmg you downloaded from connect.apple.com):
/Developer/Library/uninstall-devtools --mode=all

You can then just install gcc from that same xcodetools.dmg, inside the Packages folder (i.e. don't use the main XcodeTools.mpkg, but Packages/gcc4.2.pkg).