Name

mk_try_link — Try to compile and link a code snippet

Synopsis

MODULES="... compiler ..."

mk_try_link CODE=code

Options

HEADERDEPS=hdeps

An optional list of headers which should be included if they are available.

LIBDEPS=ldeps

An optional list of libraries which should be linked.

Description

Wraps code in a main() function and attempts to compile it. Returns 0 (logical true) if it succeeds and 1 (logical false) otherwise.