]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
portability: fix MacOS libresolv usage 144/head
authorSami Kerola <kerolasa@iki.fi>
Tue, 23 Aug 2016 19:21:58 +0000 (20:21 +0100)
committerSami Kerola <kerolasa@iki.fi>
Tue, 23 Aug 2016 20:49:58 +0000 (21:49 +0100)
MacOS has res_query in libc, but needs libresolv for dn_expand().

configure.ac

index 8ce4da8a823f28a0b4d6e25e839129d68b5e4f5c..5f449a62c4d377d1fc937b8b551c74126aa8ff11 100644 (file)
@@ -136,6 +136,10 @@ AC_CHECK_FUNC([res_query], [RESOLV_LIBS=""], [
     ])
   ])
 ])
+dnl MacOS has res_query in libc, but needs libresolv for dn_expand().
+AS_IF([test "x" = "x$RESOLV_LIBS"], [
+  AC_CHECK_LIB([resolv], [dn_expand], [RESOLV_LIBS="-lresolv"])
+])
 AC_SUBST([RESOLV_LIBS])
 
 # Check errno and socket data types.