File: ac_inet_funcs.m4

package info (click to toggle)
mailsync 5.2.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze
  • size: 772 kB
  • ctags: 187
  • sloc: cpp: 2,103; ansic: 107; makefile: 86; sh: 9
file content (26 lines) | stat: -rw-r--r-- 569 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dnl AC_INET_FUNCS([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
dnl Output:
dnl  -l* added to LIBS
AC_DEFUN(AC_INET_FUNCS,[
 no_connect="no"
 no_gethostbyname="no"
 AC_CHECK_FUNC(connect,,[
  AC_CHECK_LIB(socket,connect,,[
   AC_CHECK_LIB(inet,connect,,[
    no_connect="yes"
   ])
  ])
 ])
 AC_CHECK_FUNC(gethostbyname,,[
  AC_CHECK_LIB(nsl_s,gethostbyname,,[
   AC_CHECK_LIB(nsl,gethostbyname,,[
    no_gethostbyname="yes"
   ])
  ])
 ])
 if test "$no_gethostbyname" = "yes" -o "$no_connect" = "yes" ; then
  ifelse([$2], , :, [$2])
 else
  ifelse([$1], , :, [$1])
 fi
])