I hope it's not too off topic on a Rails forum, but I spent so much
time on this I thought I should share it here - hopefully it will help
I had to compile a 32bit (i386) version of Ruby 1.8.7 on Snow Leopard
(my app is using a 32bit only lib). So I configured the compilation as
./configure CFLAGS="-arch i386 -D_XOPEN_SOURCE=1" LDFLAGS="-arch i386"
It seems to me that's the standard way to do this... but it doesn't
work. Indeed, the "-arch i386" param is not passed to a cc call during
the compilation (the compilation fails since it uses a 64bit version
of a lib, instead of the 32 one).
I manually updated the Makefile (after executing ./configure with the
LDSHARED = cc -arch i386 -dynamiclib -undefined suppress -
(adding -arch i386)
and the compilation worked fine.