home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lzop-1.00.tar.gz / lzop-1.00.tar / lzop-1.00 / acconfig / m4 / chkfunc.org < prev    next >
Text File  |  1998-04-24  |  1KB  |  42 lines

  1. dnl ### Checking for library functions
  2.  
  3.  
  4. dnl AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  5. AC_DEFUN(AC_CHECK_FUNC,
  6. [AC_MSG_CHECKING([for $1])
  7. AC_CACHE_VAL(ac_cv_func_$1,
  8. [AC_TRY_LINK(
  9. dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
  10. dnl which includes <sys/select.h> which contains a prototype for
  11. dnl select.  Similarly for bzero.
  12. [/* System header to define __stub macros and hopefully few prototypes,
  13.     which can conflict with char $1(); below.  */
  14. #include <assert.h>
  15. /* Override any gcc2 internal prototype to avoid an error.  */
  16. ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  17. extern "C"
  18. #endif
  19. ])dnl
  20. [/* We use char because int might match the return type of a gcc2
  21.     builtin and then its argument prototype would still apply.  */
  22. char $1();
  23. ], [
  24. /* The GNU C library defines this for functions which it implements
  25.     to always fail with ENOSYS.  Some functions are actually named
  26.     something starting with __ and the normal name is an alias.  */
  27. #if defined (__stub_$1) || defined (__stub___$1)
  28. choke me
  29. #else
  30. $1();
  31. #endif
  32. ], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
  33. if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
  34.   AC_MSG_RESULT(yes)
  35.   ifelse([$2], , :, [$2])
  36. else
  37.   AC_MSG_RESULT(no)
  38. ifelse([$3], , , [$3
  39. ])dnl
  40. fi
  41. ])
  42.