sgsn: Integrate c-ares with the osmocom event loop

c-ares is an asynchronous DNS resolver and we need it to
resolve the GGSN address. This is integrating the library
into our infrastructure. We will create and maintain a list
of registered FDs (c-ares is currently only using one of
them) and (re-)schedule the timer after events occurred.
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 394972f..fb6feb9 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -79,6 +79,11 @@
 AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes)
 AC_SUBST(found_libgtp)
 
+found_libcares=yes
+PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no])
+AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes)
+AC_SUBST(found_libcares)
+
 dnl checks for header files
 AC_HEADER_STDC
 AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))