inet_ntop.m4 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # inet_ntop.m4 serial 9
  2. dnl Copyright (C) 2005, 2006, 2008, 2009 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([gl_INET_NTOP],
  7. [
  8. dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
  9. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
  10. gl_REPLACE_ARPA_INET_H
  11. dnl The AC_SEARCH_LIBS call is a hack to persuade the Solaris 8 linker to
  12. dnl find inet_ntop.
  13. dnl
  14. dnl It is the responsibility of gl_INET_NTOP's caller to arrange for
  15. dnl -lnsl if it is needed. Normally -lnsl is not needed on Solaris 8,
  16. dnl since inet_ntop is needed only by getaddrinfo, and getaddrinfo
  17. dnl isn't built on Solaris 8.
  18. gl_save_LIBS=$LIBS
  19. AC_SEARCH_LIBS([inet_ntop], [nsl], [],
  20. [AC_REPLACE_FUNCS([inet_ntop])])
  21. LIBS=$gl_save_LIBS
  22. gl_PREREQ_INET_NTOP
  23. ])
  24. # Prerequisites of lib/inet_ntop.c.
  25. AC_DEFUN([gl_PREREQ_INET_NTOP], [
  26. AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
  27. if test $ac_cv_have_decl_inet_ntop = no; then
  28. HAVE_DECL_INET_NTOP=0
  29. fi
  30. AC_REQUIRE([gl_SOCKET_FAMILIES])
  31. AC_REQUIRE([AC_C_RESTRICT])
  32. ])