# swlist
...
gcc 4.2.3 gcc
libgcc 4.2.3 libgcc
m4 1.4.16 m4
make 3.82 make
# /usr/local/bin/ruby extconf.rb --with-zlib-include=/usr/local/include --with-zlib-lib=/usr/local/lib
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib1... no
checking for deflateReset() in -lzlib... no
checking for deflateReset() in -lzdll... no
(There's probably a better one somewhere but that's the one I used.)
The +b option is used by the linker to embed a library path list in the executable for use at run time. However, if passing these options via CC or GCC then the option should be -Wl,+b. The mkmf.log file shows, however, that an unknown option +b is being passed directly to gcc.
After running configure I made the following change in config.status -
However, the make step still doesn't run properly because now -Wl,+b gets passed to ld, which is also wrong.
Thus after the make step has finished I made another change -
cd ext/zlib
mv Makefile Makefile.orig
sed -e 's#^LIBPATH.*$#LIBPATH = -L. -L$(topdir) -L/usr/local/lib +b/usr/local/lib#' Makefile.orig >Makefile
make
cd ../..
That works fine. Then cd ../.. and make install and the zlib extension is installed.
Someone who understands how all this stuff works better than I do can hopefully turn this into an actual patch.