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.

41 lines
1.2 KiB

11 years ago
  1. # inet_ntop.m4 serial 19
  2. dnl Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. AC_DEFUN([ss_FUNC_INET_NTOP],
  7. [
  8. AC_REQUIRE([AC_C_RESTRICT])
  9. dnl Most platforms that provide inet_ntop define it in libc.
  10. dnl Solaris 8..10 provide inet_ntop in libnsl instead.
  11. dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
  12. HAVE_INET_NTOP=1
  13. INET_NTOP_LIB=
  14. ss_save_LIBS=$LIBS
  15. AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
  16. [AC_CHECK_FUNCS([inet_ntop])
  17. if test $ac_cv_func_inet_ntop = no; then
  18. HAVE_INET_NTOP=0
  19. fi
  20. ])
  21. LIBS=$ss_save_LIBS
  22. if test "$ac_cv_search_inet_ntop" != "no" \
  23. && test "$ac_cv_search_inet_ntop" != "none required"; then
  24. INET_NTOP_LIB="$ac_cv_search_inet_ntop"
  25. fi
  26. AC_CHECK_HEADERS_ONCE([netdb.h])
  27. AC_CHECK_DECLS([inet_ntop],,,
  28. [[#include <arpa/inet.h>
  29. #if HAVE_NETDB_H
  30. # include <netdb.h>
  31. #endif
  32. ]])
  33. if test $ac_cv_have_decl_inet_ntop = no; then
  34. HAVE_DECL_INET_NTOP=0
  35. fi
  36. AC_SUBST([INET_NTOP_LIB])
  37. ])