aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authoreihrul <eihrul>2010-05-13 17:31:45 +0000
committereihrul <eihrul>2010-05-13 17:31:45 +0000
commit0456e849d675aeecda75d93082cfd3943ddd5aa3 (patch)
tree731a257b519507fe2ee8ac991c97d93ad00844e1 /configure.ac
parentf72b0300f69cdcf25b380392b78b065117afad47 (diff)
downloadenet-0456e849d675aeecda75d93082cfd3943ddd5aa3.tar.gz
enet-0456e849d675aeecda75d93082cfd3943ddd5aa3.zip
WIP build system cleanups by Nathan Phillip Brink
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a923fbc
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,40 @@
+AC_INIT([libenet], [5-13-2010])
+AC_CONFIG_SRCDIR([include/enet/enet.h])
+AM_INIT_AUTOMAKE([foreign])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+AC_CHECK_FUNC(gethostbyaddr_r, [AC_DEFINE(HAS_GETHOSTBYADDR_R)])
+AC_CHECK_FUNC(gethostbyname_r, [AC_DEFINE(HAS_GETHOSTBYNAME_R)])
+AC_CHECK_FUNC(poll, [AC_DEFINE(HAS_POLL)])
+AC_CHECK_FUNC(fcntl, [AC_DEFINE(HAS_FCNTL)])
+AC_CHECK_FUNC(inet_pton, [AC_DEFINE(HAS_INET_PTON)])
+AC_CHECK_FUNC(inet_ntop, [AC_DEFINE(HAS_INET_NTOP)])
+
+AC_CHECK_MEMBER(struct msghdr.msg_flags, [AC_DEFINE(HAS_MSGHDR_FLAGS)], , [#include <sys/socket.h>])
+
+AC_CHECK_TYPE(socklen_t, [AC_DEFINE(HAS_SOCKLEN_T)], ,
+ #include <sys/types.h>
+ #include <sys/socket.h>
+)
+
+AC_EGREP_HEADER(MSG_MAXIOVLEN, /usr/include/sys/socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
+AC_EGREP_HEADER(MSG_MAXIOVLEN, socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
+
+AC_MSG_CHECKING(whether to use CRC32)
+AC_ARG_ENABLE(crc32,
+ [ --enable-crc32 enable CRC32 packet verification ],
+ [if test "$enableval" = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(USE_CRC32)
+ else
+ AC_MSG_RESULT(no)
+ fi],
+ [AC_MSG_RESULT(no)])
+
+AC_CONFIG_FILES([Makefile
+ libenet.pc])
+AC_OUTPUT