From: Iain Barnett Date: 2011-03-26T08:40:55+09:00 Subject: Re: mkmf have_func usage On 25 Mar 2011, at 22:11, Ryan Davis wrote: >> >> have_library: checking for iconv_open() in -liconv... -------------------- yes Mine fails on this check, and I suspect it's due to this set of hard-coded paths: HEADER_DIRS = [ # First search /opt/local for macports '/opt/local/include', # Then search /usr/local for people that installed from source '/usr/local/include', # Check the ruby install locations INCLUDEDIR, # Finally fall back to /usr '/usr/include', '/usr/include/libxml2', ] LIB_DIRS = [ # First search /opt/local for macports '/opt/local/lib', # Then search /usr/local for people that installed from source '/usr/local/lib', # Check the ruby install locations LIBDIR, # Finally fall back to /usr '/usr/lib', ] XML2_HEADER_DIRS = [ '/opt/local/include/libxml2', '/usr/local/include/libxml2', File.join(INCLUDEDIR, "libxml2") ] + HEADER_DIRS end I've no idea why assumptions like this are made when variables like PATH, C_INCLUDE_PATH, and DYLD_LIBRARY_PATH/LD_LIBRARY_PATH/DYLD_FALLBACK_LIBRARY_PATH exist exactly to avoid this and allow people to set up their systems to their own liking? Having said that, even if I pass these in it fails unless I use find_library in place of have_library in the extconf.rb, and even then I get more problems. I'll keep hacking away. More comments in the code of both the mkmf and nokogiri libs would've been nice too (since I'm having a moan). Regards, Iain