def _lib(self, name, only_if_have=False):
emit = True<EOL>if only_if_have:<EOL><INDENT>emit = self.env.get('<STR_LIT>' + self.env_key(name))<EOL><DEDENT>if emit:<EOL><INDENT>return '<STR_LIT>' + name<EOL><DEDENT>return '<STR_LIT>'<EOL>
Specify a linker library.

        Example:

            LDFLAGS={{ lib("rt") }} {{ lib("pthread", True) }}

        Will unconditionally add `-lrt` and check the environment if the key
        `HAVE_LIBPTHREAD` is set to be true, then add `-lpthread`.