Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
Sign in to follow this  
Eric Petit

Mini-Guide: Porting Transmission to Mac OS X x86

2 posts in this topic

Recommended Posts

Porting Transmission to Mac OS X x86


Transmission website


This is the first time I release an application as a Universal Binary, here is how it happened... Transmission is a small application, but what is true for small apps probably applies to the big ones. I hope this might be of some help to other devs.


Endianness issues

All messages in the BitTorrent protocol store values in network order (big endian). This was the only potential endianness issue in Transmission, which is not an issue if you just use the ntohl / htonl / etc functions when required. This was straightforward to me because I run Transmission on BeOS and Linux (x86) too, but you never know, there may be PPC-addicts around who assume it will always run on a big endian CPU.


Updating my Jamfile

Because Transmission is multi platform, only the GUI is built with Xcode. The core routines are first compiled into a static library, libtransmission.a, using a Jamfile (if you don't know what jam is, here you go). The command-line version of Transmission is built from the Jamfile too.

Just add the proper compiler flags (-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386) and linker flags (-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk) and you can start compiling universal binaries.

One issue though: Jamfiles, and probably many Makefiles too, use 'ar' to archive static libraries. This doesn't work with universal binaries. On OS X, you need to replace the jam or make rule so it runs 'libtool -static foo.o bar.o -o libfoo.o' instead of 'ar ru libfoo.a foo.o bar.o'. Now you get a static library for both architectures.


Updating the Xcode project

Not much too say here, just do what Apple writes in its "Universal Binary Programming Guidelines": choose the MacOSX10.4u SDK, click to build for both PPC and Intel.


That's it!

Transmission 0.3 was released as a UB, and I hear it works fine on x86...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.