A mail formatter.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
1.4 KiB

  1. dnl ICP_CHECK_NOTCH_FUNCS
  2. dnl Check for various functions that may not be present
  3. dnl everywhere, and for which we provide a replacement.
  4. dnl
  5. AC_DEFUN([ICP_CHECK_NOTCH_FUNCS],[
  6. AC_CHECK_HEADERS([err.h], [], [AC_CONFIG_LINKS([err.h:lib/err.compat.h])])
  7. AC_REPLACE_FUNCS([asprintf err])
  8. AC_CHECK_DECLS([program_invocation_short_name], [],
  9. [AC_CHECK_FUNCS([getprogname setprogname], [],
  10. [AC_LIBOBJ([progname])])],
  11. [#include <errno.h>
  12. ])
  13. AH_BOTTOM([#include <compat.h>
  14. ])
  15. ])
  16. dnl ICP_CHECK_SANE_REALPATH([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  17. dnl Check for the realpath function. If it is available, then
  18. dnl check if it is safely usable.
  19. dnl
  20. AC_DEFUN([ICP_CHECK_SANE_REALPATH],[
  21. AC_CHECK_FUNCS([realpath])
  22. if test "x$ac_cv_func_realpath" = xyes ; then
  23. AC_MSG_CHECKING([whether realpath is POSIX.1-2008 compliant])
  24. AC_RUN_IFELSE(
  25. [AC_LANG_PROGRAM(
  26. [[#include <stdlib.h>]],
  27. [[
  28. char *p = NULL;
  29. p = realpath("/tmp", NULL);
  30. if ( p == NULL )
  31. return 1;
  32. else
  33. free(p);
  34. ]])],
  35. [AC_MSG_RESULT([yes])
  36. m4_default([$1], [AC_DEFINE([HAVE_SANE_REALPATH], [1],
  37. [Define to 1 if realpath is POSIX.1-2008 compliant.])])],
  38. [AC_MSG_RESULT([no])
  39. $2],
  40. [AC_MSG_RESULT([cross-compiling, assuming no])
  41. $2])
  42. else
  43. m4_default([$2], [:])
  44. fi
  45. ])