diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2012-10-18 21:58:14 -0400 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2012-10-20 02:45:23 -0400 |
commit | 445567f442b2854d1f9309e46a225ab5111f237a (patch) | |
tree | 9efd1179c343fe02d7a5c719358ea9d5b6ec72b7 /configure.ac | |
parent | 42625a55de0b66a75cf4afcfd658bf726ad77db4 (diff) | |
download | rabbitmq-c-github-ask-445567f442b2854d1f9309e46a225ab5111f237a.tar.gz |
autoconf: Detect if a socket library is needed
Certain platforms require linking against a socket
and/or name resolution library. Detect this in the
autoconf configure script and add it to the link
LIBS appropriately
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 07e0349..117c3a6 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,21 @@ AS_IF([test "x$os_win32" = xyes], [AC_DEFINE([AMQP_STATIC], [1], [Define to 1 for a static Win32 build.])])])]) +# Detect which libraries we might need to use socket functions: +# Solaris needs -lsocket -lnsl +# QNX will need -lsocket + +AC_SEARCH_LIBS([getaddrinfo], [socket], [], + [AC_CHECK_LIB([getaddrinfo], [socket], + [LIBS="-lsocket -lnsl $LIBS"], + [AC_MSG_ERROR([cannot find name resolution library (library with getaddrinfo symbol)])], + [-lnsl])]) +AC_SEARCH_LIBS([socket], [socket], [], + [AC_CHECK_LIB([socket], [socket], + [LIBS="-lsocket -lnsl $LIBS"], + [AC_MSG_ERROR([cannot find socket library (library with socket symbol)])], + [-lnsl])]) + # 64-bit option AC_ARG_ENABLE([64-bit], [AS_HELP_STRING([--enable-64-bit], |