I'm writing a C extension for Ruby, and I have something like this in the extconf.rb file:
if(not have_library('z')) $stderr << "Error, could not locate zlib.\n" abort "Missing zlib" end
So the installation process aborts if zlib is missing. Instead, since my extension can work with AND without zlib, I would like to do something like the following;
if(have_library('z')) # do something so that -DHAVE_ZLIB is passed to the compiler # when compiling the extension. end
How can I do that?
EDIT: The question is on the comment in the if...end statement: how to add the -DHAVE_ZLIB definition for the compiler?