Newbie Question re: XcodeLegacy

Discussion in 'Mac Programming' started by Hack5190, Dec 15, 2015.

  1. Hack5190 macrumors 6502a

    Hack5190

    Joined:
    Oct 21, 2015
    Location:
    Stuck on Earth in the USA
    #1
    I'm a total Xcode novice and have never used or installed it before. The goal is to compile code that will run on a PowerPC. Trying to use a machine thats faster than a G5 running a newer version of OS X than Leopard using a newer version of Xcode.

    Searching the web there are many guides, I've tried a few but none of have worked. Today I decided to try the XcodeLegacy script (https://github.com/devernay/xcodelegacy).

    The documentation tells you to download Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1 , Xcode 6.4 (and I have). Then it says "install them in Xcode 4/5/6/7". Here is where I'm in need of some guidance . . .

    1) I didn't download anything with 7 (Xcode 7)
    2) Xcode 3 isn't doesn't (apparently) get installed
    3) Where to install these versions of Xcode? Do I use the default path?
     
  2. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    PPC support was dropped in Xcode 4.x. That was also when all of the different tools were combined into a single application instead of using the root level Developer folder. You don't mention what OS you are using, but Xcode 3.2.6 in Snow Leopard will generate PPC/universal applications.
     
  3. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    An older Mac with a Core 2 Duo processor (or a VM on a newer Mac) that can boot Snow Leopard should be able to run Xcode 3 and 4. Any newer OS X or Xcode can't run any Apple PPC compilers.

    Xcode 7 can be download from the Mac App store on any recent Mac.
     
  4. chown33, Dec 15, 2015
    Last edited: Dec 15, 2015

    chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    The linked GitHub site does NOT say to install the multiple Xcodes. Here's what it says:
    Description

    Many components were removed in recent versions of Xcode, the most notable being the Mac OS X 10.6 SDK, which is required to build software using the Carbon API (such as wxWidgets 2.8).

    I made the script XcodeLegacy.sh to extract these components (the links work if you sign in to Apple Developer first) from Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1 , Xcode 6.4 and install them in Xcode 4/5/6/7:
    ...
    First, notice the heading is Description. There's a separate heading for Usage, which is where the usage instructions are given.

    Second, the 2nd sentence of the description doesn't tell you to install those versions of Xcode. It tells you that the script XcodeLegacy.sh was written to do that.

    Here's the sentence with the parenthetical phrase crossed out, and some bolding to show the main parts of the sentence:
    I made the script XcodeLegacy.sh to extract these components (the links work if you sign in to Apple Developer first) from Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1 , Xcode 6.4 and install them in Xcode 4/5/6/7:
    There's not a lot of details given, and I did glance through the script. It's pretty dense, so I can't easily check what it's expecting as inputs, except by reading the rather terse Usage info. I'd have to play around with it to figure it out, since the docs are so weak. This isn't atypical for tools aimed at active developers.


    If you've never used Xcode before, you should probably learn the basics before undertaking the PPC-target task.

    I think you're trying to accomplish something that's well beyond your current skill level, and the tools you might encounter to help you are also intended for developers with more expertise.

    The PPC target will still be there after you learn how to use Xcode and how it's structured.

    Honestly, I don't think many active developers will be interested in targeting a G5, because it's a dead machine. It may have interest to tinkerers and collectors of antiques, but as a serious target worth spending significant time and effort developing for, I don't see the point.

    I have a dual G4 parked in a closet, with 10.4.11 and Xcode 2.something on it. It hasn't been out of the closet in years. I could get rid of it, but that would take some effort, and I'd have to replace it with a table or something to hold the old printers that are also sitting in the closet.

    There are websites aimed toward obsolete Macs that may be more fruitful, but I think the percentage of visitors that are developers will be quite thin. Anyone serious about development has long since moved on.

    Sorry if any of the above sounds harsh. Developing for obsolete machines is not going to be easy. Be prepared for difficulty and failure.


    I don't understand the purpose behind targeting a G5 from a machine that's clearly more capable than the G5 itself. Why not use the G5 itself?

    If you've explained your goal and the overall plan before, I'm afraid I missed it, so could you repost it?
     
  5. Hack5190 thread starter macrumors 6502a

    Hack5190

    Joined:
    Oct 21, 2015
    Location:
    Stuck on Earth in the USA
    #5
    chown33 thanks for the feedback. I'm going to give XcodeLegacy.sh install a try after I install Xcode 7 on a Yosemite (VM).....

    As for the task being beyond my current skill level, (in the words of Yoda) of that there is no doubt. The good news is that being a former programmer I'm confident my skill level can grow to meet the challenge. Understand I have no plans to develop ground up programs, just modify / recompile things for the PPC. I'm viewing it as a new hobby that as you noted will have it's share of difficulty and failure.

    Why do I want to do development on a dedicated, newer platform? 1) My G5 only has dual 1.8GHz cpu's I like to keep it clean w/minimal installs (and background tasks) to avoid impacting performance. 2) The possibility of compiling programs to run on my newer systems (Yosemite & El Capitan) using the same Xcode interface and tools.

    Until I find the right mix of versions (OS-X & Xcode) and install procedures the development system will be virtual. After everything's worked out I plan to build a dedicated physical machine.
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    You can address these in different ways.

    1. Install Xcode on the G5 to an external drive. In fact, since the G5 tower has internal drive bays, it'd be a secondary disk drive mounted internally. You can unmount this drive if you want, but there's no performance cost in keeping it mounted at all times.

    Xcode has no hidden background tasks (daemons). If you aren't running it, it just sits there on disk.


    2. For many years, maybe even since Xcode 1.0, an Xcode project can have its source code files located outside the primary project folder.

    I routinely put my source code into a "src" sub-folder within the project folder. This helps me to isolate the source files from other supplementary files belonging to a project. If "src" is a symlink, then the actual source files can be anywhere. If the source files are added to the Xcode project as "relative to project", then you can move the whole project folder around and it'll keep working.

    So if "src" is a symlink, the source files on the G5 can actually reside on a file-sharing server, i.e. the unnamed "machine thats faster than a G5 running a newer version of OS X than Leopard". All the Power Mac G5's have gigabit ethernet, which is more than fast enough for file editing.

    On the server machine itself, those same source files can be stored in the primary project folder of an Xcode 7 project. Share the HD they reside on, and connect to that HD from the G5.

    With this arrangement, you'd have two project folders, one on the G5, the other on the server. Each would contain an Xcode X.Y project-file appropriate for the resident version of Xcode. The "src" dir on the G5 would point to source files on the server. The Xcode projects would be specific to the resident platform, but the source files would be common to both.

    This arrangement DOESN'T address non-code files, meaning nibs, xibs, etc. AFAIK there isn't a single universal format for those that would be usable by Xcode versions that far apart. There might be one, though, so it's worthwhile to experiment, once you get some Xcode experience.
     
  7. firewood, Dec 16, 2015
    Last edited: Dec 16, 2015

    firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #7
    Not really possible. Or possibly a fools errand that will eat man weeks of time.

    The old Xcode has a slightly different interface and very different tools, won't run on new Macs, won't build apps with the newer OS X SDKs/APIs, and won't codesign apps properly. Any newer Xcode installs won't build PPC apps and won't run on old Macs. Two different Xcode installs on two different OS X versions are the only reasonable solution. Xcode 3 on 10.6.8, and Xcode 7.x on 10.11 are likely the easiest best bet, no install scripts required. The project file formats are also slightly different, so 2 different set of projects will likely be required (although it may be possible to use common source code on both with a lot of ifdefs). An internal or external SSD drive on the PPC Mac will help speed up Xcode builds.

    My solution, which may be the only one, is to keep an old Mac that has a bootable 10.6.8 partition with an old Xcode on it, in addition to my newer MacBooks. Unless you can figure out how to run a 10.6.8 VM on a newer Mac (I tried once, but it was slow and unstable). Or you want to spends a few man-years building an LLVM back-end for PPC (plus a linker, and etc.)
     
  8. Hack5190 thread starter macrumors 6502a

    Hack5190

    Joined:
    Oct 21, 2015
    Location:
    Stuck on Earth in the USA
    #8
    Update: This project hasn't gotten much attention since I used XcodeLegacy to set up a dev environment in Yosemite. Over the weekend I compiled some PPC code from the command line. Hopefully I will get chance to test Xcode soon.
     

Share This Page