Browse Source

Fix #1659

pull/1678/head
Max Lv 7 years ago
parent
commit
04f419470a
2 changed files with 31 additions and 4 deletions
  1. 5
      configure.ac
  2. 30
      m4/cares.m4

5
configure.ac

@ -81,6 +81,7 @@ AX_TLS([:], [:])
dnl Checks for crypto libraries
ss_MBEDTLS
ss_SODIUM
ss_CARES
dnl Checks for inet_ntop
ss_FUNC_INET_NTOP
@ -218,10 +219,6 @@ AC_CHECK_LIB(socket, connect)
dnl Checks for library functions.
AC_CHECK_FUNCS([malloc memset posix_memalign socket])
AC_CHECK_HEADERS([ares.h], [], [AC_MSG_ERROR([Couldn't find libcares. Try installing libc-ares-dev or c-ares-devel.])])
AC_CHECK_LIB([cares], [ares_library_init], [LIBS="-lcares $LIBS"], [AC_MSG_ERROR([Couldn't find libc-ares. Try installing libc-ares-dev or c-ares-devel.])])
AC_CHECK_HEADERS([ev.h libev/ev.h], [], [])
AC_CHECK_LIB([ev], [ev_loop_destroy], [LIBS="-lev $LIBS"], [AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])

30
m4/cares.m4

@ -0,0 +1,30 @@
dnl Check to find the libcares headers/libraries
AC_DEFUN([ss_CARES],
[
AC_ARG_WITH(cares,
AS_HELP_STRING([--with-cares=DIR], [The c-ares library base directory, or:]),
[cares="$withval"
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"]
)
AC_ARG_WITH(cares-include,
AS_HELP_STRING([--with-cares-include=DIR], [The c-ares library headers directory (without trailing /cares)]),
[cares_include="$withval"
CFLAGS="$CFLAGS -I$withval"]
)
AC_ARG_WITH(cares-lib,
AS_HELP_STRING([--with-cares-lib=DIR], [The c-ares library library directory]),
[cares_lib="$withval"
LDFLAGS="$LDFLAGS -L$withval"]
)
AC_CHECK_LIB(cares, ares_library_init,
[LIBS="-lcares $LIBS"],
[AC_MSG_ERROR([The c-ares library libraries not found.])]
)
])
Loading…
Cancel
Save