Go to the first, previous, next, last section, table of contents.

Library Files

The following macros check for the presence of certain C library archive files.

Macro: AC_CHECK_LIB (library, function [, action-if-found [, action-if-not-found [, other-libraries]]])
Try to ensure that C function function is available by checking whether a test C program can be linked with the library library to get the function. library is the base name of the library; e.g., to check for `-lmp', use `mp' as the library argument.

action-if-found is a list of shell commands to run if the link with the library succeeds; action-if-not-found is a list of shell commands to run if the link fails. If action-if-found and action-if-not-found are not specified, the default action is to add `-llibrary' to LIBS and define `HAVE_LIBlibrary' (in all capitals).

If linking with library results in unresolved symbols, which would be resolved by linking with additional libraries, give those libraries as the other-libraries argument, separated by spaces: `-lXt -lX11'. Otherwise this macro will fail to detect that library is present, because linking the test program will always fail with unresolved symbols.

Macro: AC_HAVE_LIBRARY (library, [, action-if-found [, action-if-not-found [, other-libraries]]])
This macro is equivalent to calling AC_CHECK_LIB with a function argument of main. In addition, library can be written as any of `foo', `-lfoo', or `libfoo.a'. In all of those cases, the compiler is passed `-lfoo'. However, library can not be a shell variable; it must be a literal name. This macro is considered obsolete.


Go to the first, previous, next, last section, table of contents.