O'Reilly logo

Autotools by John Calcote

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Supporting Optional Features and Packages

I've discussed the different ways to handle situations when a pthreads library exists and when it doesn't. But what if a user wants to build a single-threaded version of jupiter when the pthreads library is installed? We certainly don't want to add a note to Jupiter's README file telling the user to rename his pthreads libraries!

Autoconf provides two macros for working with optional features and external software packages: AC_ARG_ENABLE and AC_ARG_WITH. Their prototypes are as follows:

AC_ARG_WITH(package, help-string, [action-if-given], [action-if-not-given])
AC_ARG_ENABLE(feature, help-string, [action-if-given], [action-if-not-given])

As with many Autoconf macros, these two may be used simply to set some ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required