Making a universal binary with two separate libraries

Discussion in 'Mac Programming' started by Pedantic, Jun 20, 2007.

  1. Pedantic macrumors newbie

    Joined:
    Apr 2, 2007
    #1
    http://images.macrumors.com/vb/images/smilies/blackapple.gif Hi All:

    This is an advanced question, I admit. I have a plugin that uses MySQL and I need to build a universal binary for it. The problem is that the library I link to for PowerPC is different from the library I link to for Intel Mac. It seems that when the actual link takes place, one or the other of the libraries is ignored.

    How can I get both libraries noticed and paired up with the correct binary when I link the plugin?

    TIA!
    John
     
  2. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #2
    obviously the simplest solution is to make an Intel Target and a PPC target linking to the respective libraries, but other than that I have no idea how you could do what you want, someone more knowledgeable may.
     
  3. Krevnik macrumors 68040

    Krevnik

    Joined:
    Sep 8, 2003
    #3
    That is actually the right way to go.

    After that, you need to use lipo (I think that is the name of the tool) to merge the two binaries into a Universal binary.

    If you want to get fancy, you can create a third custom target (dependent on the other two) which runs a script to do the merge. That way you can just build this custom target and get a universal binary out the other end.
     

Share This Page