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.m4 < prev    next >
Text File  |  1998-04-24  |  1KB  |  43 lines

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