简体   繁体   中英

How can I call MacPorts' GCC from Xcode? I'm also on an obsolete system

I'm trying to go back into programming after a few years break. I also want to try this C++11 stuff. So I installed GCC 4.6 from MacPorts. However, I still want to use Xcode. I remember that I once tinkered with custom compilers, like creating a custom command line tool in one target and using that tool to create custom documentation in another target. Can we get Xcode, both the compiling and debugging systems, to use the newer stuff from MacPorts? (I would adjust these per project so I can use the default tools on other projects, including Mac apps.) I would use the newer stuff to build command-line tools, like testing Boost.

Oh, by the way, I'm still on my obsolete system (August-2002 eMac with a G4 processor) stuck on Mac OS X 10.4 Tiger. So any answers have to be for Xcode 2.5! (I guess you could provide answers for Xcode 3.x and 4.x to help others, but realize that those will be useless for me.) As a key for the speed, MacPorts took over 2 days straight to build GCC 4.6!

Well, I certainly haven't tested any of this stuff on 10.4 or Xcode 2.5, but I did recently get GCC 4.6 working in Xcode 4.2. In 3.6 and 4.2 there are some compiler template XML files that you can modify once you install a new compiler. In 4.2 they are here:

/Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/

In 3.6 the are in /Developer/Library/Xcode/Plug-ins

I have no idea if they exist in 2.5, but they might. If you want the details on how I did this with a more recent version you can find them here:

http://thecoderslife.blogspot.com/2015/07/building-with-gcc-46-and-xcode-4.html

It might help give you some ideas on where to start with the older version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM