configure.ac 1.2 KB

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