PageRenderTime 23ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/kame/kame/mdnsd/configure.in

https://github.com/kame/kame
Autoconf | 158 lines | 78 code | 14 blank | 66 comment | 0 complexity | fe55adc432c42f95918ca18461e4b5a3 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(mdnsd.c)
  3. dnl Checks for programs.
  4. AC_PROG_INSTALL
  5. AC_PROG_MAKE_SET
  6. AC_PROG_CC
  7. AC_PROG_CPP
  8. dnl Checks for libraries.
  9. dnl AC_CHECK_LIB(c, kvm_open, [], [AC_CHECK_LIB(kvm, kvm_open)])
  10. dnl AC_CHECK_LIB(mld, nlist)
  11. dnl pcap library
  12. dnl CFLAGS="-I. $CFLAGS"
  13. dnl AC_MSG_CHECKING(for pcap library/header)
  14. dnl for dir in /usr/local/libpcap /usr/local/v6 /usr/local \
  15. dnl ../libpcap* ../../libpcap*; do
  16. dnl ac_cv_pcap_lib=no
  17. dnl ac_cv_pcap_include=no
  18. dnl if test -d $dir -a -f $dir/libpcap.a; then
  19. dnl ac_cv_pcap_lib="$dir"
  20. dnl elif test -d $dir/lib -a -f $dir/lib/libpcap.a; then
  21. dnl ac_cv_pcap_lib="$dir/lib"
  22. dnl fi
  23. dnl if test -d $dir -a -f $dir/pcap.h; then
  24. dnl ac_cv_pcap_include="$dir"
  25. dnl elif test -d $dir/include -a -f $dir/include/pcap.h; then
  26. dnl ac_cv_pcap_include="$dir/include"
  27. dnl fi
  28. dnl if test "$ac_cv_pcap_lib" != "no" -a "$ac_cv_pcap_include" != "no"; then
  29. dnl LIBS="-L$ac_cv_pcap_lib $LIBS"
  30. dnl CFLAGS="-I$ac_cv_pcap_include $CFLAGS"
  31. dnl break
  32. dnl fi
  33. dnl done
  34. dnl if test "$ac_cv_pcap_lib" = "no" -a "$ac_cv_pcap_include" = "no"; then
  35. dnl AC_MSG_RESULT(no)
  36. dnl else
  37. dnl AC_MSG_RESULT($ac_cv_pcap_lib and $ac_cv_pcap_include)
  38. dnl fi
  39. dnl AC_CHECK_LIB(pcap, pcap_lookupdev, [],
  40. dnl [echo "Fatal: libpcap.a not found"
  41. dnl exit 1])
  42. dnl AC_TRY_COMPILE([#include <pcap.h>], [], [], [dnl
  43. dnl echo "Fatal: pcap.h not found"
  44. dnl exit 1])
  45. CFLAGS="$CFLAGS -I\$(srcdir)"
  46. AC_MSG_CHECKING(for getaddrinfo/getnameinfo library)
  47. AC_EGREP_CPP(yes,
  48. [#include <netinet/in.h>
  49. #ifdef __KAME__
  50. yes
  51. #endif], [result=kame])
  52. AC_MSG_RESULT($result)
  53. case $result in
  54. kame) AC_DEFINE(INET6)
  55. o_LIBS="$LIBS"
  56. LIBS="$LIBS -L/usr/local/v6/lib"
  57. AC_CHECK_LIB(inet6, getaddrinfo, [], [LIBS="$o_LIBS"])
  58. ;;
  59. *) ;;
  60. esac
  61. AC_REPLACE_FUNCS(getaddrinfo)
  62. AC_REPLACE_FUNCS(getnameinfo)
  63. AC_REPLACE_FUNCS(getifaddrs)
  64. AC_CHECK_FUNCS(if_nametoindex)
  65. dnl Checks for header files.
  66. AC_HEADER_STDC
  67. AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h syslog.h unistd.h ifaddrs.h)
  68. AC_MSG_CHECKING(for socklen_t)
  69. AC_TRY_COMPILE([#include <sys/types.h>
  70. #include <sys/socket.h>],
  71. [socklen_t x; x = 1; return x;],
  72. [AC_MSG_RESULT(yes)],
  73. [AC_MSG_RESULT(no)
  74. AC_CHECK_TYPE(socklen_t, unsigned int)])
  75. AC_MSG_CHECKING(for sa_len)
  76. AC_TRY_COMPILE([#include <sys/types.h>
  77. #include <sys/socket.h>],
  78. [struct sockaddr sa; sa.sa_len = sizeof(sa); return sa.sa_len; ],
  79. [AC_MSG_RESULT(yes)
  80. AC_DEFINE(HAVE_SA_LEN)],
  81. [AC_MSG_RESULT(no)])
  82. dnl Checks for typedefs, structures, and compiler characteristics.
  83. AC_C_CONST
  84. AC_TYPE_SIZE_T
  85. AC_HEADER_TIME
  86. AC_STRUCT_TM
  87. AC_STRUCT_TIMEZONE
  88. dnl Checks for library functions.
  89. AC_FUNC_GETPGRP
  90. AC_PROG_GCC_TRADITIONAL
  91. AC_FUNC_SETPGRP
  92. AC_TYPE_SIGNAL
  93. AC_CHECK_FUNCS(mktime select socket arc4random)
  94. AC_MSG_CHECKING(for IPv6 resolver type)
  95. AC_TRY_COMPILE(dnl
  96. [#include <sys/types.h>
  97. #include <sys/socket.h>
  98. #include <netinet/in.h>
  99. #include <resolv.h>], [_res_ext.nsaddr_list[0].__ss_family = 1;],
  100. [AC_DEFINE(RESOLVER_KAME)
  101. resolver=kame],
  102. [AC_TRY_COMPILE(dnl
  103. [#include <sys/types.h>
  104. #include <sys/socket.h>
  105. #include <netinet/in.h>
  106. #include <resolv.h>], [_res_ext.nsaddr_list[0].ss_family = 1;],
  107. [AC_DEFINE(RESOLVER_KAME)
  108. resolver=kame],
  109. [AC_TRY_COMPILE(dnl
  110. [#include <sys/types.h>
  111. #include <sys/socket.h>
  112. #include <netinet/in.h>
  113. #include <resolv.h>], [_res.nsaddr_list_un[0].sin6.sin6_family = 1;],
  114. [AC_DEFINE(RESOLVER_OLDKAME)
  115. resolver=oldkame],
  116. [AC_TRY_COMPILE(dnl
  117. [#include <sys/types.h>
  118. #include <sys/socket.h>
  119. #include <netinet/in.h>
  120. #include <resolv.h>], [_res.nsaddr_list[0].sin_family = 1;],
  121. [AC_DEFINE(RESOLVER_V4)
  122. resolver=normal], [resolver=unknown])])])])
  123. AC_MSG_RESULT($resolver)
  124. dnl Checks for optinal parameters
  125. dnl AC_MSG_CHECKING(if --enable-mediator option is specified)
  126. dnl AC_ARG_WITH(mediator, [ --with-mediator build with mediator],
  127. dnl [AC_DEFINE(MEDIATOR)
  128. dnl with_mediator=yes], [with_mediator=no])
  129. dnl AC_MSG_RESULT($with_mediator);
  130. dnl Checks for optinal parameters
  131. AC_MSG_CHECKING(if --enable-pedant option is specified)
  132. AC_ARG_ENABLE(pedant, [ --enable-pedant pedantic compilation],
  133. [if test "$enableval" = "yes"; then
  134. CFLAGS="-Wall -Werror $CFLAGS"
  135. fi], [enableval=no])
  136. AC_MSG_RESULT($enableval);
  137. dnl Checks for optinal parameters
  138. AC_MSG_CHECKING(if --enable-debug option is specified)
  139. AC_ARG_ENABLE(debug, [ --enable-debug build a debugging version],
  140. [if test "$enableval" = "yes"; then
  141. CFLAGS="-g $CFLAGS"
  142. fi], [enableval=no])
  143. AC_MSG_RESULT($enableval);
  144. AC_OUTPUT(Makefile)