1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- AC_DEFUN([AX_CHECK_LIBRARY], [
- AC_ARG_VAR($1[_CPPFLAGS], [C preprocessor flags for ]$1[ headers])
- AC_ARG_VAR($1[_LDFLAGS], [linker flags for ]$1[ libraries])
- AC_CACHE_VAL(AS_TR_SH([ax_cv_have_]$1),
- [save_CPPFLAGS="$CPPFLAGS"
- save_LDFLAGS="$LDFLAGS"
- save_LIBS="$LIBS"
- AS_IF([test "x$]$1[_CPPFLAGS" != "x"],
- [CPPFLAGS="$CPPFLAGS $]$1[_CPPFLAGS"])
- AS_IF([test "x$]$1[_LDFLAGS" != "x"],
- [LDFLAGS="$LDFLAGS $]$1[_LDFLAGS"])
- AC_CHECK_HEADER($2, [
- AC_CHECK_LIB($3, [main],
- [AS_TR_SH([ax_cv_have_]$1)=yes],
- [AS_TR_SH([ax_cv_have_]$1)=no])
- ], [AS_TR_SH([ax_cv_have_]$1)=no])
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ])
- AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"],
- AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found])
- [$4],
- [$5])
- ])
|