If you can rely on checking for a header file then have_header
will define a HAVE_HEADER_H
macro for you. For example:
have_header('zlib.h')
will define HAVE_ZLIB_H
, which you can then refer to in your code.
If this isn’t enough or you need to define a macro for some other reason you can use the $defs
global:
if(have_library('z'))
$defs << '-DHAVE_ZLIB'
# Now HAVE_ZLIB will be defined for you to check in your code
end