]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
5d629532 | 2 | dnl Networking stuff for CUPS. |
ef416fc2 | 3 | dnl |
5d629532 MS |
4 | dnl Copyright 2007-2014 by Apple Inc. |
5 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. | |
ef416fc2 | 6 | dnl |
5d629532 MS |
7 | dnl These coded instructions, statements, and computer programs are the |
8 | dnl property of Apple Inc. and are protected by Federal copyright | |
9 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
10 | dnl which should have been included with this file. If this file is | |
11 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 12 | dnl |
13 | ||
abcf1647 MS |
14 | AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,[ |
15 | #include <sys/socket.h> | |
758c3b30 | 16 | #include <netinet/in.h> |
c70c3561 MS |
17 | #include <arpa/inet.h> |
18 | #include <netinet/in_systm.h> | |
abcf1647 | 19 | #include <netinet/ip.h>]) |
ef416fc2 | 20 | AC_SEARCH_LIBS(socket, socket) |
21 | AC_SEARCH_LIBS(gethostbyaddr, nsl) | |
ef416fc2 | 22 | AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS)) |
ef416fc2 | 23 | AC_SEARCH_LIBS(hstrerror, nsl socket resolv, AC_DEFINE(HAVE_HSTRERROR)) |
24 | AC_SEARCH_LIBS(rresvport_af, nsl, AC_DEFINE(HAVE_RRESVPORT_AF)) | |
49d87452 MS |
25 | AC_SEARCH_LIBS(__res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT), |
26 | AC_SEARCH_LIBS(res_9_init, resolv bind, AC_DEFINE(HAVE_RES_INIT), | |
27 | AC_SEARCH_LIBS(res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT)))) | |
ef416fc2 | 28 | |
2abf387c | 29 | # Tru64 5.1b leaks file descriptors with these functions; disable until |
30 | # we can come up with a test for this... | |
31 | if test "$uname" != "OSF1"; then | |
32 | AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO)) | |
33 | AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO)) | |
34 | fi | |
35 | ||
ef416fc2 | 36 | AC_CHECK_MEMBER(struct sockaddr.sa_len,,, [#include <sys/socket.h>]) |
37 | AC_CHECK_HEADER(sys/sockio.h, AC_DEFINE(HAVE_SYS_SOCKIO_H)) | |
38 | ||
ef416fc2 | 39 | CUPS_DEFAULT_DOMAINSOCKET="" |
40 | ||
41 | dnl Domain socket support... | |
42 | AC_ARG_WITH(domainsocket, [ --with-domainsocket set unix domain socket name], | |
43 | default_domainsocket="$withval", | |
44 | default_domainsocket="") | |
45 | ||
46 | if test x$enable_domainsocket != xno -a x$default_domainsocket != xno; then | |
47 | if test "x$default_domainsocket" = x; then | |
48 | case "$uname" in | |
49 | Darwin*) | |
50 | # Darwin and MaxOS X do their own thing... | |
51 | CUPS_DEFAULT_DOMAINSOCKET="$localstatedir/run/cupsd" | |
52 | ;; | |
53 | *) | |
54 | # All others use FHS standard... | |
55 | CUPS_DEFAULT_DOMAINSOCKET="$CUPS_STATEDIR/cups.sock" | |
56 | ;; | |
57 | esac | |
58 | else | |
59 | CUPS_DEFAULT_DOMAINSOCKET="$default_domainsocket" | |
60 | fi | |
61 | ||
62 | CUPS_LISTEN_DOMAINSOCKET="Listen $CUPS_DEFAULT_DOMAINSOCKET" | |
63 | ||
64 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_DOMAINSOCKET, "$CUPS_DEFAULT_DOMAINSOCKET") | |
65 | else | |
66 | CUPS_LISTEN_DOMAINSOCKET="" | |
67 | fi | |
68 | ||
69 | AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET) | |
70 | AC_SUBST(CUPS_LISTEN_DOMAINSOCKET) |