Tag Archives: osx

Build libcurl as a universal binary

I release one of the projects from work as a universal binary on OS X.  Up until tomorrow that mean just i386 and ppc.  With snow leopard, it looks like it’ll be a good idea to support the 64-bit architectures as well, especially considering its an ODBC driver I’m working on and the native apps running at 64-bit will want to talk to it that way.

Since we used a lot of open source libraries to save us time, I need to have those built super-universal as well.  The first one I tackled was curl, which had some issues due to configure, so I had to write a shell script to do the hardwork for me.  It needs to run configure three times, and I got a lot of the information for it from http://curl.haxx.se/mail/lib-2009-05/0000.html.

#!/bin/sh
export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cp include/curl/curlbuild.h include/curl/curlbuild32.h

make distclean

export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch x86_64 -arch ppc64"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cp include/curl/curlbuild.h include/curl/curlbuild64.h

make distclean

export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64 -arch ppc64"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cat > include/curl/curlbuild.h <

There will be more of these as I build the other dependencies.

iTunes keeps syncing the same 44 songs OVER and OVER: SOLVED!

iTunesRight as OS 3.0 came out  iTunesfor the iPhone and just after the latest version of iTunes was release a problem sprung up for me.  Without making any changes to any of my music files, iTunes would resync the same 44 songs to the iPhone on every sync.  I finally had some time to track it down.  Well, in truth, it finally annoyed me enough to find a fix.

It turns out the problems were broken id3 tags.  Now, if you ask me how they were broken, I honestly have no idea.  What I ended up doing is for mp3s that still had v1 tags, I removed the v1 tags.  My first thought was it was mp3s where v1 tags didn’t match v2 tags.  I used the excellent command line tool id3v2 to strip off the v1 tags, and then revisited the songs in iTunes information panel to make sure iTunes’s database matched what the songs now looked like.  Sync the iPhone, disconnect the iPhone, reconnect the iPhone, sync again, and boom, those files weren’t synced again.  Rinse and repeat until all were fixed until…

I ended up finding that a few of the 44 only had v2 tags, so it wasn’t the v1 tags alone.  On a whim I tried this fix which seemed to work: In iTunes I converted the v2 tags from say, version 2.3 to 2.2 and back, do the sync, rinse and repeat dance from above and that seemed to fix it.

On a related note, I found an excellent OS X only iTunes utility that does two very cool things I had been doing by hand: adding album art and lyrics.  Actually, I hadn’t been adding lyrics, but I’m considering it now that there is an easy way to do it.  The cool it called GimmieSomeTune.  What makes its album art gathering go above and beyond the iTunes’s native searching of the iTunes store is that if its not in the iTunes store, it’ll try to gather the album art from Amazon.  Amazon’s art has been hit and miss in terms of quality, but I prefer to have something there rather than the empty music symbol.  (You can also create your own default that will be put in place if iTunes can’t find it in either place.)  It also has some interesting features like last.fm integration, but I haven’t had a chance to play with that yet.