1e1275ab3fd25a452f2285512813a9a0ec11273a
[gnulib.git] / m4 / canon-host.m4
1 # canon-host.m4 serial 6
2 dnl Copyright (C) 2002, 2003, 2004, 2005 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
7 AC_DEFUN([gl_CANON_HOST],
8 [
9   AC_LIBSOURCES([canon-host.c])
10   AC_LIBOBJ([canon-host])
11
12   dnl Prerequisites of lib/canon-host.c.
13   AC_CHECK_HEADERS_ONCE(unistd.h)
14   AC_CHECK_HEADERS(netdb.h sys/socket.h netinet/in.h arpa/inet.h)
15
16   dnl Add any libraries as early as possible.
17   dnl In particular, inet_ntoa needs -lnsl at least on Solaris 2.5.1,
18   dnl so we have to add -lnsl to LIBS before checking for that function.
19   AC_SEARCH_LIBS(gethostbyname, [inet nsl])
20
21   dnl These come from -lnsl on Solaris 2.5.1.
22   AC_CHECK_FUNCS(getaddrinfo gethostbyname gethostbyaddr inet_ntoa)
23 ])