[fedora-classroom] Introductory workshop on GNU autotools

Bruno Wolff III bruno at wolff.to
Mon May 3 14:19:20 UTC 2010


On Mon, May 03, 2010 at 18:55:51 +0530,
  Siddhesh Poyarekar <siddhesh.poyarekar at gmail.com> wrote:
> 
> If you want to be really generic (which is the point of autotools
> anyway), you can use the AC_CHECK_LIB macro to check for presence of
> the library in question (libm, libX11). So you will have:

That's kind of where I was going with this. Though in many cases it makes
more sense to do a simple Makefile.{in,am} patch rather than rerunning
autotools and carrying a much larger patch. But for upstreaming, that
does seem like a better solution.

> 
> AC_CHECK_LIB([m], [sin],,[AC_MSG_ERROR("No libm present")])
> AC_CHECK_LIB([X11], [XOpenDisplay],,[AC_MSG_ERROR("No libX11 present")])
> 
> This does the check and adds the required flags to LDFLAGS if present.
> If not, it returns an error.

Thanks. I was suppecting there was something like this.


More information about the classroom mailing list