summaryrefslogtreecommitdiffstats
path: root/src/external/libcares.m4
diff options
context:
space:
mode:
Diffstat (limited to 'src/external/libcares.m4')
-rw-r--r--src/external/libcares.m415
1 files changed, 15 insertions, 0 deletions
diff --git a/src/external/libcares.m4 b/src/external/libcares.m4
new file mode 100644
index 0000000..0a764d3
--- /dev/null
+++ b/src/external/libcares.m4
@@ -0,0 +1,15 @@
+AC_SUBST(CARES_LIBS)
+AC_SUBST(CARES_CFLAGS)
+
+PKG_CHECK_MODULES([CARES], [libcares], [found_libcares=yes], [found_libcares=no])
+
+SSS_AC_EXPAND_LIB_DIR()
+AS_IF([test x"$found_libcares" != xyes],
+ [AC_CHECK_HEADERS([ares.h],
+ [AC_CHECK_LIB([cares],
+ [ares_init],
+ [CARES_LIBS="-L$sss_extra_libdir -lcares"],
+ [AC_MSG_ERROR([No usable c-ares library found])],
+ [-L$sss_extra_libdir])],
+ [AC_MSG_ERROR([c-ares header files are not installed])])]
+)