Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Sep 7, 2017
1 parent a09629d commit 04f4194
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
5 changes: 1 addition & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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@:>@.])])

Expand Down
30 changes: 30 additions & 0 deletions m4/cares.m4
Original file line number Diff line number Diff line change
@@ -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.])]
)
])

0 comments on commit 04f4194

Please sign in to comment.