Q:

Error compiling libreadline with gcc on on Mac

I'm new on MAC systems, I'm having troubles to compile with gcc, in this case libreadline. 
The error I get is:
 make
test -d shlib || mkdir shlib
( cd shlib ; make  all )
rm -f libreadline.5.1.dylib
gcc -dynamic -arch_only `/usr/bin/arch` -install_name /usr/local/lib/libreadline.5.1.dylib -current_version 5.1 -compatibility_version 5 -v -o libreadline.5.1.dylib readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so compat.so -lncurses
Using built-in specs. 
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
i686-apple-darwin10-gcc-4.2.1: -compatibility_version only allowed with -dynamiclib
make[1]: *** [libreadline.5.1.dylib] Error 1
make: [shared] Error 2 (ignored)

A:

I found the solution here:
http://techdebug.com/blog/2009/01/03/compiling-readline-on-an-osx-105-intel-x86_64/

