configure.in 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. AC_INIT(libenet, 12-12-2006)
  2. AM_INIT_AUTOMAKE(libenet.a, 12-12-2006)
  3. AC_PROG_CC
  4. AC_PROG_RANLIB
  5. AC_CHECK_FUNC(gethostbyaddr_r, [AC_DEFINE(HAS_GETHOSTBYADDR_R)])
  6. AC_CHECK_FUNC(gethostbyname_r, [AC_DEFINE(HAS_GETHOSTBYNAME_R)])
  7. AC_CHECK_FUNC(poll, [AC_DEFINE(HAS_POLL)])
  8. AC_CHECK_FUNC(fcntl, [AC_DEFINE(HAS_FCNTL)])
  9. AC_CHECK_FUNC(inet_pton, [AC_DEFINE(HAS_INET_PTON)])
  10. AC_CHECK_FUNC(inet_ntop, [AC_DEFINE(HAS_INET_NTOP)])
  11. AC_CHECK_MEMBER(struct msghdr.msg_flags, [AC_DEFINE(HAS_MSGHDR_FLAGS)], , [#include <sys/socket.h>])
  12. AC_CHECK_TYPE(socklen_t, [AC_DEFINE(HAS_SOCKLEN_T)], ,
  13. #include <sys/types.h>
  14. #include <sys/socket.h>
  15. )
  16. AC_EGREP_HEADER(MSG_MAXIOVLEN, /usr/include/sys/socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
  17. AC_EGREP_HEADER(MSG_MAXIOVLEN, socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
  18. AC_MSG_CHECKING(whether to use CRC32)
  19. AC_ARG_ENABLE(crc32,
  20. [ --enable-crc32 enable CRC32 packet verification ],
  21. [if test "$enableval" = yes; then
  22. AC_MSG_RESULT(yes)
  23. AC_DEFINE(USE_CRC32)
  24. else
  25. AC_MSG_RESULT(no)
  26. fi],
  27. [AC_MSG_RESULT(no)])
  28. AC_OUTPUT([Makefile include/Makefile include/enet/Makefile])